diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 601384b4..18fc7dd6 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -207,7 +207,7 @@ jobs: - uses: taiki-e/install-action@cargo-llvm-cov - run: | cd roqoqo - cargo llvm-cov --no-default-features --lcov --output-path lcov_roqoqo.info + cargo llvm-cov --no-default-features --lcov --output-path lcov_roqoqo.info --features="circuitdag" - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 991fef1a..7a4d351d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This changelog track changes to the qoqo project starting at version v0.5.0 -## 1.2.1 +## 1.2.2 * Removed references to `pyo3::prepare_freethreaded_python();` outside of tests diff --git a/Cargo.lock b/Cargo.lock index 1550bc53..7364742a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -550,7 +550,7 @@ dependencies = [ [[package]] name = "qoqo" -version = "1.2.1" +version = "1.2.2" dependencies = [ "bincode", "nalgebra", @@ -574,7 +574,7 @@ dependencies = [ [[package]] name = "qoqo-macros" -version = "1.2.1" +version = "1.2.2" dependencies = [ "proc-macro2", "quote", @@ -672,7 +672,7 @@ dependencies = [ [[package]] name = "roqoqo" -version = "1.2.1" +version = "1.2.2" dependencies = [ "async-trait", "bincode", @@ -699,7 +699,7 @@ dependencies = [ [[package]] name = "roqoqo-derive" -version = "1.2.1" +version = "1.2.2" dependencies = [ "proc-macro2", "quote", @@ -708,7 +708,7 @@ dependencies = [ [[package]] name = "roqoqo-test" -version = "1.2.1" +version = "1.2.2" dependencies = [ "nalgebra", "ndarray", diff --git a/compatibility_test/Cargo.toml b/compatibility_test/Cargo.toml index b698d8c6..265b0ff5 100644 --- a/compatibility_test/Cargo.toml +++ b/compatibility_test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "compatibility_test" -version = "1.2.1" +version = "1.2.2" authors = ["HQS Quantum Simulations "] license = "Apache-2.0" edition = "2021" @@ -22,7 +22,7 @@ publish = false test_roqoqo_1_0 = {package = "roqoqo", version="=1.0.0"} test_roqoqo_derive_1_0 = {package = "roqoqo-derive", version="=1.0.0"} qoqo_calculator = { version="1.1" } -roqoqo = {version="1.2.1", path="../roqoqo", features=["serialize", "overrotate"]} +roqoqo = {version="1.2.2", path="../roqoqo", features=["serialize", "overrotate"]} bincode = {version="1.3"} [dev-dependencies] diff --git a/qoqo-macros/Cargo.toml b/qoqo-macros/Cargo.toml index cb422081..d55a875e 100644 --- a/qoqo-macros/Cargo.toml +++ b/qoqo-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "qoqo-macros" -version = "1.2.1" +version = "1.2.2" authors = ["HQS Quantum Simulations "] license = "Apache-2.0" readme = "../README.md" diff --git a/qoqo/Cargo.toml b/qoqo/Cargo.toml index c2c5f32e..d9129713 100644 --- a/qoqo/Cargo.toml +++ b/qoqo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "qoqo" -version = "1.2.1" +version = "1.2.2" authors = ["HQS Quantum Simulations "] license = "Apache-2.0" homepage = "https://github.com/HQSquantumsimulations/qoqo" @@ -32,8 +32,8 @@ num-complex = "0.4" thiserror = "1.0" qoqo_calculator = { version="1.1" } qoqo_calculator_pyo3 = {version="1.1", default-features=false} -qoqo-macros = {version="1.2.1", path="../qoqo-macros"} -roqoqo = {version="1.2.1", path="../roqoqo", features=["serialize", "overrotate"]} +qoqo-macros = {version="1.2.2", path="../qoqo-macros"} +roqoqo = {version="1.2.2", path="../roqoqo", features=["serialize", "overrotate"]} numpy = "0.17" bincode = "1.3" serde_json = "1.0" diff --git a/qoqo/pyproject.toml b/qoqo/pyproject.toml index 3c9653be..40c06783 100644 --- a/qoqo/pyproject.toml +++ b/qoqo/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "qoqo" -version = "1.2.1" +version = "1.2.2" dependencies = [ 'numpy', 'qoqo_calculator_pyo3>=1.1', diff --git a/qoqo/qoqo/DEPENDENCIES b/qoqo/qoqo/DEPENDENCIES index 3c443d7b..1dba6d34 100644 --- a/qoqo/qoqo/DEPENDENCIES +++ b/qoqo/qoqo/DEPENDENCIES @@ -8723,7 +8723,7 @@ LICENSE: ==================================================== -qoqo 1.2.1 +qoqo 1.2.2 https://github.com/HQSquantumsimulations/qoqo by HQS Quantum Simulations Quantum computing circuit toolkit. Python interface of roqoqo @@ -8935,7 +8935,7 @@ LICENSE: ==================================================== -qoqo-macros 1.2.1 +qoqo-macros 1.2.2 by HQS Quantum Simulations Macros for the qoqo crate License: Apache-2.0 @@ -11005,7 +11005,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ==================================================== -roqoqo 1.2.1 +roqoqo 1.2.2 https://github.com/HQSquantumsimulations/qoqo by HQS Quantum Simulations Rust Quantum Computing Toolkit by HQS @@ -11217,7 +11217,7 @@ LICENSE: ==================================================== -roqoqo-derive 1.2.1 +roqoqo-derive 1.2.2 by HQS Quantum Simulations Macros for the roqoqo crate License: Apache-2.0 @@ -11428,7 +11428,7 @@ LICENSE: ==================================================== -roqoqo-test 1.2.1 +roqoqo-test 1.2.2 https://github.com/HQSquantumsimulations/qoqo by HQS Quantum Simulations Testing helper functions for roqoqo toolkit diff --git a/roqoqo-derive/Cargo.toml b/roqoqo-derive/Cargo.toml index d448ab1d..53832135 100644 --- a/roqoqo-derive/Cargo.toml +++ b/roqoqo-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "roqoqo-derive" -version = "1.2.1" +version = "1.2.2" authors = ["HQS Quantum Simulations "] license = "Apache-2.0" edition = "2021" diff --git a/roqoqo-test/Cargo.toml b/roqoqo-test/Cargo.toml index 51970982..41b1fee2 100644 --- a/roqoqo-test/Cargo.toml +++ b/roqoqo-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "roqoqo-test" -version = "1.2.1" +version = "1.2.2" authors = ["HQS Quantum Simulations "] license = "Apache-2.0" edition = "2021" @@ -19,7 +19,7 @@ crate-type = ["rlib"] [dependencies] qoqo_calculator = { version="1.1" } -roqoqo = {version="1.2.1", path="../roqoqo", features=["serialize"]} +roqoqo = {version="1.2.2", path="../roqoqo", features=["serialize"]} rand = "0.8" nalgebra = "0.31" ndarray = { version = "0.15" } diff --git a/roqoqo/Cargo.toml b/roqoqo/Cargo.toml index 6c253424..48d704ba 100644 --- a/roqoqo/Cargo.toml +++ b/roqoqo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "roqoqo" -version = "1.2.1" +version = "1.2.2" authors = ["HQS Quantum Simulations "] license = "Apache-2.0" edition = "2021" @@ -28,7 +28,7 @@ num-complex = { version = "0.4"} thiserror = "1.0" dyn-clone = {version="1.0", optional=true} qoqo_calculator = { version="1.1"} -roqoqo-derive = {version="1.2.1", path="../roqoqo-derive"} +roqoqo-derive = {version="1.2.2", path="../roqoqo-derive"} typetag = {version="0.2", optional=true} nalgebra = "0.31" # schemars = { version="0.8", features = ["num-complex", "ndarray"], optional=true } diff --git a/roqoqo/src/circuit.rs b/roqoqo/src/circuit.rs index 5ab0c18c..8610e14f 100644 --- a/roqoqo/src/circuit.rs +++ b/roqoqo/src/circuit.rs @@ -17,6 +17,7 @@ use crate::operations::{ use crate::operations::{Rotate, Rotation}; use crate::RoqoqoError; use crate::RoqoqoVersion; +#[cfg(feature = "serialize")] use crate::RoqoqoVersionSerializable; use qoqo_calculator::Calculator; #[cfg(feature = "overrotate")] @@ -854,7 +855,7 @@ impl Iterator for OperationIterator { } } -impl crate::operations::SupportedVersion for Circuit { +impl SupportedVersion for Circuit { fn minimum_supported_roqoqo_version(&self) -> (u32, u32, u32) { let mut current_minimum_version = (1, 0, 0); for op in self.iter() { diff --git a/roqoqo/src/circuitdag.rs b/roqoqo/src/circuitdag.rs index a1b2586a..c2c1d509 100644 --- a/roqoqo/src/circuitdag.rs +++ b/roqoqo/src/circuitdag.rs @@ -86,6 +86,7 @@ struct CircuitDagSerializable { _roqoqo_version: RoqoqoVersionSerializable, } +#[cfg(feature = "serialize")] impl TryFrom for CircuitDag { type Error = RoqoqoError; fn try_from(value: CircuitDagSerializable) -> Result { @@ -105,6 +106,7 @@ impl TryFrom for CircuitDag { } } +#[cfg(feature = "serialize")] impl From for CircuitDagSerializable { fn from(value: CircuitDag) -> Self { let min_version = value.minimum_supported_roqoqo_version(); diff --git a/roqoqo/tests/integration/operations/supported_version.rs b/roqoqo/tests/integration/operations/supported_version.rs index d6589e41..11664eb3 100644 --- a/roqoqo/tests/integration/operations/supported_version.rs +++ b/roqoqo/tests/integration/operations/supported_version.rs @@ -46,14 +46,14 @@ use test_case::test_case; #[test_case(operations::TwoQubitGateOperation::from(operations::PhaseShiftedControlledZ::new(1,0, 3.0.into())); "PhaseShifterControlledZ")] fn test_version_1_0_0_two_qubit_gate(operation: operations::TwoQubitGateOperation) { assert_eq!(operation.minimum_supported_roqoqo_version(), (1, 0, 0)); - let op = operations::Operation::try_from(operation.clone()).unwrap(); + let op = operations::Operation::try_from(operation).unwrap(); assert_eq!(op.minimum_supported_roqoqo_version(), (1, 0, 0)); } #[test_case(operations::TwoQubitGateOperation::from(operations::PhaseShiftedControlledPhase::new(1,0, 3.0.into(), 2.0.into())); "PhaseShiftedControlledPhase")] fn test_version_1_2_0_two_qubit_gate(operation: operations::TwoQubitGateOperation) { assert_eq!(operation.minimum_supported_roqoqo_version(), (1, 2, 0)); - let op = operations::Operation::try_from(operation.clone()).unwrap(); + let op = operations::Operation::try_from(operation).unwrap(); assert_eq!(op.minimum_supported_roqoqo_version(), (1, 2, 0)); } @@ -74,14 +74,14 @@ fn test_version_1_2_0_two_qubit_gate(operation: operations::TwoQubitGateOperatio #[test_case(operations::SingleQubitGateOperation::from(operations::SingleQubitGate::new(0,0.5.into(), 0.5.into(), 0.5.into(), 0.5.into(), 0.5.into()));"SingleQubitGate")] fn test_version_1_0_0_single_qubit_gate(operation: operations::SingleQubitGateOperation) { assert_eq!(operation.minimum_supported_roqoqo_version(), (1, 0, 0)); - let op = operations::Operation::try_from(operation.clone()).unwrap(); + let op = operations::Operation::try_from(operation).unwrap(); assert_eq!(op.minimum_supported_roqoqo_version(), (1, 0, 0)); } #[test_case(operations::MultiQubitGateOperation::from(operations::MultiQubitMS::new(vec![0,1,2,3], 1.0.into())); "MultiQubitMS")] fn test_version_1_0_0_multi_qubit_gate(operation: operations::MultiQubitGateOperation) { assert_eq!(operation.minimum_supported_roqoqo_version(), (1, 0, 0)); - let op = operations::Operation::try_from(operation.clone()).unwrap(); + let op = operations::Operation::try_from(operation).unwrap(); assert_eq!(op.minimum_supported_roqoqo_version(), (1, 0, 0)); } @@ -150,7 +150,7 @@ fn test_version_circuit(circuit: roqoqo::Circuit, version: (u32, u32, u32)) { assert_eq!(measurement.minimum_supported_roqoqo_version(), version); let program = QuantumProgram::PauliZProduct { - measurement: measurement, + measurement, input_parameter_names: vec![], }; assert_eq!(program.minimum_supported_roqoqo_version(), version); @@ -170,7 +170,7 @@ fn test_version_circuit(circuit: roqoqo::Circuit, version: (u32, u32, u32)) { assert_eq!(measurement.minimum_supported_roqoqo_version(), version); let program = QuantumProgram::CheatedPauliZProduct { - measurement: measurement, + measurement, input_parameter_names: vec![], }; assert_eq!(program.minimum_supported_roqoqo_version(), version); @@ -190,7 +190,7 @@ fn test_version_circuit(circuit: roqoqo::Circuit, version: (u32, u32, u32)) { assert_eq!(measurement.minimum_supported_roqoqo_version(), version); let program = QuantumProgram::Cheated { - measurement: measurement, + measurement, input_parameter_names: vec![], }; assert_eq!(program.minimum_supported_roqoqo_version(), version); @@ -202,12 +202,12 @@ fn test_version_circuit(circuit: roqoqo::Circuit, version: (u32, u32, u32)) { assert_eq!(measurement.minimum_supported_roqoqo_version(), version); let measurement = ClassicalRegister { constant_circuit: None, - circuits: vec![circuit.clone()], + circuits: vec![circuit], }; assert_eq!(measurement.minimum_supported_roqoqo_version(), version); let program = QuantumProgram::ClassicalRegister { - measurement: measurement, + measurement, input_parameter_names: vec![], }; assert_eq!(program.minimum_supported_roqoqo_version(), version);