Skip to content

Commit

Permalink
Merge branch 'oxidize-dag' into oxidize-dag-layers
Browse files Browse the repository at this point in the history
  • Loading branch information
raynelfss authored Jul 13, 2024
2 parents 6b454c2 + 519071c commit 99a9e1a
Show file tree
Hide file tree
Showing 5 changed files with 461 additions and 218 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ license = "Apache-2.0"
# Each crate can add on specific features freely as it inherits.
[workspace.dependencies]
indexmap.version = "2.2.6"
hashbrown.version = "0.14.0"
hashbrown.version = "0.14.5"
num-complex = "0.4"
ndarray = "^0.15.6"
numpy = "0.21.0"
Expand Down
5 changes: 4 additions & 1 deletion crates/circuit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ doctest = false

[dependencies]
ahash = "0.8.11"
hashbrown.workspace = true
rustworkx-core = { git = "https://github.com/Qiskit/rustworkx.git" }
num-complex.workspace = true
ndarray.workspace = true
Expand All @@ -21,6 +20,10 @@ numpy.workspace = true
workspace = true
features = ["hashbrown", "indexmap", "num-complex", "num-bigint", "smallvec"]

[dependencies.hashbrown]
workspace = true
features = ["rayon"]

[dependencies.indexmap]
workspace = true
features = ["rayon"]
Expand Down
7 changes: 7 additions & 0 deletions crates/circuit/src/circuit_instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::imports::{
};
use crate::interner::Index;
use crate::operations::{OperationType, Param, PyGate, PyInstruction, PyOperation, StandardGate};
use crate::{Clbit, Qubit};

/// These are extra mutable attributes for a circuit instruction's state. In general we don't
/// typically deal with this in rust space and the majority of the time they're not used in Python
Expand Down Expand Up @@ -85,6 +86,12 @@ impl PackedInstruction {
}
}

pub fn condition(&self) -> Option<&PyObject> {
self.extra_attrs
.as_ref()
.and_then(|args| args.condition.as_ref())
}

pub fn is_parameterized(&self) -> bool {
self.params
.iter()
Expand Down
Loading

0 comments on commit 99a9e1a

Please sign in to comment.