diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e5e00b..0706410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,17 @@ Tracks qoqo-qryd changes after 0.5 +# 0.16.4 + +* Modified `PragmaActiveReset` support's device name condition + # 0.16.3 * Fixed 0.16.2 release dependencies issues # 0.16.2 -* Added X-HQS header to api requests for testing purposes +* Added X-HQS header to API requests for testing purposes * Modified `APIBackend.post_job()` to use `v5_2` endpoint by default * Modified `TweezerDevice.set_allow_reset()` and `APIBackend` to allow `PragmaActiveReset` only for "qiskit_emulator" devices @@ -33,7 +37,7 @@ Tracks qoqo-qryd changes after 0.5 * Modified the native gate set whitelist to be public * Fixed `TweezerDevice.to_json()` gate set validity check * Updated dependencies addressing security advisory -* Update to Qoqo 1.10 +* Updated to Qoqo 1.10 # 0.14.0 diff --git a/Cargo.lock b/Cargo.lock index 0a0acef..55362c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -53,7 +53,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -296,7 +296,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -537,9 +537,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "3d8d52be92d09acc2e01dddb7fde3ad983fc6489c7db4837e605bc3fca4cb63e" dependencies = [ "bytes", "futures-util", @@ -547,7 +547,6 @@ dependencies = [ "http-body 1.0.0", "hyper 1.3.1", "pin-project-lite", - "socket2", "tokio", ] @@ -823,9 +822,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -894,9 +893,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.83" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -950,7 +949,7 @@ dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -963,7 +962,7 @@ dependencies = [ "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -989,7 +988,7 @@ dependencies = [ "serde_json", "struqture", "struqture-py", - "syn 2.0.65", + "syn 2.0.66", "thiserror", ] @@ -1002,12 +1001,12 @@ dependencies = [ "proc-macro2", "quote", "struqture", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] name = "qoqo-qryd" -version = "0.16.3" +version = "0.16.4" dependencies = [ "bincode", "ndarray", @@ -1235,7 +1234,7 @@ dependencies = [ "roqoqo-derive", "serde", "struqture", - "syn 2.0.65", + "syn 2.0.66", "thiserror", ] @@ -1247,12 +1246,12 @@ checksum = "c445ea2252e1e3b3789f5dd150be07ccd61d20df7a0534e94a04ed75f2e3b4ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] name = "roqoqo-qryd" -version = "0.16.3" +version = "0.16.4" dependencies = [ "bincode", "bitvec", @@ -1302,7 +1301,7 @@ dependencies = [ "quote", "rand", "roqoqo", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -1313,9 +1312,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "3450ed37fe9609abb6bc3b8891b6e078404e4c53c7332350e2e15126a95229bf" [[package]] name = "rustls" @@ -1365,9 +1364,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0218ceea14babe24a4a5836f86ade86c1effbc198164e619194cb5069187e29" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", "schemars_derive", @@ -1377,14 +1376,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed5a1ccce8ff962e31a165d41f6e2a2dd1245099dc4d594f5574a86cd90f4d3" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -1405,22 +1404,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.202" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -1431,7 +1430,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -1547,7 +1546,7 @@ dependencies = [ "serde_json", "struqture", "struqture-py-macros", - "syn 2.0.65", + "syn 2.0.66", "thiserror", ] @@ -1560,7 +1559,7 @@ dependencies = [ "num-complex", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -1576,9 +1575,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.65" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -1642,7 +1641,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -1653,7 +1652,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", "test-case-core", ] @@ -1674,7 +1673,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -1717,7 +1716,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", ] [[package]] @@ -1860,7 +1859,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -1894,7 +1893,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1923,9 +1922,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "wide" -version = "0.7.20" +version = "0.7.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e005a4cc35784183a9e39cb22e9a9c46353ef6a7f113fd8d36ddc58c15ef3c" +checksum = "cd8dc749a1b03f3c255a3064a4f5c0ee5ed09b7c6bc6d4525d31f779cd74d7fc" dependencies = [ "bytemuck", "safe_arch", diff --git a/qoqo-qryd/Cargo.toml b/qoqo-qryd/Cargo.toml index edb8104..5f2ba68 100644 --- a/qoqo-qryd/Cargo.toml +++ b/qoqo-qryd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "qoqo-qryd" -version = "0.16.3" +version = "0.16.4" authors = ["HQS Quantum Simulations "] edition = "2021" license = "Apache-2.0" diff --git a/qoqo-qryd/pyproject.toml b/qoqo-qryd/pyproject.toml index a6bbe48..e94317c 100644 --- a/qoqo-qryd/pyproject.toml +++ b/qoqo-qryd/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "qoqo_qryd" -version = "0.16.3" -dependencies = ['numpy', 'qoqo>=1.9', 'qoqo_calculator_pyo3>=1.1,<1.2'] +version = "0.16.4" +dependencies = ['numpy', 'qoqo>=1.9,<1.12', 'qoqo_calculator_pyo3>=1.1,<1.2'] license = { text = "Apache-2.0 AND Apache-2.0 with LLVM-exception AND MIT AND Unicode-DFS-2016 AND BSD-2-Clause AND BSD-3-CLause" } maintainers = [ { name = "HQS Quantum Simulations GmbH", email = "info@quantumsimulations.de" }, diff --git a/qoqo-qryd/qoqo_qryd/DEPENDENCIES b/qoqo-qryd/qoqo_qryd/DEPENDENCIES index bfc8fe8..a0d2460 100644 --- a/qoqo-qryd/qoqo_qryd/DEPENDENCIES +++ b/qoqo-qryd/qoqo_qryd/DEPENDENCIES @@ -11162,7 +11162,7 @@ of these licenses, at your option. ==================================================== -hyper-util 0.1.3 +hyper-util 0.1.4 https://hyper.rs by Sean McArthur hyper utilities @@ -17245,7 +17245,7 @@ DEALINGS IN THE SOFTWARE. ==================================================== -parking_lot 0.12.2 +parking_lot 0.12.3 https://github.com/Amanieu/parking_lot by Amanieu d'Antras More compact and efficient implementations of the standard synchronization primitives. @@ -19338,7 +19338,7 @@ DEALINGS IN THE SOFTWARE. ==================================================== -proc-macro2 1.0.83 +proc-macro2 1.0.84 https://github.com/dtolnay/proc-macro2 by David Tolnay , Alex Crichton A substitute implementation of the compiler's `proc_macro` API to decouple token-based libraries from the procedural macro use case. @@ -21120,7 +21120,7 @@ LICENSE: ==================================================== -qoqo-qryd 0.16.3 +qoqo-qryd 0.16.4 https://github.com/HQSquantumsimulations/qoqo_qryd by HQS Quantum Simulations QRyd backend for qoqo quantum computing toolkit @@ -24863,7 +24863,7 @@ LICENSE: ==================================================== -roqoqo-qryd 0.16.3 +roqoqo-qryd 0.16.4 https://github.com/HQSquantumsimulations/qoqo_qryd by HQS Quantum Simulations QRyd interface for roqoqo rust quantum computing toolkit @@ -25741,10 +25741,10 @@ DEALINGS IN THE SOFTWARE. ==================================================== -rustc-hash 1.1.0 -https://github.com/rust-lang-nursery/rustc-hash +rustc-hash 1.2.0 +https://github.com/rust-lang/rustc-hash by The Rust Project Developers -speed, non-cryptographic hash used in rustc +A speedy, non-cryptographic hashing algorithm used by rustc and Firefox License: Apache-2.0/MIT ---------------------------------------------------- LICENSE-APACHE: @@ -25925,32 +25925,6 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - ---------------------------------------------------- LICENSE-MIT: @@ -25978,7 +25952,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ==================================================== rustls 0.21.12 https://github.com/rustls/rustls @@ -26858,7 +26831,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ==================================================== -schemars 0.8.20 +schemars 0.8.21 https://graham.cool/schemars/ by Graham Esau Generate JSON Schemas from Rust code @@ -26890,7 +26863,7 @@ SOFTWARE. ==================================================== -schemars_derive 0.8.20 +schemars_derive 0.8.21 https://graham.cool/schemars/ by Graham Esau Macros for #[derive(JsonSchema)], for use with schemars @@ -27442,7 +27415,7 @@ of these licenses, at your option. ==================================================== -serde 1.0.202 +serde 1.0.203 https://serde.rs by Erick Tryzelaar , David Tolnay A generic serialization/deserialization framework @@ -27656,7 +27629,7 @@ DEALINGS IN THE SOFTWARE. ==================================================== -serde_derive 1.0.202 +serde_derive 1.0.203 https://serde.rs by Erick Tryzelaar , David Tolnay Macros 1.1 implementation of #[derive(Serialize, Deserialize)] @@ -30158,7 +30131,7 @@ DEALINGS IN THE SOFTWARE. ==================================================== -syn 2.0.65 +syn 2.0.66 https://github.com/dtolnay/syn by David Tolnay Parser for Rust source code @@ -36070,7 +36043,7 @@ one at http://mozilla.org/MPL/2.0/. ==================================================== -wide 0.7.20 +wide 0.7.21 https://github.com/Lokathor/wide by Lokathor A crate to help you go wide. diff --git a/qoqo-qryd/tests/integration/tweezer_devices.rs b/qoqo-qryd/tests/integration/tweezer_devices.rs index 1b7e269..5dfe7e6 100644 --- a/qoqo-qryd/tests/integration/tweezer_devices.rs +++ b/qoqo-qryd/tests/integration/tweezer_devices.rs @@ -421,15 +421,8 @@ fn test_allowed_tweezer_shifts_from_rows() { /// Test allow_reset for TweezerMutableDeviceWrapper #[test] fn test_allow_reset() { - let mut specific_named_device = TweezerDevice::new(None, None, None); - specific_named_device.device_name = "qiskit_emulator".to_string(); - let specific_named_device_wrapper = TweezerMutableDeviceWrapper { - internal: specific_named_device, - }; pyo3::prepare_freethreaded_python(); Python::with_gil(|py| { - let specific_named_device_pypyany = specific_named_device_wrapper.into_py(py); - let specific_named_device_ref = specific_named_device_pypyany.as_ref(py); let device_type_mut = py.get_type::(); let device_mut = device_type_mut.call0().unwrap(); let device_type = py.get_type::(); @@ -445,23 +438,10 @@ fn test_allow_reset() { .unwrap() .extract::() .unwrap()); - assert!(!specific_named_device_ref - .call_method0("get_allow_reset") - .unwrap() - .extract::() - .unwrap()); - assert!(device_mut.call_method1("set_allow_reset", (true,)).is_err()); - assert!(specific_named_device_ref - .call_method1("set_allow_reset", (true,)) - .is_ok()); + assert!(device_mut.call_method1("set_allow_reset", (true,)).is_ok()); - assert!(!device_mut - .call_method0("get_allow_reset") - .unwrap() - .extract::() - .unwrap()); - assert!(specific_named_device_ref + assert!(device_mut .call_method0("get_allow_reset") .unwrap() .extract::() diff --git a/roqoqo-qryd/Cargo.toml b/roqoqo-qryd/Cargo.toml index 07a434f..5cea66e 100644 --- a/roqoqo-qryd/Cargo.toml +++ b/roqoqo-qryd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "roqoqo-qryd" -version = "0.16.3" +version = "0.16.4" authors = ["HQS Quantum Simulations "] edition = "2021" license = "Apache-2.0" @@ -48,6 +48,7 @@ test-case = "3.0" serde_test = { version = "1.0" } wiremock = { version = "0.6" } tokio = { version = "1.36" } + roqoqo-test = { version = "~1.11" } [features] diff --git a/roqoqo-qryd/src/tweezer_devices.rs b/roqoqo-qryd/src/tweezer_devices.rs index c29300e..27e4d73 100644 --- a/roqoqo-qryd/src/tweezer_devices.rs +++ b/roqoqo-qryd/src/tweezer_devices.rs @@ -832,12 +832,6 @@ impl TweezerDevice { /// * `Ok(())` - The device now supports PragmaActiveReset. /// * `Err(RoqoqoBackendError)` - The device isn't compatible with PragmaActiveReset. pub fn set_allow_reset(&mut self, allow_reset: bool) -> Result<(), RoqoqoBackendError> { - if self.device_name != "qiskit_emulator" { - return Err(RoqoqoBackendError::GenericError { - msg: "The device isn't qiskit_emulator, PragmaActiveReset is not supported." - .to_string(), - }); - } self.allow_reset = allow_reset; Ok(()) } diff --git a/roqoqo-qryd/tests/integration/tweezer_devices.rs b/roqoqo-qryd/tests/integration/tweezer_devices.rs index ca57b8c..15b8596 100644 --- a/roqoqo-qryd/tests/integration/tweezer_devices.rs +++ b/roqoqo-qryd/tests/integration/tweezer_devices.rs @@ -816,9 +816,7 @@ fn test_change_device_switch() { fn test_allow_reset() { let mut device = TweezerDevice::new(None, None, None); assert!(!device.allow_reset); - assert!(device.set_allow_reset(true).is_err()); - device.device_name = "qiskit_emulator".to_string(); - device.set_allow_reset(true).unwrap(); + assert!(device.set_allow_reset(true).is_ok()); assert!(device.allow_reset); } @@ -1005,6 +1003,7 @@ fn test_from_api() { assert!(response.is_ok()); let device = response.unwrap(); assert_eq!(device.qrydbackend(), "qryd_emulator".to_string()); + assert!(!device.allow_reset); let response_new_seed = TweezerDevice::from_api( None, @@ -1017,6 +1016,19 @@ fn test_from_api() { assert!(response_new_seed.is_ok()); let device_new_seed = response_new_seed.unwrap(); assert_eq!(device_new_seed.seed(), Some(42)); + + let response = TweezerDevice::from_api( + Some("qiskit_emulator".to_string()), + None, + None, + None, + Some(env::var("QRYD_API_HQS").is_ok()), + None, + ); + assert!(response.is_ok()); + let device = response.unwrap(); + assert_eq!(device.qrydbackend(), "qiskit_emulator".to_string()); + assert!(device.allow_reset); } }