Skip to content

docs: added examples in docs srtring#2920

Merged
nicolaassolini-qntm merged 12 commits intomainfrom
na/667-docs-add-examples
Mar 6, 2026
Merged

docs: added examples in docs srtring#2920
nicolaassolini-qntm merged 12 commits intomainfrom
na/667-docs-add-examples

Conversation

@nicolaassolini-qntm
Copy link
Copy Markdown
Contributor

  • Added an example to the crate-level documentation in hugr/src/lib.rs, showing how to build a simple boolean circuit HUGR using DFGBuilder.
  • Added an example to the hugr-core/src/extension.rs documentation, demonstrating how to define and use a custom quantum extension to build a quantum circuit HUGR.
  • Expanded the documentation for DFGBuilder in hugr-core/src/builder/dataflow.rs with references to crate-level and extension module examples for constructing dataflow graphs, including quantum circuits.
  • Added a detailed example to the ModuleBuilder documentation in hugr-core/src/builder/module.rs.
  • Improved the module-level documentation for hugr-core/src/builder.rs by updating references to builder types and linking to their documentation.
  • Added documentation for hugr-core/src/ops.rs, providing an overview of operation types, their roles in HUGR, and a code example.
  • Added in hugr-passes/src/composable.rs a summary of the ComposablePass` trait.
  • Added a brief module-level docstring to hugr-core/src/builder/module.rs for clarity.

@nicolaassolini-qntm nicolaassolini-qntm linked an issue Mar 5, 2026 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.83%. Comparing base (437b936) to head (9fe8f16).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2920   +/-   ##
=======================================
  Coverage   83.83%   83.83%           
=======================================
  Files         269      269           
  Lines       54021    54021           
  Branches    47974    47974           
=======================================
  Hits        45286    45286           
  Misses       6320     6320           
  Partials     2415     2415           
Flag Coverage Δ
python 88.65% <ø> (ø)
rust 83.22% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nicolaassolini-qntm nicolaassolini-qntm changed the title doc: added examples in docs srtring docs: added examples in docs srtring Mar 6, 2026
@nicolaassolini-qntm nicolaassolini-qntm marked this pull request as ready for review March 6, 2026 08:31
@nicolaassolini-qntm nicolaassolini-qntm requested a review from a team as a code owner March 6, 2026 08:31
Copy link
Copy Markdown
Collaborator

@aborgna-q aborgna-q left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of minor suggestions, but it looks good!

My main change request is simplifying the inline comments in module.

@nicolaassolini-qntm nicolaassolini-qntm added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit d657835 Mar 6, 2026
30 checks passed
@nicolaassolini-qntm nicolaassolini-qntm deleted the na/667-docs-add-examples branch March 6, 2026 13:09
@hugrbot hugrbot mentioned this pull request Mar 5, 2026
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2026
## 🤖 New release

* `hugr-model`: 0.25.6 -> 0.25.7 (✓ API compatible changes)
* `hugr-core`: 0.25.6 -> 0.25.7 (✓ API compatible changes)
* `hugr-llvm`: 0.25.6 -> 0.25.7 (✓ API compatible changes)
* `hugr-passes`: 0.25.6 -> 0.25.7 (✓ API compatible changes)
* `hugr-persistent`: 0.4.6 -> 0.4.7 (✓ API compatible changes)
* `hugr`: 0.25.6 -> 0.25.7 (✓ API compatible changes)
* `hugr-cli`: 0.25.6 -> 0.25.7 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr-model`

<blockquote>

##
[0.25.6](hugr-model-v0.25.5...hugr-model-v0.25.6)
- 2026-02-20

### New Features

- Remove size limitation for binary envelopes
([#2880](#2880))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.25.7](hugr-core-v0.25.6...hugr-core-v0.25.7)
- 2026-03-06

### Documentation

- added examples in docs srtring
([#2920](#2920))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.25.6](hugr-llvm-v0.25.5...hugr-llvm-v0.25.6)
- 2026-02-20

### New Features

- Add error context when lowering hugrs to LLVM
([#2869](#2869))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.25.7](hugr-passes-v0.25.6...hugr-passes-v0.25.7)
- 2026-03-06

### Documentation

- added examples in docs srtring
([#2920](#2920))

### New Features

- Define pass application scopes
([#2772](#2772))
- Modify dead code elimination pass to remove unreachable basic blocks
([#2884](#2884))
- Add non-generic `with_scope` method for composable passes
([#2910](#2910))
- update passes to use PassScope where non-breaking
([#2836](#2836))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.4.0](hugr-persistent-v0.3.4...hugr-persistent-v0.4.0)
- 2025-12-22

### New Features

- [**breaking**] Remove `RootCheckable`
([#2704](#2704))
- [**breaking**] Bump MSRV to Rust 1.89
([#2747](#2747))
- [**breaking**] Type-safe access for node metadata
([#2755](#2755))

### Refactor

- [**breaking**] Remove multiple deprecated definitions
([#2751](#2751))
</blockquote>

## `hugr`

<blockquote>

##
[0.25.7](hugr-v0.25.6...hugr-v0.25.7)
- 2026-03-06

### Documentation

- added examples in docs srtring
([#2920](#2920))

### New Features

- Define pass application scopes
([#2772](#2772))
- Modify dead code elimination pass to remove unreachable basic blocks
([#2884](#2884))
- Add non-generic `with_scope` method for composable passes
([#2910](#2910))
- update passes to use PassScope where non-breaking
([#2836](#2836))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.25.6](hugr-cli-v0.25.5...hugr-cli-v0.25.6)
- 2026-02-20

### New Features

- Add s expression format to envelope formats
([#2864](#2864))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
@hugrbot hugrbot mentioned this pull request Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Add examples for some small usecases

2 participants