Skip to content

Commit d88dce5

Browse files
committed
Add base representation of SparseObservable
This adds the base representation of `SparseObservable`, including the simple constructors from Python space and the ability to view the data buffers. This commit does not include the mathematical manipulations of the operators, nor some of the helper methods that will be used to manipulate the operators in the context of primitives execution. These will follow in subsequent patches. The design and implementation notes of `SparseObservable` are described in a Qiskit RFC that preceeded this patch series[^1], and it's best to consult that document for full details on the operator considerations. [^1]: https://github.com/Qiskit/RFCs/blob/7a74b08793475b7b0142d3a3f7142cabcfd33ab8/0021-sparse-observable.md
1 parent 4e573f3 commit d88dce5

10 files changed

Lines changed: 2651 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/accelerate/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ qiskit-circuit.workspace = true
2626
thiserror.workspace = true
2727
ndarray_einsum_beta = "0.7"
2828
once_cell = "1.20.2"
29+
bytemuck.workspace = true
2930

3031
[dependencies.smallvec]
3132
workspace = true
@@ -60,4 +61,4 @@ version = "0.18.22"
6061
features = ["macro"]
6162

6263
[features]
63-
cache_pygates = ["qiskit-circuit/cache_pygates"]
64+
cache_pygates = ["qiskit-circuit/cache_pygates"]

crates/accelerate/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ pub mod remove_diagonal_gates_before_measure;
4040
pub mod results;
4141
pub mod sabre;
4242
pub mod sampled_exp_val;
43+
pub mod sparse_observable;
4344
pub mod sparse_pauli_op;
4445
pub mod split_2q_unitaries;
4546
pub mod star_prerouting;

0 commit comments

Comments
 (0)