Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add hashable Angle type to Quantum extension #608

Merged
merged 25 commits into from
Nov 1, 2023
Merged

Conversation

cqc-alec
Copy link
Collaborator

@cqc-alec cqc-alec commented Oct 16, 2023

After coding it up I have a couple of reservations about this:

  • Calling the parameter "precision" suggests that it is an approximate representation of a value, rather than an exact representation of a value that is restricted in its possibilities. I think that the latter makes more sense, since "approximate values" are (I think) outside the scope of HUGR, so another name might be better.
  • Compilation passes that squash rotation gates using Euler-angle decomposition will in general not transform Angle<N> values into Angle<N> values exactly. Therefore care will be needed in applying such passes. Of course, even when applied to float64 they are not exact and can accumulate rounding error, so this isn't a new problem, just one that's made more obvious.

The big advantage is that it makes angle values (and therefore circuits containing them) equatable and hashable.

@cqc-alec cqc-alec requested a review from acl-cqc October 16, 2023 14:06
@cqc-alec cqc-alec marked this pull request as ready for review October 16, 2023 14:07
@ss2165 ss2165 self-requested a review October 17, 2023 09:00
Copy link
Member

@ss2165 ss2165 left a comment

Choose a reason for hiding this comment

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

There is an angle type still in the rotation extension, I think it is worth removing that one while adding this.

I agree about the name precision. Not sure of a better alternative, only one I've got is the descriptive route denom_power

| `aconst<N, x>` | none | `angle<N>` | const node producing angle $2 \pi x / 2^N$ (where $0 \leq x \lt 2^N$) |
| `atrunc<M,N>` | `angle<M>` | `angle<N>` | round `angle<M>` to `angle<N>`, where $M \geq N$, rounding down in $[0, 2\pi)$ if necessary |
| `awiden<M,N>` | `angle<M>` | `angle<N>` | widen `angle<M>` to `angle<N>`, where $M \leq N$ |
| `aadd<N>` | `angle<N>`, `angle<N>` | `angle<N>` | add two angles |
Copy link
Member

Choose a reason for hiding this comment

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

might be a bit wild, but I wonder if we could have something like

Suggested change
| `aadd<N>` | `angle<N>`, `angle<N>` | `angle<N>` | add two angles |
| `aadd<N, M>` | `angle<N>`, `angle<M>` | `angle<N>` | add two angles, where $M \leq N$|

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, or even aadd<N,M> : (Angle<N>, Angle<M>) --> Angle<max(N,M)> assuming that's something we can express (I think so).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

#[typetag::serde]
impl CustomConst for ConstAngle {
fn name(&self) -> SmolStr {
format!("a(2π*{}/{})", self.value, 1u64 << self.precision).into()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
format!("a(2π*{}/{})", self.value, 1u64 << self.precision).into()
format!("a(2π*{}/2^{})", self.value, self.precision).into()

I prefer more explicit

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

}
Ok(FunctionType::new(
vec![angle_type(arg0.clone())],
vec![Type::new_sum(vec![angle_type(arg1.clone()), ERROR_TYPE])],
Copy link
Member

Choose a reason for hiding this comment

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

what causes the error state? It's not in the spec

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, this can't error -- I think I was confusing this with an operation that would fail (instead of rounding down) if the angles didn't match exactly. That could actually be a useful operation, and I should maybe add it -- or replace awiden<M,N> with a more general one that doesn't require M <= N but can fail if M > N and the angle doesn't "fit" exactly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Have changed awiden to a more general aconvert which can return an error.


impl ConstAngle {
/// Create a new [`ConstAngle`]
pub fn new(precision: u8, value: u64) -> Result<Self, ConstTypeError> {
Copy link
Member

Choose a reason for hiding this comment

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

would it be useful to add a from_f64(value: f64, precision: u8), with rounding down?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It could be. Will add.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made a from_radians() method that takes an f64.

@cqc-alec
Copy link
Collaborator Author

There is an angle type still in the rotation extension, I think it is worth removing that one while adding this.

I wondered about this But wasn't sure what the consequences would be (does anything else depend on the rotation extension?).

@cqc-alec
Copy link
Collaborator Author

I agree about the name precision. Not sure of a better alternative, only one I've got is the descriptive route denom_power

I may go with "log-denominator", bit of a mouthful though it is.

@cqc-alec
Copy link
Collaborator Author

There is an angle type still in the rotation extension, I think it is worth removing that one while adding this.

I wondered about this But wasn't sure what the consequences would be (does anything else depend on the rotation extension?).

Have left this for now, as this would probably involve rewriting the whole of rotations, which we may want to do but I think in another PR.

@cqc-alec cqc-alec requested a review from ss2165 October 17, 2023 15:54
@cqc-alec cqc-alec changed the title Add hashable Angle type to Quantum extension feat: Add hashable Angle type to Quantum extension Oct 19, 2023
@acl-cqc
Copy link
Contributor

acl-cqc commented Oct 25, 2023

There is an angle type still in the rotation extension, I think it is worth removing that one while adding this.

I agree about the name precision. Not sure of a better alternative, only one I've got is the descriptive route denom_power

To me precision means the number of digits. Whether those digits are correct or not would be accuracy. However, a low precision number (say 1.0) vs a high precision number (1.0153245) - the former identifies a range that would include the latter (indeed, all numbers between 0.95 and 1.05). Whereas for Angle I think you are saying that the angle is exactly what you get by dividing the numerator by the denominator, in which case yes, some variant of denominator seems appropriate (or "unit"? As in unit of measurement, not the 0-element tuple!)...

log_denom seems good to me, I prefer that to denom_power :-)

/// Type parameter for the log-denominator of an angle.
// SAFETY: unsafe block should be ok as the value is definitely not zero.
#[allow(clippy::assertions_on_constants)]
pub const LOG_DENOM_TYPE_PARAM: TypeParam = TypeParam::bounded_nat(unsafe {
Copy link
Contributor

Choose a reason for hiding this comment

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

Whoa! new_unchecked needs unsafe, I see. Hmmmm. Ick. (I think? Or should we make our new_uncheckeds also need unsafe?)

The following works without an unsafe, but you can keep the assert:
NonZeroU64::MIN.saturating_add((LOG_WIDTH_BOUND-1) as u64)

or even
NonZeroU64::MIN.saturating_add((LOG_WIDTH_BOUND as u64)-NonZeroU64::MIN.get())

Ymmv :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice, we can probably do this in the integer extension code too where there is a similar unsafe block.


impl ConstAngle {
/// Create a new [`ConstAngle`] from a log-denominator and a numerator
pub fn new(log_denom: u8, value: u64) -> Result<Self, ConstTypeError> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to make this const ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ach, boo, it isn't - because of the String in our CustomCheckFailure type!! We should change that (SmolStr perhaps), but I guess that doesn't really belong in this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seems not, because of the to_owned() inside it.


/// Create a new [`ConstAngle`] from a log-denominator and a floating-point value in radians,
/// rounding to the nearest corresponding value. (Ties round away from zero.)
pub fn from_radians(log_denom: u8, theta: f64) -> Result<Self, ConstTypeError> {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe rounding_radians ?

Copy link
Contributor

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

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

Looks good! Of course there is no hash defined here, or any implementation (e.g. Rust definition) of the type.

@cqc-alec cqc-alec requested a review from acl-cqc October 30, 2023 10:37

The Quantum extension also defines a specialized `angle<N>` type which is used
to express parameters of rotation gates. The type is parametrized by the
_log-denominator_, which is an integer $N \in [0, 53]$; angles with
Copy link
Contributor

Choose a reason for hiding this comment

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

Including N=0 ? So angles that are multiples of 2pi? Do those do anything? I guess it may be easier to store 0-based, but 53 is an unusual choice of maximum anyway...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They don't do much, but an Rz(2*pi) operation is a global phase flip so it's conceivable. I don't think there's any harm in allowing 0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually because we restrict the numerator to [0, 2^n) we couldn't express that. Hmm, this is a bit annoying, because in tket we can.

Copy link
Collaborator Author

@cqc-alec cqc-alec Oct 31, 2023

Choose a reason for hiding this comment

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

Morally an angle type should be modulo 2pi (not modulo 4pi as it sometimes is in tket), so the parameter to Rz is not really an angle (but a half-angle).

Copy link
Contributor

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

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

Generally LGTM, thanks Alec - and sorry for slow review. There are a couple things that make me slightly nervous - that unsafe rings alarm bells (for now, so I guess gradually I'll reduce my sensitivity), and I wonder about specifying some properties of the hash (which we aren't implementing anyway....)

log-denominator $N$ are multiples of $2 \pi / 2^N$, where the multiplier is an
unsigned `int<N>`. The maximum log-denominator $53$ effectively gives the
resolution of a `float64` value; but note that unlike `float64` all angle values
are equatable and hashable.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering whether x / (2pi/2^N) has the same hash as (2x)/(2pi/2^(N+1)), but I don't think you give the hash "algorithm" so fine

Copy link
Contributor

Choose a reason for hiding this comment

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

and they are different types so I guess there is no need for them to

Copy link
Contributor

Choose a reason for hiding this comment

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

However, the angles are effectively interpreted modulo 2^N. So does, say, (3 / (2pi/2^2)) have the same hash as (7/(2pi/2^2)) ? Should it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we restrict the numerator to the range $[0, 2^n]$, which I think we should, then all values with a given denominator $2^n$ have different hashes. Interesting question is whether values with different denominators should have the same hash if they represent the same angle: e.g. $1 \times 2\pi/2^2$ and $2 \times 2\pi/2^3$. I think probably not, since they are different types and you can do different things with them.


impl ConstAngle {
/// Create a new [`ConstAngle`] from a log-denominator and a numerator
pub fn new(log_denom: u8, value: u64) -> Result<Self, ConstTypeError> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ach, boo, it isn't - because of the String in our CustomCheckFailure type!! We should change that (SmolStr perhaps), but I guess that doesn't really belong in this PR

}

/// The smallest forbidden log-denominator.
pub const LOG_DENOM_BOUND: u8 = 54;
Copy link
Contributor

Choose a reason for hiding this comment

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

super-nit: I find LOG_DENOM_MAX clearer (without having to read the doc) as to whether it's inclusive/exclusive; then you'd change < to <=

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed.

src/std_extensions/quantum.rs Show resolved Hide resolved

fn aunop_sig(arg_values: &[TypeArg]) -> Result<FunctionType, SignatureError> {
let [arg] = collect_array(arg_values);
Ok(FunctionType::new(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: FunctionType::new_linear

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup, changed this and a couple of others.

))
}

fn aunop_sig(arg_values: &[TypeArg]) -> Result<FunctionType, SignatureError> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Naming perhaps a little terse here...took me a while to figure out thataun is short for "angle unary"

}

/// An angle
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
Copy link
Contributor

Choose a reason for hiding this comment

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

I note we aren't actually deriving (or implementing) Hash here...that may be right though...

Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Merging #608 (edf1cd3) into main (2e504d0) will decrease coverage by 0.28%.
The diff coverage is 65.46%.

@@            Coverage Diff             @@
##             main     #608      +/-   ##
==========================================
- Coverage   78.57%   78.30%   -0.28%     
==========================================
  Files          65       65              
  Lines       11341    11530     +189     
  Branches    11341    11530     +189     
==========================================
+ Hits         8911     9028     +117     
- Misses       1793     1863      +70     
- Partials      637      639       +2     
Files Coverage Δ
src/std_extensions/quantum.rs 70.15% <65.46%> (-21.15%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cqc-alec cqc-alec enabled auto-merge October 31, 2023 15:14
@cqc-alec cqc-alec disabled auto-merge October 31, 2023 15:22
@cqc-alec cqc-alec removed the request for review from ss2165 October 31, 2023 15:22
),
));
}
let a = (((1u64 << log_denom) as f64) * theta / TAU).round() as i64;
Copy link
Member

Choose a reason for hiding this comment

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

🙏 TAU 🙏

specification/hugr.md Outdated Show resolved Hide resolved
);
assert_matches!(
ConstAngle::new(54, 256),
Err(ConstTypeError::CustomCheckFail(_))
Copy link
Member

Choose a reason for hiding this comment

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

add a test for from_radians?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now added.

@cqc-alec cqc-alec requested a review from ss2165 October 31, 2023 16:47
Copy link
Member

@ss2165 ss2165 left a comment

Choose a reason for hiding this comment

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

👍

@cqc-alec cqc-alec added this pull request to the merge queue Nov 1, 2023
Merged via the queue into main with commit d5be87f Nov 1, 2023
@cqc-alec cqc-alec deleted the angletype branch November 1, 2023 13:40
@github-actions github-actions bot mentioned this pull request Jan 3, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jan 15, 2024
## 🤖 New release
* `quantinuum-hugr`: 0.1.0

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

<blockquote>

## 0.1.0 (2024-01-15)

### Bug Fixes

- Subgraph boundaries with copies
([#440](#440))
- [**breaking**] Use internal tag for SumType enum serialisation
([#462](#462))
- Check kind before unwrap in insert_identity
([#475](#475))
- Allow for variables to get solved in inference
([#478](#478))
- In IdentityInsertion add noop to correct parent
([#477](#477))
- Failing release tests ([#485](#485))
- [**breaking**] Serialise `Value`, `PrimValue`, and `TypeArg` with
internal tags ([#496](#496))
- Serialise custom constants with internal tag
([#502](#502))
- [**breaking**] Reduce max int width in arithmetic extension to 64
([#504](#504))
- HugrView::get_function_type
([#507](#507))
- TODO in resolve_extension_ops: copy across input_extensions
([#510](#510))
- Use given input extensions in `define_function`
([#524](#524))
- Lessen requirements for hugrs in outline_cfg
([#528](#528))
- Make unification logic less strict
([#538](#538))
- Simple replace incorrectly copying metadata
([#545](#545))
- Account for self-referencial constraints
([#551](#551))
- Consider shunted metas when comparing equality
([#555](#555))
- Join labels in issue workflow
([#563](#563))
- Comment out broken priority code
([#562](#562))
- Handling of issues with no priority label
([#573](#573))
- Don't insert temporary wires when extracting a subgraph
([#582](#582))
- Improve convexity checking and fix test
([#585](#585))
- Ignore input->output links in
SiblingSubgraph::try_new_dataflow_subgraph
([#589](#589))
- Enforce covariance of SiblingMut::RootHandle
([#594](#594))
- Erratic stack overflow in infer.rs (live_var)
([#638](#638))
- Work harder in variable instantiation
([#591](#591))
- Actually add the error type to prelude
([#672](#672))
- Serialise dynamically computed opaqueOp signatures
([#690](#690))
- FuncDefns don't require that their extensions match their children
([#688](#688))
- Binary compute_signature returning a PolyFuncType with binders
([#710](#710))
- Use correct number of args for int ops
([#723](#723))
- [**breaking**] Add serde tag to TypeParam enum
([#722](#722))
- Allow widening and narrowing to same width.
([#735](#735))
- Case node should not have an external signature
([#749](#749))
- [**breaking**] Normalize input/output value/static/other ports in
`OpType` ([#783](#783))
- No dataflow_signature for block types
([#792](#792))
- Ignore unsupported test in miri
([#794](#794))
- Include schema rather than read file
([#807](#807))

### Documentation

- Add operation constraint to quantum extension
([#543](#543))
- Coverage check section in DEVELOPMENT.md
([#648](#648))
- Remove "quantum extension" from HUGR spec.
([#694](#694))
- Improve crate-level docs, including example code.
([#698](#698))
- Spec cleanups and clarifications
([#742](#742))
- Spec clarifications ([#738](#738))
- Spec updates ([#741](#741))
- [spec] Remove references to causal cone and Order edges from Input
([#762](#762))
- Mention experimental inference in readme
([#800](#800))
- Collection of spec updates for 0.1
([#801](#801))
- Add schema v0 ([#805](#805))
- Update spec wrt. polymorphism
([#791](#791))

### Features

- Derive things for builder structs
([#229](#229))
- Return a slice of types from the signature
([#238](#238))
- Move `dot_string` to `HugrView`
([#271](#271))
- [**breaking**] Change `TypeParam::USize` to `TypeParam::BoundedNat`
and use in int extensions
([#445](#445))
- TKET2 compatibility requirements
([#450](#450))
- Split methods between `HugrMut` and `HugrMutInternals`
([#441](#441))
- Add `HugrView::node_connections` to get all links between nodes
([#460](#460))
- Location information in extension inference error
([#464](#464))
- Add T, Tdg, X gates ([#466](#466))
- [**breaking**] Add `ApplyResult` associated type to `Rewrite`
([#472](#472))
- Implement rewrite `IdentityInsertion`
([#474](#474))
- Instantiate inferred extensions
([#461](#461))
- Default DFG builders to open extension sets
([#473](#473))
- Some helper methods ([#482](#482))
- Extension inference for conditional nodes
([#465](#465))
- Add ConvexChecker ([#487](#487))
- Add clippy lint for mut calls in a debug_assert
([#488](#488))
- Default more builder methods to open extension sets
([#492](#492))
- Port is serializable ([#489](#489))
- More general portgraph references
([#494](#494))
- Add extension deltas to CFG ops
([#503](#503))
- Implement petgraph traits on Hugr
([#498](#498))
- Make extension delta a parameter of CFG builders
([#514](#514))
- [**breaking**] SiblingSubgraph does not borrow Hugr
([#515](#515))
- Validate TypeArgs to ExtensionOp
([#509](#509))
- Derive Debug & Clone for `ExtensionRegistry`.
([#530](#530))
- Const nodes are built with some extension requirements
([#527](#527))
- Some python errors and bindings
([#533](#533))
- Insert_hugr/insert_view return node map
([#535](#535))
- Add `SiblingSubgraph::try_from_nodes_with_checker`
([#547](#547))
- PortIndex trait for undirected port parameters
([#553](#553))
- Insert/extract subgraphs from a HugrView
([#552](#552))
- Add `new_array` operation to prelude
([#544](#544))
- Add a `DataflowParentID` node handle
([#559](#559))
- Make TypeEnum and it's contents public
([#558](#558))
- Optional direction check when querying a port index
([#566](#566))
- Extension inference for CFGs
([#529](#529))
- Better subgraph verification errors
([#587](#587))
- Compute affected nodes for `SimpleReplacement`
([#600](#600))
- Move `SimpleReplace::invalidation_set` to the `Rewrite` trait
([#602](#602))
- [**breaking**] Resolve extension ops (mutating Hugr) in
(infer_and_->)update_validate
([#603](#603))
- Add accessors for node index and const values
([#605](#605))
- [**breaking**] Expose the value of ConstUsize
([#621](#621))
- Nicer debug and display for core types
([#628](#628))
- [**breaking**] Static checking of Port direction
([#614](#614))
- Builder and HugrMut add_op_xxx default to open extensions
([#622](#622))
- [**breaking**] Add panicking integer division ops
([#625](#625))
- Add hashable `Angle` type to Quantum extension
([#608](#608))
- [**breaking**] Remove "rotations" extension.
([#645](#645))
- Port.as_directed to match on either direction
([#647](#647))
- Impl GraphRef for PetgraphWrapper
([#651](#651))
- Provide+implement Replace API
([#613](#613))
- Require the node's metadata to always be a Map
([#661](#661))
- [**breaking**] Polymorphic function types (inc OpDefs) using dyn trait
([#630](#630))
- Make prelude error type public
([#669](#669))
- Shorthand for retrieving custom constants from `Const`, `Value`
([#679](#679))
- [**breaking**] HugrView API improvements
([#680](#680))
- Make FuncDecl/FuncDefn polymorphic
([#692](#692))
- [**breaking**] Simplify `SignatureFunc` and add custom arg validation.
([#706](#706))
- [**breaking**] Drop the `pyo3` feature
([#717](#717))
- [**breaking**] `OpEnum` trait for common opdef functionality
([#721](#721))
- MakeRegisteredOp trait for easier registration
([#726](#726))
- Getter for `PolyFuncType::body`
([#727](#727))
- `Into<OpType>` for custom ops
([#731](#731))
- Always require a signature in `OpaqueOp`
([#732](#732))
- Values (and hence Consts) know their extensions
([#733](#733))
- [**breaking**] Use ConvexChecker trait
([#740](#740))
- Custom const for ERROR_TYPE
([#756](#756))
- Implement RemoveConst and RemoveConstIgnore
([#757](#757))
- Constant folding implemented for core and float extension
([#769](#769))
- Constant folding for arithmetic conversion operations
([#720](#720))
- DataflowParent trait for getting inner signatures
([#782](#782))
- Constant folding for logic extension
([#793](#793))
- Constant folding for list operations
([#795](#795))
- Add panic op to prelude
([#802](#802))
- Const::from_bool function
([#803](#803))

### HugrMut

- Validate nodes for set_metadata/get_metadata_mut, too
([#531](#531))

### HugrView

- Validate nodes, and remove Base
([#523](#523))

### Miscellaneous Tasks

- [**breaking**] Update portgraph 0.10 and pyo3 0.20
([#612](#612))
- [**breaking**] Hike MSRV to 1.75
([#761](#761))

### Performance

- Use lazy static definittion for prelude registry
([#481](#481))

### Refactor

- Move `rewrite` inside `hugr`, `Rewrite` -> `Replace` implementing new
'Rewrite' trait ([#119](#119))
- Use an excluded upper bound instead of max log width.
([#451](#451))
- Add extension info to `Conditional` and `Case`
([#463](#463))
- `ExtensionSolution` only consists of input extensions
([#480](#480))
- Remove builder from more DFG tests
([#490](#490))
- Separate hierarchy views
([#500](#500))
- [**breaking**] Use named struct for float constants
([#505](#505))
- Allow NodeType::new to take any Into<Option<ExtensionSet>>
([#511](#511))
- Move apply_rewrite from Hugr to HugrMut
([#519](#519))
- Use SiblingSubgraph in SimpleReplacement
([#517](#517))
- CFG takes a FunctionType
([#532](#532))
- Remove check_custom_impl by inlining into check_custom
([#604](#604))
- Insert_subgraph just return HashMap, make InsertionResult new_root
compulsory ([#609](#609))
- [**breaking**] Rename predicate to TupleSum/UnitSum
([#557](#557))
- Simplify infer.rs/report_mismatch using early return
([#615](#615))
- Move the core types to their own module
([#627](#627))
- Change &NodeType->&OpType conversion into op() accessor
([#623](#623))
- Infer.rs 'fn results' ([#631](#631))
- Be safe ([#637](#637))
- NodeType constructors, adding new_auto
([#635](#635))
- Constraint::Plus stores an ExtensionSet, which is a BTreeSet
([#636](#636))
- [**breaking**] Remove `SignatureDescription`
([#644](#644))
- [**breaking**] Remove add_op_<posn> by generalizing add_node_<posn>
with "impl Into" ([#642](#642))
- Rename accidentally-changed Extension::add_node_xxx back to add_op
([#659](#659))
- [**breaking**] Remove quantum extension
([#670](#670))
- Use type schemes in extension definitions wherever possible
([#678](#678))
- [**breaking**] Flatten `Prim(Type/Value)` in to parent enum
([#685](#685))
- [**breaking**] Rename `new_linear()` to `new_endo()`.
([#697](#697))
- Replace NodeType::signature() with io_extensions()
([#700](#700))
- Validate ExtensionRegistry when built, not as we build it
([#701](#701))
- [**breaking**] One way to add_op to extension
([#704](#704))
- Remove Signature struct
([#714](#714))
- Use `MakeOpDef` for int_ops
([#724](#724))
- [**breaking**] Use enum op traits for floats + conversions
([#755](#755))
- Avoid dynamic dispatch for non-folding operations
([#770](#770))
- Simplify removeconstignore verify
([#768](#768))
- [**breaking**] Unwrap BasicBlock enum
([#781](#781))
- Make clear const folding only for leaf ops
([#785](#785))
- [**breaking**] `s/RemoveConstIgnore/RemoveLoadConstant`
([#789](#789))
- Put extension inference behind a feature gate
([#786](#786))

### SerSimpleType

- Use Vec not TypeRow ([#381](#381))

### SimpleReplace+OutlineCfg

- Use HugrMut methods rather than .hierarchy/.graph
([#280](#280))

### Testing

- Update inference test to not use DFG builder
([#550](#550))
- Strengthen "failing_sccs_test", rename to "sccs" as it's not failing!
([#660](#660))
- [**breaking**] Improve coverage in signature and validate
([#643](#643))
- Use insta snapshots to add dot_string coverage
([#682](#682))
- Miri ignore file-opening test
([#684](#684))
- Unify the serialisation tests
([#730](#730))
- Add schema validation to roundtrips
([#806](#806))

### `ConstValue

- :F64` and `OpaqueOp::new`
([#206](#206))

### Cleanup

- Remove outdated comment
([#536](#536))

### Cosmetic

- Format + remove stray TODO
([#444](#444))

### Doc

- Crate name as README title + add reexport
([#199](#199))

### S/EdgeKind

- :Const/EdgeKind::Static/
([#201](#201))

### Simple_replace.rs

- Use HugrMut::remove_node, includes clearing op_types
([#242](#242))

### Spec

- Remove "Draft 3" from title of spec document.
([#590](#590))
- Rephrase confusing paragraph about TailLoop inputs/outputs
([#567](#567))

### Src/ops/validate.rs

- Common-up some type row calculations
([#254](#254))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Agustín Borgna <[email protected]>
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.

3 participants