Repository: HQSquantumsimulations/qoqo (language: python)

Issue:
Updated dependencies and fixed clippy in tests



Discussion / hints:
# [Codecov](https://codecov.io/gh/HQSquantumsimulations/qoqo/pull/169?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations) Report
> Merging [#169](https://codecov.io/gh/HQSquantumsimulations/qoqo/pull/169?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations) (8fba939) into [main](https://codecov.io/gh/HQSquantumsimulations/qoqo/commit/f826f35800b1c645dbac06553eb9babfbf63bdd8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations) (f826f35) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/HQSquantumsimulations/qoqo/pull/169/graphs/tree.svg?width=650&height=150&src=pr&token=S1IN066V2W&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations)](https://codecov.io/gh/HQSquantumsimulations/qoqo/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations)

```diff
@@           Coverage Diff           @@
##             main     #169   +/-   ##
=======================================
  Coverage   90.11%   90.11%           
=======================================
  Files          33       33           
  Lines        5050     5050           
=======================================
  Hits         4551     4551           
  Misses        499      499           
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `90.11% <100.00%> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/HQSquantumsimulations/qoqo/pull/169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations) | Coverage Δ | |
|---|---|---|
| [qoqo/src/operations/pragma\_operations.rs](https://codecov.io/gh/HQSquantumsimulations/qoqo/pull/169/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations#diff-cW9xby9zcmMvb3BlcmF0aW9ucy9wcmFnbWFfb3BlcmF0aW9ucy5ycw==) | `94.63% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/HQSquantumsimulations/qoqo/pull/169?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/HQSquantumsimulations/qoqo/pull/169?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations). Last update [f826f35...8fba939](https://codecov.io/gh/HQSquantumsimulations/qoqo/pull/169?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HQSquantumsimulations).


Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1f2e7017..f7a83641 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,12 @@
 
 This changelog track changes to the qoqo project starting at version v0.5.0
 
+## 1.9.0
+
+### Added in 1.9.0
+
+* Unstable feature `unstable_chain_with_environment` implementing a Trait for returning chains in a device with an environment of qubits, where an environment are qubits that are not part of the chain but connected to at least one qubit in the chain.
+
 ## 1.8.0
 
 ### Added in 1.8.0
diff --git a/Cargo.lock b/Cargo.lock
index 28a908e1..816bdf13 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
 
 [[package]]
 name = "ahash"
-version = "0.8.6"
+version = "0.8.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
+checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
 dependencies = [
  "cfg-if",
  "getrandom",
@@ -42,9 +42,9 @@ dependencies = [
 
 [[package]]
 name = "anstream"
-version = "0.6.4"
+version = "0.6.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44"
+checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6"
 dependencies = [
  "anstyle",
  "anstyle-parse",
@@ -71,9 +71,9 @@ dependencies = [
 
 [[package]]
 name = "anstyle-query"
-version = "1.0.1"
+version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3a318f1f38d2418400f8209655bfd825785afd25aa30bb7ba6cc792e4596748"
+checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648"
 dependencies = [
  "windows-sys 0.52.0",
 ]
@@ -90,9 +90,9 @@ dependencies = [
 
 [[package]]
 name = "anyhow"
-version = "1.0.75"
+version = "1.0.79"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
+checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
 
 [[package]]
 name = "approx"
@@ -105,13 +105,13 @@ dependencies = [
 
 [[package]]
 name = "async-trait"
-version = "0.1.74"
+version = "0.1.77"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
+checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
@@ -212,9 +212,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
 
 [[package]]
 name = "clap"
-version = "4.4.11"
+version = "4.4.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2"
+checksum = "52bdc885e4cacc7f7c9eedc1ef6da641603180c783c41a15c264944deeaab642"
 dependencies = [
  "clap_builder",
  "clap_derive",
@@ -222,9 +222,9 @@ dependencies = [
 
 [[package]]
 name = "clap_builder"
-version = "4.4.11"
+version = "4.4.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb"
+checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9"
 dependencies = [
  "anstream",
  "anstyle",
@@ -241,7 +241,7 @@ dependencies = [
  "heck",
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
@@ -274,9 +274,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
 
 [[package]]
 name = "deranged"
-version = "0.3.10"
+version = "0.3.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc"
+checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
 dependencies = [
  "powerfmt",
 ]
@@ -310,9 +310,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
 
 [[package]]
 name = "erased-serde"
-version = "0.3.31"
+version = "0.4.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c"
+checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7"
 dependencies = [
  "serde",
 ]
@@ -360,9 +360,9 @@ dependencies = [
 
 [[package]]
 name = "futures"
-version = "0.3.29"
+version = "0.3.30"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335"
+checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
 dependencies = [
  "futures-channel",
  "futures-core",
@@ -375,9 +375,9 @@ dependencies = [
 
 [[package]]
 name = "futures-channel"
-version = "0.3.29"
+version = "0.3.30"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb"
+checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
 dependencies = [
  "futures-core",
  "futures-sink",
@@ -385,15 +385,15 @@ dependencies = [
 
 [[package]]
 name = "futures-core"
-version = "0.3.29"
+version = "0.3.30"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c"
+checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
 
 [[package]]
 name = "futures-executor"
-version = "0.3.29"
+version = "0.3.30"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc"
+checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
 dependencies = [
  "futures-core",
  "futures-task",
@@ -402,38 +402,38 @@ dependencies = [
 
 [[package]]
 name = "futures-io"
-version = "0.3.29"
+version = "0.3.30"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa"
+checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
 
 [[package]]
 name = "futures-macro"
-version = "0.3.29"
+version = "0.3.30"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb"
+checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
 name = "futures-sink"
-version = "0.3.29"
+version = "0.3.30"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817"
+checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
 
 [[package]]
 name = "futures-task"
-version = "0.3.29"
+version = "0.3.30"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2"
+checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
 
 [[package]]
 name = "futures-util"
-version = "0.3.29"
+version = "0.3.30"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104"
+checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
 dependencies = [
  "futures-channel",
  "futures-core",
@@ -516,9 +516,9 @@ dependencies = [
 
 [[package]]
 name = "http-body"
-version = "0.4.5"
+version = "0.4.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
+checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
 dependencies = [
  "bytes",
  "http",
@@ -539,9 +539,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
 
 [[package]]
 name = "hyper"
-version = "0.14.27"
+version = "0.14.28"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468"
+checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"
 dependencies = [
  "bytes",
  "futures-channel",
@@ -554,7 +554,7 @@ dependencies = [
  "httpdate",
  "itoa",
  "pin-project-lite",
- "socket2 0.4.10",
+ "socket2",
  "tokio",
  "tower-service",
  "tracing",
@@ -589,9 +589,9 @@ checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8"
 
 [[package]]
 name = "inventory"
-version = "0.3.13"
+version = "0.3.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0508c56cfe9bfd5dfeb0c22ab9a6abfda2f27bdca422132e494266351ed8d83c"
+checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7"
 
 [[package]]
 name = "ipnet"
@@ -619,9 +619,9 @@ dependencies = [
 
 [[package]]
 name = "itoa"
-version = "1.0.9"
+version = "1.0.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
+checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
 
 [[package]]
 name = "js-sys"
@@ -670,9 +670,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
 
 [[package]]
 name = "libc"
-version = "0.2.150"
+version = "0.2.151"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
+checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4"
 
 [[package]]
 name = "libm"
@@ -708,9 +708,9 @@ dependencies = [
 
 [[package]]
 name = "memchr"
-version = "2.6.4"
+version = "2.7.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
+checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
 
 [[package]]
 name = "memoffset"
@@ -915,18 +915,18 @@ dependencies = [
 
 [[package]]
 name = "object"
-version = "0.32.1"
+version = "0.32.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"
+checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
 dependencies = [
  "memchr",
 ]
 
 [[package]]
 name = "once_cell"
-version = "1.18.0"
+version = "1.19.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
+checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
 
 [[package]]
 name = "parking_lot"
@@ -1001,18 +1001,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.70"
+version = "1.0.75"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
+checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708"
 dependencies = [
  "unicode-ident",
 ]
 
 [[package]]
 name = "pyo3"
-version = "0.20.0"
+version = "0.20.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b"
+checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0"
 dependencies = [
  "cfg-if",
  "indoc",
@@ -1029,9 +1029,9 @@ dependencies = [
 
 [[package]]
 name = "pyo3-build-config"
-version = "0.20.0"
+version = "0.20.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5"
+checksum = "07426f0d8fe5a601f26293f300afd1a7b1ed5e78b2a705870c5f30893c5163be"
 dependencies = [
  "once_cell",
  "target-lexicon",
@@ -1039,9 +1039,9 @@ dependencies = [
 
 [[package]]
 name = "pyo3-ffi"
-version = "0.20.0"
+version = "0.20.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b"
+checksum = "dbb7dec17e17766b46bca4f1a4215a85006b4c2ecde122076c562dd058da6cf1"
 dependencies = [
  "libc",
  "pyo3-build-config",
@@ -1049,31 +1049,31 @@ dependencies = [
 
 [[package]]
 name = "pyo3-macros"
-version = "0.20.0"
+version = "0.20.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b"
+checksum = "05f738b4e40d50b5711957f142878cfa0f28e054aa0ebdfc3fd137a843f74ed3"
 dependencies = [
  "proc-macro2",
  "pyo3-macros-backend",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
 name = "pyo3-macros-backend"
-version = "0.20.0"
+version = "0.20.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424"
+checksum = "0fc910d4851847827daf9d6cdd4a823fbdaab5b8818325c5e97a86da79e8881f"
 dependencies = [
  "heck",
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
 name = "qoqo"
-version = "1.8.0"
+version = "1.9.0"
 dependencies = [
  "bincode",
  "nalgebra",
@@ -1093,18 +1093,18 @@ dependencies = [
  "serde_json",
  "struqture",
  "struqture-py",
- "syn 2.0.39",
+ "syn 2.0.48",
  "test-case",
  "thiserror",
 ]
 
 [[package]]
 name = "qoqo-macros"
-version = "1.8.0"
+version = "1.9.0"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
@@ -1135,9 +1135,9 @@ dependencies = [
 
 [[package]]
 name = "quote"
-version = "1.0.33"
+version = "1.0.35"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
+checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
 dependencies = [
  "proc-macro2",
 ]
@@ -1228,9 +1228,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
 
 [[package]]
 name = "reqwest"
-version = "0.11.22"
+version = "0.11.23"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b"
+checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41"
 dependencies = [
  "base64",
  "bytes",
@@ -1263,7 +1263,7 @@ dependencies = [
 
 [[package]]
 name = "roqoqo"
-version = "1.8.0"
+version = "1.9.0"
 dependencies = [
  "async-trait",
  "bincode",
@@ -1285,7 +1285,7 @@ dependencies = [
  "serde_json",
  "serde_test",
  "struqture",
- "syn 2.0.39",
+ "syn 2.0.48",
  "test-case",
  "thiserror",
  "typetag",
@@ -1293,16 +1293,16 @@ dependencies = [
 
 [[package]]
 name = "roqoqo-derive"
-version = "1.8.0"
+version = "1.9.0"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
 name = "roqoqo-test"
-version = "1.8.0"
+version = "1.9.0"
 dependencies = [
  "nalgebra",
  "ndarray",
@@ -1311,7 +1311,7 @@ dependencies = [
  "quote",
  "rand",
  "roqoqo",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
@@ -1328,9 +1328,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
 
 [[package]]
 name = "ryu"
-version = "1.0.15"
+version = "1.0.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
+checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
 
 [[package]]
 name = "safe_arch"
@@ -1373,22 +1373,22 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
 
 [[package]]
 name = "serde"
-version = "1.0.193"
+version = "1.0.194"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
+checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773"
 dependencies = [
  "serde_derive",
 ]
 
 [[package]]
 name = "serde_derive"
-version = "1.0.193"
+version = "1.0.194"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
+checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
@@ -1404,9 +1404,9 @@ dependencies = [
 
 [[package]]
 name = "serde_json"
-version = "1.0.108"
+version = "1.0.111"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
+checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4"
 dependencies = [
  "itoa",
  "ryu",
@@ -1462,16 +1462,6 @@ version = "1.11.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
 
-[[package]]
-name = "socket2"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
-dependencies = [
- "libc",
- "winapi",
-]
-
 [[package]]
 name = "socket2"
 version = "0.5.5"
@@ -1525,7 +1515,7 @@ dependencies = [
  "serde_json",
  "struqture",
  "struqture-py-macros",
- "syn 2.0.39",
+ "syn 2.0.48",
  "thiserror",
 ]
 
@@ -1538,7 +1528,7 @@ dependencies = [
  "num-complex",
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
@@ -1554,9 +1544,9 @@ dependencies = [
 
 [[package]]
 name = "syn"
-version = "2.0.39"
+version = "2.0.48"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
+checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1586,9 +1576,9 @@ dependencies = [
 
 [[package]]
 name = "target-lexicon"
-version = "0.12.12"
+version = "0.12.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a"
+checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae"
 
 [[package]]
 name = "test-case"
@@ -1608,7 +1598,7 @@ dependencies = [
  "cfg-if",
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
@@ -1619,35 +1609,35 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
  "test-case-core",
 ]
 
 [[package]]
 name = "thiserror"
-version = "1.0.50"
+version = "1.0.56"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
+checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
 dependencies = [
  "thiserror-impl",
 ]
 
 [[package]]
 name = "thiserror-impl"
-version = "1.0.50"
+version = "1.0.56"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
+checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
 name = "time"
-version = "0.3.30"
+version = "0.3.31"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5"
+checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e"
 dependencies = [
  "deranged",
  "powerfmt",
@@ -1664,9 +1654,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
 
 [[package]]
 name = "time-macros"
-version = "0.2.15"
+version = "0.2.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20"
+checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f"
 dependencies = [
  "time-core",
 ]
@@ -1689,9 +1679,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
 
 [[package]]
 name = "tokio"
-version = "1.34.0"
+version = "1.35.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9"
+checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104"
 dependencies = [
  "backtrace",
  "bytes",
@@ -1699,7 +1689,7 @@ dependencies = [
  "mio",
  "num_cpus",
  "pin-project-lite",
- "socket2 0.5.5",
+ "socket2",
  "windows-sys 0.48.0",
 ]
 
@@ -1744,9 +1734,9 @@ dependencies = [
 
 [[package]]
 name = "try-lock"
-version = "0.2.4"
+version = "0.2.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
+checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
 
 [[package]]
 name = "typenum"
@@ -1756,9 +1746,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
 
 [[package]]
 name = "typetag"
-version = "0.2.13"
+version = "0.2.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80960fd143d4c96275c0e60b08f14b81fbb468e79bc0ef8fbda69fb0afafae43"
+checksum = "c43148481c7b66502c48f35b8eef38b6ccdc7a9f04bd4cc294226d901ccc9bc7"
 dependencies = [
  "erased-serde",
  "inventory",
@@ -1769,13 +1759,13 @@ dependencies = [
 
 [[package]]
 name = "typetag-impl"
-version = "0.2.13"
+version = "0.2.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfc13d450dc4a695200da3074dacf43d449b968baee95e341920e47f61a3b40f"
+checksum = "291db8a81af4840c10d636e047cac67664e343be44e24dfdbd1492df9a5d3390"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
 
 [[package]]
@@ -1870,7 +1860,7 @@ dependencies = [
  "once_cell",
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
  "wasm-bindgen-shared",
 ]
 
@@ -1904,7 +1894,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
  "wasm-bindgen-backend",
  "wasm-bindgen-shared",
 ]
@@ -1935,28 +1925,6 @@ dependencies = [
  "safe_arch",
 ]
 
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
 [[package]]
 name = "windows-sys"
 version = "0.48.0"
@@ -2101,20 +2069,20 @@ dependencies = [
 
 [[package]]
 name = "zerocopy"
-version = "0.7.29"
+version = "0.7.32"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d075cf85bbb114e933343e087b92f2146bac0d55b534cbb8188becf0039948e"
+checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
 dependencies = [
  "zerocopy-derive",
 ]
 
 [[package]]
 name = "zerocopy-derive"
-version = "0.7.29"
+version = "0.7.32"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86cd5ca076997b97ef09d3ad65efe811fa68c9e874cb636ccb211223a813b0c2"
+checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.39",
+ "syn 2.0.48",
 ]
diff --git a/qoqo-macros/Cargo.toml b/qoqo-macros/Cargo.toml
index ab95d1c8..5bfe0eb9 100644
--- a/qoqo-macros/Cargo.toml
+++ b/qoqo-macros/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "qoqo-macros"
-version = "1.8.0"
+version = "1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 license = "Apache-2.0"
 readme = "../README.md"
diff --git a/qoqo-macros/src/lib.rs b/qoqo-macros/src/lib.rs
index ee543770..5786d21b 100644
--- a/qoqo-macros/src/lib.rs
+++ b/qoqo-macros/src/lib.rs
@@ -721,14 +721,83 @@ pub fn devicewrapper(
     _metadata: proc_macro::TokenStream,
     input: proc_macro::TokenStream,
 ) -> proc_macro::TokenStream {
+    let attribute_arguments = parse_macro_input!(_metadata as AttributeMacroArguments);
     let parsed_input = parse_macro_input!(input as ItemImpl);
     let ident = parsed_input.self_ty;
     let items = parsed_input.items;
+    let chain_with_environment_quote = if attribute_arguments.contains("ChainWithEnvironment") {
+        quote! {
+
+            /// Return a list of linear chains with an environment through the device.
+            ///
+            /// Returns at least one chain of qubits with linear connectivity and an environment in the device.
+            /// An environment is defined as at least one qubit that is connected to at least one qubit of the chain
+            /// but not part of the chain.
+            /// For each ratio of environment qubits to chain qubits, the list contains at least one of the longest chains
+            /// in the devive with that ratio. (Unless that chain and environment is simply a subset
+            /// of a chain with equal or longer length and equal or higher ratio).
+            ///
+            /// For example, take a device with the connectivity graph:
+            /// ```
+            /// 0 - 3 - 6
+            /// |   |   |
+            /// 1 - 4 - 7
+            /// |   |
+            /// 2 - 5
+            /// ```
+            /// It would have one chain of length 1 and environment with ratio 4 to 1:
+            ///
+            /// ```
+            /// ([4], {4: [1,4,7,5]})
+            /// ```
+            ///
+            /// One with lenght 2 and ratio 5 to 2:
+            /// ```
+            /// ([3,4], {3:[0,6], 4: [1,7,5]})
+            /// ```
+            ///
+            /// The chain and environment with lenght 2 and ratio 2 to 1 is a subset of the one above
+            /// and does not need to be listed separately.
+            ///
+            /// The longest chain with ratio 1 to 1 is:
+            /// ```
+            /// ([0,1,4,3], {1:[2], 4: [5,7], 3: [6]})
+            /// ```
+            /// One of the longest chains with ratio 2 to 6 is
+            /// ```
+            /// ([0,1,2,5,4,3], {4: [7], 3: [6]})
+            /// ```
+            /// And one of the possible chains with just one environment qubit is:
+            /// ```
+            /// ([0,1,2,5,4,3,6], {6: [7], 4: [7]})
+            /// ```
+            ///
+            /// Returns:
+            ///     List[List[int], Dict[int, List[int]]]: A list of the chains and environments.
+            ///
+            #[cfg(feature="unstable_chain_with_environment")]
+            pub fn __environment_chains(&self) -> Vec<(Vec<usize>, HashMap<usize, Vec<usize>>)>
+            {
+                self.internal.environment_chains()
+            }
+
+            #[cfg(feature="unstable_chain_with_environment")]
+            /// Helper function signifying support for chain_with_environment.
+            pub fn __implements_environment_chains(&self) -> bool
+            {
+                true
+            }
+        }
+    } else {
+        TokenStream::new()
+    };
     let q = quote! {
         #[pymethods]
         impl #ident {
             #(#items)*
 
+            #chain_with_environment_quote
+
             /// Return number of qubits in device.
             ///
             /// Returns:
diff --git a/qoqo/Cargo.toml b/qoqo/Cargo.toml
index 82ab5a4f..ba658a3b 100644
--- a/qoqo/Cargo.toml
+++ b/qoqo/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "qoqo"
-version = "1.8.0"
+version = "1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 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.8", path="../qoqo-macros"}
-roqoqo = {version="1.8", path="../roqoqo", features=["serialize", "overrotate"]}
+qoqo-macros = {version="1.9", path="../qoqo-macros"}
+roqoqo = {version="1.9", path="../roqoqo", features=["serialize", "overrotate"]}
 struqture = {version="1.5"}
 struqture-py = {version = "1.5", default-features = false}
 numpy = "0.20"
@@ -59,3 +59,4 @@ extension-module = ["pyo3/extension-module", "circuitdag"]
 default = ["extension-module", "json_schema"]
 circuitdag = ["roqoqo/circuitdag"]
 json_schema = ["roqoqo/json_schema"]
+unstable_chain_with_environment = ["roqoqo/unstable_chain_with_environment"]
\ No newline at end of file
diff --git a/qoqo/pyproject.toml b/qoqo/pyproject.toml
index d0371ca1..13690246 100644
--- a/qoqo/pyproject.toml
+++ b/qoqo/pyproject.toml
@@ -1,6 +1,6 @@
 [project]
 name = "qoqo"
-version = "1.8.0"
+version = "1.9.0"
 dependencies = [
   'numpy',
   'qoqo_calculator_pyo3>=1.1',
diff --git a/qoqo/qoqo/DEPENDENCIES b/qoqo/qoqo/DEPENDENCIES
index 727935ce..8c0757fc 100644
--- a/qoqo/qoqo/DEPENDENCIES
+++ b/qoqo/qoqo/DEPENDENCIES
@@ -495,7 +495,7 @@ limitations under the License.
 
 
 ====================================================
-ahash 0.8.6
+ahash 0.8.7
 https://github.com/tkaitchuck/ahash
 by Tom Kaitchuck <Tom.Kaitchuck@gmail.com>
 A non-cryptographic hash function using AES-NI for high performance
@@ -803,7 +803,7 @@ For more information, please refer to <http://unlicense.org/>
 
 
 ====================================================
-anstream 0.6.4
+anstream 0.6.5
 https://github.com/rust-cli/anstyle
 by 
 A simple cross platform library for writing colored text to a terminal.
@@ -1516,7 +1516,7 @@ LICENSE-APACHE:
 
 
 ====================================================
-anstyle-query 1.0.1
+anstyle-query 1.0.2
 https://github.com/rust-cli/anstyle
 by 
 Look up colored console capabilities
@@ -1988,7 +1988,7 @@ LICENSE-APACHE:
 
 
 ====================================================
-anyhow 1.0.75
+anyhow 1.0.79
 https://github.com/dtolnay/anyhow
 by David Tolnay <dtolnay@gmail.com>
 Flexible concrete Error type built on std::error::Error
@@ -4991,7 +4991,7 @@ limitations under the License.
 
 
 ====================================================
-clap 4.4.11
+clap 4.4.13
 https://github.com/clap-rs/clap
 by 
 A simple to use, efficient, and full-featured Command Line Argument Parser
@@ -5227,7 +5227,7 @@ LICENSE-APACHE:
 
 
 ====================================================
-clap_builder 4.4.11
+clap_builder 4.4.12
 https://github.com/clap-rs/clap
 by 
 A simple to use, efficient, and full-featured Command Line Argument Parser
@@ -6656,7 +6656,7 @@ limitations under the License.
 
 
 ====================================================
-deranged 0.3.10
+deranged 0.3.11
 https://github.com/jhpratt/deranged
 by Jacob Pratt <jacob@jhpratt.dev>
 Ranged integers
@@ -8857,7 +8857,7 @@ limitations under the License.
 
 
 ====================================================
-futures-channel 0.3.29
+futures-channel 0.3.30
 https://rust-lang.github.io/futures-rs
 by 
 Channels for asynchronous communication using futures-rs.
@@ -9101,7 +9101,7 @@ limitations under the License.
 
 
 ====================================================
-futures-core 0.3.29
+futures-core 0.3.30
 https://rust-lang.github.io/futures-rs
 by 
 The core traits and types in for the `futures` library.
@@ -9345,7 +9345,7 @@ limitations under the License.
 
 
 ====================================================
-futures-io 0.3.29
+futures-io 0.3.30
 https://rust-lang.github.io/futures-rs
 by 
 The `AsyncRead`, `AsyncWrite`, `AsyncSeek`, and `AsyncBufRead` traits for the futures-rs library.
@@ -9589,7 +9589,7 @@ limitations under the License.
 
 
 ====================================================
-futures-sink 0.3.29
+futures-sink 0.3.30
 https://rust-lang.github.io/futures-rs
 by 
 The asynchronous `Sink` trait for the futures-rs library.
@@ -9833,7 +9833,7 @@ limitations under the License.
 
 
 ====================================================
-futures-task 0.3.29
+futures-task 0.3.30
 https://rust-lang.github.io/futures-rs
 by 
 Tools for working with tasks.
@@ -10077,7 +10077,7 @@ limitations under the License.
 
 
 ====================================================
-futures-util 0.3.29
+futures-util 0.3.30
 https://rust-lang.github.io/futures-rs
 by 
 Common utilities and extension traits for the futures-rs library.
@@ -11803,7 +11803,7 @@ limitations under the License.
 
 
 ====================================================
-http-body 0.4.5
+http-body 0.4.6
 https://github.com/hyperium/http-body
 by Carl Lerche <me@carllerche.com>, Lucio Franco <luciofranco14@gmail.com>, Sean McArthur <sean@seanmonstar.com>
 Trait representing an asynchronous, streaming, HTTP request or response body.
@@ -12311,7 +12311,7 @@ limitations under the License.
 
 
 ====================================================
-hyper 0.14.27
+hyper 0.14.28
 https://hyper.rs
 by Sean McArthur <sean@seanmonstar.com>
 A fast and correct HTTP library.
@@ -13037,7 +13037,7 @@ END OF TERMS AND CONDITIONS
 
 
 ====================================================
-inventory 0.3.13
+inventory 0.3.14
 https://github.com/dtolnay/inventory
 by David Tolnay <dtolnay@gmail.com>
 Typed distributed plugin registration
@@ -13746,7 +13746,7 @@ limitations under the License.
 
 
 ====================================================
-itoa 1.0.9
+itoa 1.0.10
 https://github.com/dtolnay/itoa
 by David Tolnay <dtolnay@gmail.com>
 Fast integer primitive to string conversion
@@ -14451,7 +14451,7 @@ limitations under the License.
 
 
 ====================================================
-libc 0.2.150
+libc 0.2.151
 https://github.com/rust-lang/libc
 by The Rust Project Developers
 Raw FFI bindings to platform libraries like libc.
@@ -15637,7 +15637,7 @@ limitations under the License.
 
 
 ====================================================
-memchr 2.6.4
+memchr 2.7.1
 https://github.com/BurntSushi/memchr
 by Andrew Gallant <jamslam@gmail.com>, bluss
 Provides extremely fast (uses SIMD on x86_64, aarch64 and wasm32) routines for
@@ -19389,7 +19389,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 ====================================================
-object 0.32.1
+object 0.32.2
 https://github.com/gimli-rs/object
 by 
 A unified interface for reading and writing object file formats.
@@ -19630,7 +19630,7 @@ limitations under the License.
 
 
 ====================================================
-once_cell 1.18.0
+once_cell 1.19.0
 https://github.com/matklad/once_cell
 by Aleksey Kladov <aleksey.kladov@gmail.com>
 Single assignment cells and lazy values.
@@ -21985,7 +21985,7 @@ limitations under the License.
 
 
 ====================================================
-proc-macro2 1.0.70
+proc-macro2 1.0.75
 https://github.com/dtolnay/proc-macro2
 by David Tolnay <dtolnay@gmail.com>, Alex Crichton <alex@alexcrichton.com>
 A substitute implementation of the compiler's `proc_macro` API to decouple token-based libraries from the procedural macro use case.
@@ -22199,7 +22199,7 @@ END OF TERMS AND CONDITIONS
 
 
 ====================================================
-pyo3 0.20.0
+pyo3 0.20.2
 https://github.com/pyo3/pyo3
 by PyO3 Project and Contributors <https://github.com/PyO3>
 Bindings to Python interpreter
@@ -22428,7 +22428,7 @@ LICENSE-APACHE:
 
 
 ====================================================
-pyo3-build-config 0.20.0
+pyo3-build-config 0.20.2
 https://github.com/pyo3/pyo3
 by PyO3 Project and Contributors <https://github.com/PyO3>
 Build configuration for the PyO3 ecosystem
@@ -22657,7 +22657,7 @@ LICENSE-APACHE:
 
 
 ====================================================
-pyo3-ffi 0.20.0
+pyo3-ffi 0.20.2
 https://github.com/pyo3/pyo3
 by PyO3 Project and Contributors <https://github.com/PyO3>
 Python-API bindings for the PyO3 ecosystem
@@ -22886,7 +22886,7 @@ LICENSE-APACHE:
 
 
 ====================================================
-pyo3-macros 0.20.0
+pyo3-macros 0.20.2
 https://github.com/pyo3/pyo3
 by PyO3 Project and Contributors <https://github.com/PyO3>
 Proc macros for PyO3 package
@@ -23115,7 +23115,7 @@ LICENSE-APACHE:
 
 
 ====================================================
-pyo3-macros-backend 0.20.0
+pyo3-macros-backend 0.20.2
 https://github.com/pyo3/pyo3
 by PyO3 Project and Contributors <https://github.com/PyO3>
 Code generation for PyO3 package
@@ -23344,7 +23344,7 @@ LICENSE-APACHE:
 
 
 ====================================================
-qoqo 1.8.0
+qoqo 1.9.0
 https://github.com/HQSquantumsimulations/qoqo
 by HQS Quantum Simulations <info@quantumsimulations.de>
 Quantum computing circuit toolkit. Python interface of roqoqo
@@ -23556,7 +23556,7 @@ LICENSE:
 
 
 ====================================================
-qoqo-macros 1.8.0
+qoqo-macros 1.9.0
 by HQS Quantum Simulations <info@quantumsimulations.de>
 Macros for the qoqo crate
 License: Apache-2.0
@@ -24191,7 +24191,7 @@ LICENSE:
 
 
 ====================================================
-quote 1.0.33
+quote 1.0.35
 https://github.com/dtolnay/quote
 by David Tolnay <dtolnay@gmail.com>
 Quasi-quoting macro quote!(...)
@@ -26326,7 +26326,7 @@ limitations under the License.
 
 
 ====================================================
-reqwest 0.11.22
+reqwest 0.11.23
 https://github.com/seanmonstar/reqwest
 by Sean McArthur <sean@seanmonstar.com>
 higher level HTTP client library
@@ -26562,7 +26562,7 @@ limitations under the License.
 
 
 ====================================================
-roqoqo 1.8.0
+roqoqo 1.9.0
 https://github.com/HQSquantumsimulations/qoqo
 by HQS Quantum Simulations <info@quantumsimulations.de>
 Rust Quantum Computing Toolkit by HQS
@@ -26774,7 +26774,7 @@ LICENSE:
 
 
 ====================================================
-roqoqo-derive 1.8.0
+roqoqo-derive 1.9.0
 by HQS Quantum Simulations <info@quantumsimulations.de>
 Macros for the roqoqo crate
 License: Apache-2.0
@@ -26985,7 +26985,7 @@ LICENSE:
 
 
 ====================================================
-roqoqo-test 1.8.0
+roqoqo-test 1.9.0
 https://github.com/HQSquantumsimulations/qoqo
 by HQS Quantum Simulations <info@quantumsimulations.de>
 Testing helper functions for roqoqo toolkit
@@ -27678,7 +27678,7 @@ limitations under the License.
 
 
 ====================================================
-ryu 1.0.15
+ryu 1.0.16
 https://github.com/dtolnay/ryu
 by David Tolnay <dtolnay@gmail.com>
 Fast floating point to string conversion
@@ -28302,7 +28302,7 @@ limitations under the License.
 
 
 ====================================================
-serde 1.0.193
+serde 1.0.194
 https://serde.rs
 by Erick Tryzelaar <erick.tryzelaar@gmail.com>, David Tolnay <dtolnay@gmail.com>
 A generic serialization/deserialization framework
@@ -28516,7 +28516,7 @@ END OF TERMS AND CONDITIONS
 
 
 ====================================================
-serde_derive 1.0.193
+serde_derive 1.0.194
 https://serde.rs
 by Erick Tryzelaar <erick.tryzelaar@gmail.com>, David Tolnay <dtolnay@gmail.com>
 Macros 1.1 implementation of #[derive(Serialize, Deserialize)]
@@ -28969,7 +28969,7 @@ limitations under the License.
 
 
 ====================================================
-serde_json 1.0.108
+serde_json 1.0.111
 https://github.com/serde-rs/json
 by Erick Tryzelaar <erick.tryzelaar@gmail.com>, David Tolnay <dtolnay@gmail.com>
 A JSON serialization file format
@@ -30101,249 +30101,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 
 
-====================================================
-socket2 0.4.10
-https://github.com/rust-lang/socket2
-by Alex Crichton <alex@alexcrichton.com>, Thomas de Zeeuw <thomasdezeeuw@gmail.com>
-Utilities for handling networking sockets with a maximal amount of configuration
-possible intended.
-
-License: MIT OR Apache-2.0
-----------------------------------------------------
-LICENSE-MIT:
-
-Copyright (c) 2014 Alex Crichton
-
-Permission is hereby granted, free of charge, to any
-person obtaining a copy of this software and associated
-documentation files (the "Software"), to deal in the
-Software without restriction, including without
-limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software
-is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice
-shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
-----------------------------------------------------
-LICENSE-APACHE:
-
-                              Apache License
-                        Version 2.0, January 2004
-                     http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-   "License" shall mean the terms and conditions for use, reproduction,
-   and distribution as defined by Sections 1 through 9 of this document.
-
-   "Licensor" shall mean the copyright owner or entity authorized by
-   the copyright owner that is granting the License.
-
-   "Legal Entity" shall mean the union of the acting entity and all
-   other entities that control, are controlled by, or are under common
-   control with that entity. For the purposes of this definition,
-   "control" means (i) the power, direct or indirect, to cause the
-   direction or management of such entity, whether by contract or
-   otherwise, or (ii) ownership of fifty percent (50%) or more of the
-   outstanding shares, or (iii) beneficial ownership of such entity.
-
-   "You" (or "Your") shall mean an individual or Legal Entity
-   exercising permissions granted by this License.
-
-   "Source" form shall mean the preferred form for making modifications,
-   including but not limited to software source code, documentation
-   source, and configuration files.
-
-   "Object" form shall mean any form resulting from mechanical
-   transformation or translation of a Source form, including but
-   not limited to compiled object code, generated documentation,
-   and conversions to other media types.
-
-   "Work" shall mean the work of authorship, whether in Source or
-   Object form, made available under the License, as indicated by a
-   copyright notice that is included in or attached to the work
-   (an example is provided in the Appendix below).
-
-   "Derivative Works" shall mean any work, whether in Source or Object
-   form, that is based on (or derived from) the Work and for which the
-   editorial revisions, annotations, elaborations, or other modifications
-   represent, as a whole, an original work of authorship. For the purposes
-   of this License, Derivative Works shall not include works that remain
-   separable from, or merely link (or bind by name) to the interfaces of,
-   the Work and Derivative Works thereof.
-
-   "Contribution" shall mean any work of authorship, including
-   the original version of the Work and any modifications or additions
-   to that Work or Derivative Works thereof, that is intentionally
-   submitted to Licensor for inclusion in the Work by the copyright owner
-   or by an individual or Legal Entity authorized to submit on behalf of
-   the copyright owner. For the purposes of this definition, "submitted"
-   means any form of electronic, verbal, or written communication sent
-   to the Licensor or its representatives, including but not limited to
-   communication on electronic mailing lists, source code control systems,
-   and issue tracking systems that are managed by, or on behalf of, the
-   Licensor for the purpose of discussing and improving the Work, but
-   excluding communication that is conspicuously marked or otherwise
-   designated in writing by the copyright owner as "Not a Contribution."
-
-   "Contributor" shall mean Licensor and any individual or Legal Entity
-   on behalf of whom a Contribution has been received by Licensor and
-   subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
-   this License, each Contributor hereby grants to You a perpetual,
-   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-   copyright license to reproduce, prepare Derivative Works of,
-   publicly display, publicly perform, sublicense, and distribute the
-   Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
-   this License, each Contributor hereby grants to You a perpetual,
-   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-   (except as stated in this section) patent license to make, have made,
-   use, offer to sell, sell, import, and otherwise transfer the Work,
-   where such license applies only to those patent claims licensable
-   by such Contributor that are necessarily infringed by their
-   Contribution(s) alone or by combination of their Contribution(s)
-   with the Work to which such Contribution(s) was submitted. If You
-   institute patent litigation against any entity (including a
-   cross-claim or counterclaim in a lawsuit) alleging that the Work
-   or a Contribution incorporated within the Work constitutes direct
-   or contributory patent infringement, then any patent licenses
-   granted to You under this License for that Work shall terminate
-   as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
-   Work or Derivative Works thereof in any medium, with or without
-   modifications, and in Source or Object form, provided that You
-   meet the following conditions:
-
-   (a) You must give any other recipients of the Work or
-       Derivative Works a copy of this License; and
-
-   (b) You must cause any modified files to carry prominent notices
-       stating that You changed the files; and
-
-   (c) You must retain, in the Source form of any Derivative Works
-       that You distribute, all copyright, patent, trademark, and
-       attribution notices from the Source form of the Work,
-       excluding those notices that do not pertain to any part of
-       the Derivative Works; and
-
-   (d) If the Work includes a "NOTICE" text file as part of its
-       distribution, then any Derivative Works that You distribute must
-       include a readable copy of the attribution notices contained
-       within such NOTICE file, excluding those notices that do not
-       pertain to any part of the Derivative Works, in at least one
-       of the following places: within a NOTICE text file distributed
-       as part of the Derivative Works; within the Source form or
-       documentation, if provided along with the Derivative Works; or,
-       within a display generated by the Derivative Works, if and
-       wherever such third-party notices normally appear. The contents
-       of the NOTICE file are for informational purposes only and
-       do not modify the License. You may add Your own attribution
-       notices within Derivative Works that You distribute, alongside
-       or as an addendum to the NOTICE text from the Work, provided
-       that such additional attribution notices cannot be construed
-       as modifying the License.
-
-   You may add Your own copyright statement to Your modifications and
-   may provide additional or different license terms and conditions
-   for use, reproduction, or distribution of Your modifications, or
-   for any such Derivative Works as a whole, provided Your use,
-   reproduction, and distribution of the Work otherwise complies with
-   the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
-   any Contribution intentionally submitted for inclusion in the Work
-   by You to the Licensor shall be under the terms and conditions of
-   this License, without any additional terms or conditions.
-   Notwithstanding the above, nothing herein shall supersede or modify
-   the terms of any separate license agreement you may have executed
-   with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
-   names, trademarks, service marks, or product names of the Licensor,
-   except as required for reasonable and customary use in describing the
-   origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
-   agreed to in writing, Licensor provides the Work (and each
-   Contributor provides its Contributions) on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-   implied, including, without limitation, any warranties or conditions
-   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-   PARTICULAR PURPOSE. You are solely responsible for determining the
-   appropriateness of using or redistributing the Work and assume any
-   risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
-   whether in tort (including negligence), contract, or otherwise,
-   unless required by applicable law (such as deliberate and grossly
-   negligent acts) or agreed to in writing, shall any Contributor be
-   liable to You for damages, including any direct, indirect, special,
-   incidental, or consequential damages of any character arising as a
-   result of this License or out of the use or inability to use the
-   Work (including but not limited to damages for loss of goodwill,
-   work stoppage, computer failure or malfunction, or any and all
-   other commercial damages or losses), even if such Contributor
-   has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
-   the Work or Derivative Works thereof, You may choose to offer,
-   and charge a fee for, acceptance of support, warranty, indemnity,
-   or other liability obligations and/or rights consistent with this
-   License. However, in accepting such obligations, You may act only
-   on Your own behalf and on Your sole responsibility, not on behalf
-   of any other Contributor, and only if You agree to indemnify,
-   defend, and hold each Contributor harmless for any liability
-   incurred by, or claims asserted against, such Contributor by reason
-   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.
-
-
 ====================================================
 socket2 0.5.5
 https://github.com/rust-lang/socket2
@@ -31291,7 +31048,7 @@ limitations under the License.
 
 
 ====================================================
-syn 2.0.39
+syn 2.0.48
 https://github.com/dtolnay/syn
 by David Tolnay <dtolnay@gmail.com>
 Parser for Rust source code
@@ -31519,7 +31276,7 @@ Low level bindings to SystemConfiguration framework for macOS
 License: MIT OR Apache-2.0
 
 ====================================================
-target-lexicon 0.12.12
+target-lexicon 0.12.13
 https://github.com/bytecodealliance/target-lexicon
 by Dan Gohman <sunfish@mozilla.com>
 Targeting utilities for compilers and related tools
@@ -31846,7 +31603,7 @@ SOFTWARE.
 
 
 ====================================================
-thiserror 1.0.50
+thiserror 1.0.56
 https://github.com/dtolnay/thiserror
 by David Tolnay <dtolnay@gmail.com>
 derive(Error)
@@ -32060,7 +31817,7 @@ END OF TERMS AND CONDITIONS
 
 
 ====================================================
-thiserror-impl 1.0.50
+thiserror-impl 1.0.56
 https://github.com/dtolnay/thiserror
 by David Tolnay <dtolnay@gmail.com>
 Implementation detail of the `thiserror` crate
@@ -32274,7 +32031,7 @@ END OF TERMS AND CONDITIONS
 
 
 ====================================================
-time 0.3.30
+time 0.3.31
 https://time-rs.github.io
 by Jacob Pratt <open-source@jhpratt.dev>, Time contributors
 Date and time library. Fully interoperable with the standard library. Mostly compatible with #![no_std].
@@ -32746,7 +32503,7 @@ SOFTWARE.
 
 
 ====================================================
-time-macros 0.2.15
+time-macros 0.2.16
 https://github.com/time-rs/time
 by Jacob Pratt <open-source@jhpratt.dev>, Time contributors
     Procedural macros for the time crate.
@@ -33483,7 +33240,7 @@ LICENSE-APACHE.md:
 
 
 ====================================================
-tokio 1.34.0
+tokio 1.35.1
 https://tokio.rs
 by Tokio Contributors <team@tokio.rs>
 An event-driven, non-blocking I/O platform for writing asynchronous I/O
@@ -33669,7 +33426,7 @@ DEALINGS IN THE SOFTWARE.
 
 
 ====================================================
-try-lock 0.2.4
+try-lock 0.2.5
 https://github.com/seanmonstar/try-lock
 by Sean McArthur <sean@seanmonstar.com>
 A lightweight atomic lock.
@@ -33677,7 +33434,7 @@ License: MIT
 ----------------------------------------------------
 LICENSE:
 
-Copyright (c) 2018 Sean McArthur
+Copyright (c) 2018-2023 Sean McArthur
 Copyright (c) 2016 Alex Crichton
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -38051,255 +37808,6 @@ Permission is granted to anyone to use this software for any purpose, including
 3. This notice may not be removed or altered from any source distribution.
 
 
-====================================================
-winapi 0.3.9
-https://github.com/retep998/winapi-rs
-by Peter Atashian <retep998@gmail.com>
-Raw FFI bindings for all of Windows API.
-License: MIT/Apache-2.0
-----------------------------------------------------
-LICENSE-MIT:
-
-Copyright (c) 2015-2018 The winapi-rs Developers
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-----------------------------------------------------
-LICENSE-APACHE:
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      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.
-
-
-====================================================
-winapi-i686-pc-windows-gnu 0.4.0
-https://github.com/retep998/winapi-rs
-by Peter Atashian <retep998@gmail.com>
-Import libraries for the i686-pc-windows-gnu target. Please don't use this crate directly, depend on winapi instead.
-License: MIT/Apache-2.0
-
-====================================================
-winapi-x86_64-pc-windows-gnu 0.4.0
-https://github.com/retep998/winapi-rs
-by Peter Atashian <retep998@gmail.com>
-Import libraries for the x86_64-pc-windows-gnu target. Please don't use this crate directly, depend on winapi instead.
-License: MIT/Apache-2.0
-
 ====================================================
 windows-sys 0.48.0
 https://github.com/microsoft/windows-rs
@@ -42597,7 +42105,7 @@ THE SOFTWARE.
 
 
 ====================================================
-zerocopy 0.7.29
+zerocopy 0.7.32
 https://github.com/google/zerocopy
 by Joshua Liebow-Feeser <joshlf@google.com>
 Utilities for zero-copy parsing and serialization
@@ -42868,7 +42376,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 ====================================================
-zerocopy-derive 0.7.29
+zerocopy-derive 0.7.32
 https://github.com/google/zerocopy
 by Joshua Liebow-Feeser <joshlf@google.com>
 Custom derive for traits from the zerocopy crate
diff --git a/qoqo/src/devices/mod.rs b/qoqo/src/devices/mod.rs
index b2e1fae3..83090781 100644
--- a/qoqo/src/devices/mod.rs
+++ b/qoqo/src/devices/mod.rs
@@ -18,15 +18,78 @@
 //! contain the necessary information for accessing the quantum computing hardware.
 //! The devices also encode a connectivity model.
 
+#[cfg(feature = "unstable_chain_with_environment")]
+use std::collections::HashMap;
+
 use pyo3::prelude::*;
 
 mod square_lattice;
+#[cfg(feature = "unstable_chain_with_environment")]
+use roqoqo::{devices::ChainWithEnvironmentDevice, RoqoqoError};
 pub use square_lattice::SquareLatticeDeviceWrapper;
 mod generic_device;
 pub use generic_device::GenericDeviceWrapper;
 mod all_to_all;
 pub use all_to_all::AllToAllDeviceWrapper;
 
+#[cfg(feature = "unstable_chain_with_environment")]
+/// A wrapper around a python object that implements the ChainWithEnvironment trait.
+///
+/// Can be used to avoid deserializain the python object.
+#[derive(Clone, Debug)]
+pub struct ChainWithEnvironmentCapsule {
+    internal: Py<PyAny>,
+}
+
+#[cfg(feature = "unstable_chain_with_environment")]
+impl ChainWithEnvironmentCapsule {
+    /// Creates a new ChainWithEnvironmentCapsule for a Python object.
+    ///
+    /// # Arguments
+    ///
+    /// * `python_device` - The python object that should implement the
+    pub fn new(python_device: Py<PyAny>) -> Result<Self, RoqoqoError> {
+        let implements_protocol = Python::with_gil(|py| -> bool {
+            let __implements_environment_with_chains =
+                python_device.call_method0(py, "__implements_environment_chains");
+            if __implements_environment_with_chains.is_err() {
+                return false;
+            }
+            let __implements_environment_with_chains = __implements_environment_with_chains
+                .unwrap()
+                .extract::<bool>(py);
+            if __implements_environment_with_chains.is_err() {
+                return false;
+            }
+            __implements_environment_with_chains.unwrap()
+        });
+        if !implements_protocol {
+            return Err(RoqoqoError::GenericError {
+                msg: "Python device does not implement `environment_chains` method.".to_string(),
+            });
+        }
+        Ok(Self {
+            internal: python_device,
+        })
+    }
+}
+
+#[cfg(feature = "unstable_chain_with_environment")]
+impl ChainWithEnvironmentDevice for ChainWithEnvironmentCapsule {
+    fn environment_chains(&self) -> Vec<roqoqo::devices::ChainAndEnvironment> {
+        Python::with_gil(|py| -> Vec<roqoqo::devices::ChainAndEnvironment> {
+            let chains_with_environment = self
+                .internal
+                .call_method0(py, "__environment_chains")
+                .expect("Internal error `environment_chains` on python device failed.");
+            let chains_with_environment = chains_with_environment
+                  .extract::<Vec<(Vec<usize>, HashMap<usize, Vec<usize>>)>>(py)
+                  .expect("Internal error `environment_chains` on python device does not return valid desctiption.");
+            chains_with_environment
+        })
+    }
+}
+
 /// Devices in qoqo have two use cases:
 ///
 /// * Abstract devices: Contain abstract information for the model of a quantum computer and its parameters.
diff --git a/qoqo/src/operations/mod.rs b/qoqo/src/operations/mod.rs
index ec7a610f..43d7800b 100644
--- a/qoqo/src/operations/mod.rs
+++ b/qoqo/src/operations/mod.rs
@@ -147,5 +147,6 @@ pub fn operations(_py: Python, m: &PyModule) -> PyResult<()> {
     m.add_class::<PhaseDisplacementWrapper>()?;
     m.add_class::<EchoCrossResonanceWrapper>()?;
     m.add_class::<PragmaAnnotatedOpWrapper>()?;
+    // 1.9
     Ok(())
 }
diff --git a/roqoqo-derive/Cargo.toml b/roqoqo-derive/Cargo.toml
index f4f5bc94..8693a008 100644
--- a/roqoqo-derive/Cargo.toml
+++ b/roqoqo-derive/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "roqoqo-derive"
-version = "1.8.0"
+version = "1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 license = "Apache-2.0"
 edition = "2021"
diff --git a/roqoqo/Cargo.toml b/roqoqo/Cargo.toml
index 81bc7422..ba0c2ccc 100644
--- a/roqoqo/Cargo.toml
+++ b/roqoqo/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "roqoqo"
-version = "1.8.0"
+version = "1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 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.8", path="../roqoqo-derive"}
+roqoqo-derive = {version="1.9", path="../roqoqo-derive"}
 typetag = {version="0.2", optional=true}
 nalgebra = "0.32"
 schemars = { version="0.8", optional=true }
@@ -63,4 +63,5 @@ serialize = ["serde", "ndarray/serde", "num-complex/serde", "bincode", "petgraph
 overrotate = [ "rand_distr", "roqoqo-derive/overrotate"]
 async = ["async-trait", "futures"]
 json_schema=["schemars", "serialize", "qoqo_calculator/json_schema", "jsonschema"]
-circuitdag = ["petgraph"]
\ No newline at end of file
+circuitdag = ["petgraph"]
+unstable_chain_with_environment = []
\ No newline at end of file
diff --git a/roqoqo/build.rs b/roqoqo/build.rs
index 6bb0a3fe..5729923b 100644
--- a/roqoqo/build.rs
+++ b/roqoqo/build.rs
@@ -21,7 +21,7 @@ use syn::punctuated::Punctuated;
 use syn::visit::{self, Visit};
 use syn::{AttrStyle, File, Ident, ItemImpl, ItemStruct, Path, Token, Type, TypePath};
 
-const NUMBER_OF_MINOR_VERSIONS: usize = 9;
+const NUMBER_OF_MINOR_VERSIONS: usize = 10;
 
 /// Visitor scanning rust source code for struct belonging to enums
 struct Visitor {
diff --git a/roqoqo/src/devices/mod.rs b/roqoqo/src/devices/mod.rs
index abf323b3..b2060621 100644
--- a/roqoqo/src/devices/mod.rs
+++ b/roqoqo/src/devices/mod.rs
@@ -31,6 +31,8 @@
 //!     accessing the quantum computing hardware. The devices also encode a connectivity model
 //!
 
+#[cfg(feature = "unstable_chain_with_environment")]
+use std::collections::HashMap;
 #[cfg(feature = "unstable_qoqo_devices")]
 use std::collections::HashSet;
 
@@ -470,3 +472,65 @@ pub trait QoqoDevice {
         })
     }
 }
+
+#[cfg(feature = "unstable_chain_with_environment")]
+/// The description of a chain and environment.
+/// The first list contains all the qubits in the chain,
+/// the second entry the HashMap contains mapps each qubit in the chain
+/// to the qubits of the environment it is connected to.
+pub type ChainAndEnvironment = (Vec<usize>, HashMap<usize, Vec<usize>>);
+
+#[cfg(feature = "unstable_chain_with_environment")]
+/// Trait implemented by devices that can return a list of chains
+///
+pub trait ChainWithEnvironmentDevice {
+    /// Return a list of linear chains with an environment through the device.
+    ///
+    /// Returns at least one chain of qubits with linear connectivity and an environment in the device.
+    /// An environment is defined as at least one qubit that is connected to at least one qubit of the chain
+    /// but not part of the chain.
+    /// For each ratio of environment qubits to chain qubits, the list contains at least one of the longest chains
+    /// in the devive with that ratio. (Unless that chain and environment is simply a subset
+    /// of a chain with equal or longer length and equal or higher ratio).
+    ///
+    /// For example, take a device with the connectivity graph:
+    /// ```
+    /// 0 - 3 - 6
+    /// |   |   |
+    /// 1 - 4 - 7
+    /// |   |
+    /// 2 - 5
+    /// ```
+    /// It would have one chain of length 1 and environment with ratio 4 to 1:
+    ///
+    /// ```
+    /// ([4], {4: [1,4,7,5]})
+    /// ```
+    ///
+    /// One with lenght 2 and ratio 5 to 2:
+    /// ```
+    /// ([3,4], {3:[0,6], 4: [1,7,5]})
+    /// ```
+    ///
+    /// The chain and environment with lenght 2 and ratio 2 to 1 is a subset of the one above
+    /// and does not need to be listed separately.
+    ///
+    /// The longest chain with ratio 1 to 1 is:
+    /// ```
+    /// ([0,1,4,3], {1:[2], 4: [5,7], 3: [6]})
+    /// ```
+    /// One of the longest chains with ratio 2 to 6 is
+    /// ```
+    /// ([0,1,2,5,4,3], {4: [7], 3: [6]})
+    /// ```
+    /// And one of the possible chains with just one environment qubit is:
+    /// ```
+    /// ([0,1,2,5,4,3,6], {6: [7], 4: [7]})
+    /// ```
+    ///
+    /// # Returns
+    ///
+    /// Vec<(Vec<usize>, HashMap<usize, Vec<usize>>)> - A list of the chains and environments.
+    ///
+    fn environment_chains(&self) -> Vec<ChainAndEnvironment>;
+}
diff --git a/roqoqo/src/operations/mod.rs b/roqoqo/src/operations/mod.rs
index c415b81e..fee59634 100644
--- a/roqoqo/src/operations/mod.rs
+++ b/roqoqo/src/operations/mod.rs
@@ -830,6 +830,9 @@ pub(crate) trait ImplementedIn1point7: Operate {}
 /// Marker trait to show that some operation has been implemented in roqoqo 1.8.0
 pub(crate) trait ImplementedIn1point8: Operate {}
 
+/// Marker trait to show that some operation has been implemented in roqoqo 1.9.0
+pub(crate) trait ImplementedIn1point9: Operate {}
+
 #[cfg(feature = "dynamic")]
 /// A wrapper for Operate trait objects.
 ///


Test patch:
diff --git a/.compatibility_tests/compatibility_test_1_0/Cargo.toml b/.compatibility_tests/compatibility_test_1_0/Cargo.toml
index 64f2e223..f85be114 100644
--- a/.compatibility_tests/compatibility_test_1_0/Cargo.toml
+++ b/.compatibility_tests/compatibility_test_1_0/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "compatibility_test_1_0"
-version ="1.8.0"
+version ="1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 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.8", path="../../roqoqo", features=["serialize", "overrotate"]}
+roqoqo = {version="1.9", path="../../roqoqo", features=["serialize", "overrotate"]}
 bincode = {version="1.3"}
 ndarray = "0.15"
 
diff --git a/.compatibility_tests/compatibility_test_1_2/Cargo.toml b/.compatibility_tests/compatibility_test_1_2/Cargo.toml
index 9369b3ee..a501838a 100644
--- a/.compatibility_tests/compatibility_test_1_2/Cargo.toml
+++ b/.compatibility_tests/compatibility_test_1_2/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "compatibility_test_1_2"
-version ="1.8.0"
+version ="1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 license = "Apache-2.0"
 edition = "2021"
@@ -22,7 +22,7 @@ publish = false
 test_roqoqo_1_2 = {package = "roqoqo", version="=1.2.5"}
 test_roqoqo_derive_1_2 = {package = "roqoqo-derive", version="=1.2.5"}
 qoqo_calculator = { version="1.1" }
-roqoqo = {version="1.8", path="../../roqoqo", features=["serialize", "overrotate"]}
+roqoqo = {version="1.9", path="../../roqoqo", features=["serialize", "overrotate"]}
 bincode = {version="1.3"}
 ndarray = "0.15"
 
diff --git a/.compatibility_tests/compatibility_test_1_3/Cargo.toml b/.compatibility_tests/compatibility_test_1_3/Cargo.toml
index f8b3cd4a..9447bc01 100644
--- a/.compatibility_tests/compatibility_test_1_3/Cargo.toml
+++ b/.compatibility_tests/compatibility_test_1_3/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "compatibility_test_1_3"
-version ="1.8.0"
+version ="1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 license = "Apache-2.0"
 edition = "2021"
@@ -22,7 +22,7 @@ publish = false
 test_roqoqo_1_3 = {package = "roqoqo", version="=1.3.2"}
 test_roqoqo_derive_1_3 = {package = "roqoqo-derive", version="=1.3.2"}
 qoqo_calculator = { version="1.1" }
-roqoqo = {version="1.8", path="../../roqoqo", features=["serialize", "overrotate"]}
+roqoqo = {version="1.9", path="../../roqoqo", features=["serialize", "overrotate"]}
 bincode = {version="1.3"}
 ndarray = "0.15"
 
diff --git a/.compatibility_tests/compatibility_test_1_4/Cargo.toml b/.compatibility_tests/compatibility_test_1_4/Cargo.toml
index 42f7ce8f..5afa1d3d 100644
--- a/.compatibility_tests/compatibility_test_1_4/Cargo.toml
+++ b/.compatibility_tests/compatibility_test_1_4/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "compatibility_test_1_4"
-version ="1.8.0"
+version ="1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 license = "Apache-2.0"
 edition = "2021"
@@ -22,7 +22,7 @@ publish = false
 test_roqoqo_1_4 = {package = "roqoqo", version="=1.4.0"}
 test_roqoqo_derive_1_4 = {package = "roqoqo-derive", version="=1.4.0"}
 qoqo_calculator = { version="1.1" }
-roqoqo = {version="1.8", path="../../roqoqo", features=["serialize", "overrotate"]}
+roqoqo = {version="1.9", path="../../roqoqo", features=["serialize", "overrotate"]}
 bincode = {version="1.3"}
 ndarray = "0.15"
 
diff --git a/.compatibility_tests/compatibility_test_1_5/Cargo.toml b/.compatibility_tests/compatibility_test_1_5/Cargo.toml
index 05f24aa9..9bff19ec 100644
--- a/.compatibility_tests/compatibility_test_1_5/Cargo.toml
+++ b/.compatibility_tests/compatibility_test_1_5/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "compatibility_test_1_5"
-version ="1.8.0"
+version ="1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 license = "Apache-2.0"
 edition = "2021"
@@ -22,7 +22,7 @@ publish = false
 test_roqoqo_1_5 = {package = "roqoqo", version="=1.5.0"}
 test_roqoqo_derive_1_5 = {package = "roqoqo-derive", version="=1.5.0"}
 qoqo_calculator = { version="1.1" }
-roqoqo = {version="1.8", path="../../roqoqo", features=["serialize", "overrotate"]}
+roqoqo = {version="1.9", path="../../roqoqo", features=["serialize", "overrotate"]}
 bincode = {version="1.3"}
 ndarray = "0.15"
 
diff --git a/.compatibility_tests/compatibility_test_1_6/Cargo.toml b/.compatibility_tests/compatibility_test_1_6/Cargo.toml
index 1f2534d9..73bcc8e0 100644
--- a/.compatibility_tests/compatibility_test_1_6/Cargo.toml
+++ b/.compatibility_tests/compatibility_test_1_6/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "compatibility_test_1_6"
-version ="1.8.0"
+version ="1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 license = "Apache-2.0"
 edition = "2021"
@@ -22,7 +22,7 @@ publish = false
 test_roqoqo_1_6 = {package = "roqoqo", version="=1.6.1"}
 test_roqoqo_derive_1_6 = {package = "roqoqo-derive", version="=1.6.1"}
 qoqo_calculator = { version="1.1" }
-roqoqo = {version="1.8", path="../../roqoqo", features=["serialize", "overrotate"]}
+roqoqo = {version="1.9", path="../../roqoqo", features=["serialize", "overrotate"]}
 bincode = {version="1.3"}
 ndarray = "0.15"
 
diff --git a/.compatibility_tests/compatibility_test_1_7/Cargo.toml b/.compatibility_tests/compatibility_test_1_7/Cargo.toml
index 91f1f732..4becf9d2 100644
--- a/.compatibility_tests/compatibility_test_1_7/Cargo.toml
+++ b/.compatibility_tests/compatibility_test_1_7/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "compatibility_test_1_7"
-version ="1.8.0"
+version ="1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 license = "Apache-2.0"
 edition = "2021"
@@ -22,7 +22,7 @@ publish = false
 test_roqoqo_1_7 = {package = "roqoqo", version="=1.7.1"}
 test_roqoqo_derive_1_7 = {package = "roqoqo-derive", version="=1.7.1"}
 qoqo_calculator = { version="1.1" }
-roqoqo = {version="1.8", path="../../roqoqo", features=["serialize", "overrotate"]}
+roqoqo = {version="1.9", path="../../roqoqo", features=["serialize", "overrotate"]}
 bincode = {version="1.3"}
 ndarray = "0.15"
 
diff --git a/.compatibility_tests/compatibility_test_1_8/Cargo.toml b/.compatibility_tests/compatibility_test_1_8/Cargo.toml
new file mode 100644
index 00000000..4217ca3d
--- /dev/null
+++ b/.compatibility_tests/compatibility_test_1_8/Cargo.toml
@@ -0,0 +1,30 @@
+[package]
+name = "compatibility_test_1_8"
+version ="1.9.0"
+authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
+license = "Apache-2.0"
+edition = "2021"
+rust-version = "1.56"
+categories = ["science", "simulation"]
+homepage = "https://github.com/HQSquantumsimulations/qoqo"
+repository = "https://github.com/HQSquantumsimulations/qoqo"
+documentation = "https://docs.rs/roqoqo/"
+readme = "../README.md"
+description = "Compatibility tests for roqoqo"
+include = ["src*", "build.rs", "LICENSE", "README.md"]
+publish = false
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[workspace]
+
+[dependencies]
+test_roqoqo_1_8 = {package = "roqoqo", version="=1.8.0"}
+test_roqoqo_derive_1_8 = {package = "roqoqo-derive", version="=1.8.0"}
+qoqo_calculator = { version="1.1" }
+roqoqo = {version="1.9", path="../../roqoqo", features=["serialize", "overrotate"]}
+bincode = {version="1.3"}
+ndarray = "0.15"
+
+[dev-dependencies]
+test-case = "3.0"
\ No newline at end of file
diff --git a/.compatibility_tests/compatibility_test_1_8/src/lib.rs b/.compatibility_tests/compatibility_test_1_8/src/lib.rs
new file mode 100644
index 00000000..7d12d9af
--- /dev/null
+++ b/.compatibility_tests/compatibility_test_1_8/src/lib.rs
@@ -0,0 +1,14 @@
+pub fn add(left: usize, right: usize) -> usize {
+    left + right
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn it_works() {
+        let result = add(2, 2);
+        assert_eq!(result, 4);
+    }
+}
diff --git a/.compatibility_tests/compatibility_test_1_8/tests/integration/compatibility_1_8.rs b/.compatibility_tests/compatibility_test_1_8/tests/integration/compatibility_1_8.rs
new file mode 100644
index 00000000..be252323
--- /dev/null
+++ b/.compatibility_tests/compatibility_test_1_8/tests/integration/compatibility_1_8.rs
@@ -0,0 +1,155 @@
+// Copyright © 2023 HQS Quantum Simulations GmbH. All Rights Reserved.
+//
+// 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.
+
+use std::collections::HashMap;
+
+use test_case::test_case;
+use test_roqoqo_1_8;
+
+// 1.0 version
+#[test_case(test_roqoqo_1_8::operations::SingleQubitGate::new(0, 1.0.into(), 0.0.into(), 0.0.into(), 0.0.into(), 0.0.into(),).into(); "SingleQubitGate")]
+#[test_case(test_roqoqo_1_8::operations::RotateZ::new(0, 0.1.into()).into(); "RotateZ")]
+#[test_case(test_roqoqo_1_8::operations::RotateY::new(0, 0.1.into()).into(); "RotateY")]
+#[test_case(test_roqoqo_1_8::operations::RotateX::new(0, 0.1.into()).into(); "RotateX")]
+#[test_case(test_roqoqo_1_8::operations::RotateXY::new(0,1.0.into(), 0.1.into()).into(); "RotateXY")]
+#[test_case(test_roqoqo_1_8::operations::RotateAroundSphericalAxis::new(0, 1.0.into(), 1.0.into(), 1.0.into()).into(); "RotateAroundSphericalAxis")]
+#[test_case(test_roqoqo_1_8::operations::PauliZ::new(0).into(); "PauliZ")]
+#[test_case(test_roqoqo_1_8::operations::PauliY::new(0).into(); "PauliY")]
+#[test_case(test_roqoqo_1_8::operations::PauliX::new(0).into(); "PauliX")]
+#[test_case(test_roqoqo_1_8::operations::SqrtPauliX::new(0).into(); "SqrtPauliX")]
+#[test_case(test_roqoqo_1_8::operations::InvSqrtPauliX::new(0).into(); "InvSqrtPauliX")]
+#[test_case(test_roqoqo_1_8::operations::Hadamard::new(0).into(); "Hadamard")]
+#[test_case(test_roqoqo_1_8::operations::TGate::new(0).into(); "TGate")]
+#[test_case(test_roqoqo_1_8::operations::SGate::new(0).into(); "SGate")]
+#[test_case(test_roqoqo_1_8::operations::DefinitionBit::new("ro".to_string(), 1, false).into(); "DefinitionBit")]
+#[test_case(test_roqoqo_1_8::operations::DefinitionComplex::new("ro".to_string(), 1, true).into(); "DefinitionComplex")]
+#[test_case(test_roqoqo_1_8::operations::DefinitionUsize::new("ro".to_string(), 1, true).into(); "DefinitionUsize")]
+#[test_case(test_roqoqo_1_8::operations::DefinitionFloat::new("ro".to_string(), 1, true).into(); "DefinitionFloat")]
+#[test_case(test_roqoqo_1_8::operations::InputSymbolic::new("ro".to_string(), 1.0).into(); "InputSymbolic")]
+#[test_case(test_roqoqo_1_8::operations::MeasureQubit::new(0,"ro".to_string(), 1).into(); "MeasureQubit")]
+#[test_case(test_roqoqo_1_8::operations::PragmaGetStateVector::new("ro".to_string(), None).into(); "PragmaGetStateVector")]
+#[test_case(test_roqoqo_1_8::operations::PragmaGetDensityMatrix::new("ro".to_string(), None).into(); "PragmaGetDensityMatrix")]
+#[test_case(test_roqoqo_1_8::operations::PragmaGetOccupationProbability::new("ro".to_string(), None).into(); "PragmaGetOccupationProbability")]
+#[test_case(test_roqoqo_1_8::operations::PragmaGetPauliProduct::new(std::collections::HashMap::new(),"ro".to_string(), test_roqoqo_1_8::Circuit::new()).into(); "PragmaGetPauliProduct")]
+#[test_case(test_roqoqo_1_8::operations::PragmaRepeatedMeasurement::new("ro".to_string(), 10, None).into(); "PragmaRepeatedMeasurement")]
+#[test_case(test_roqoqo_1_8::operations::PragmaSetNumberOfMeasurements::new(10, "ro".to_string()).into(); "PragmaSetNumberOfMeasurements")]
+#[test_case(test_roqoqo_1_8::operations::PragmaSetStateVector::new(ndarray::array![1.0.into(), 0.0.into(), 0.0.into()]).into(); "PragmaSetStateVector")]
+#[test_case(test_roqoqo_1_8::operations::PragmaSetDensityMatrix::new(ndarray::array![[1.0.into(), 0.0.into(), 0.0.into()]]).into(); "PragmaSetDensityMatrix")]
+#[test_case(test_roqoqo_1_8::operations::PragmaRepeatGate::new(10).into(); "PragmaRepeatGate")]
+#[test_case(test_roqoqo_1_8::operations::PragmaOverrotation::new("RotateZ".to_string(), vec![0], 1.0, 1.0).into(); "PragmaOverrotation")]
+#[test_case(test_roqoqo_1_8::operations::PragmaBoostNoise::new(1.0.into()).into(); "PragmaBoostNoise")]
+#[test_case(test_roqoqo_1_8::operations::PragmaStopParallelBlock::new(vec![0], 1.0.into()).into(); "PragmaStopParallelBlock")]
+#[test_case(test_roqoqo_1_8::operations::PragmaGlobalPhase::new(1.0.into()).into(); "PragmaGlobalPhase")]
+#[test_case(test_roqoqo_1_8::operations::PragmaSleep::new(vec![0], 1.0.into()).into(); "PragmaSleep")]
+#[test_case(test_roqoqo_1_8::operations::PragmaActiveReset::new(0).into(); "PragmaActiveReset")]
+#[test_case(test_roqoqo_1_8::operations::PragmaStartDecompositionBlock::new(vec![0], HashMap::new()).into(); "PragmaStartDecompositionBlock")]
+#[test_case(test_roqoqo_1_8::operations::PragmaStopDecompositionBlock::new(vec![0]).into(); "PragmaStopDecompositionBlock")]
+#[test_case(test_roqoqo_1_8::operations::PragmaDamping::new(0,1.0.into(), 1.0.into()).into(); "PragmaDamping")]
+#[test_case(test_roqoqo_1_8::operations::PragmaDepolarising::new(0,1.0.into(), 1.0.into()).into(); "PragmaDepolarising")]
+#[test_case(test_roqoqo_1_8::operations::PragmaDephasing::new(0,1.0.into(), 1.0.into()).into(); "PragmaDephasing")]
+#[test_case(test_roqoqo_1_8::operations::PragmaRandomNoise::new(0,1.0.into(), 1.0.into(), 1.0.into()).into(); "PragmaRandomNoise")]
+#[test_case(test_roqoqo_1_8::operations::PragmaGeneralNoise::new(0, 0.1.into(), ndarray::array![[1.0.into(), 0.0.into()], [1.0.into(), 2.0.into()]]).into(); "PragmaGeneralNoise")]
+#[test_case(test_roqoqo_1_8::operations::PragmaConditional::new("ro".to_string(),0, test_roqoqo_1_8::Circuit::new()).into(); "PragmaConditional")]
+// #[test_case(test_roqoqo_1_8::operations::PragmaChangeDevice::new(&"PragmaTest".into()).unwrap().into(); "PragmaChangeDevice")]
+#[test_case(test_roqoqo_1_8::operations::CNOT::new(0,1).into(); "CNOT")]
+#[test_case(test_roqoqo_1_8::operations::SWAP::new(0,1).into(); "SWAP")]
+#[test_case(test_roqoqo_1_8::operations::FSwap::new(0,1).into(); "FSwap")]
+#[test_case(test_roqoqo_1_8::operations::ISwap::new(0,1).into(); "ISwap")]
+#[test_case(test_roqoqo_1_8::operations::SqrtISwap::new(0,1).into(); "SqrtISWAP")]
+#[test_case(test_roqoqo_1_8::operations::InvSqrtISwap::new(0,1).into(); "InvSqrtISWAP")]
+#[test_case(test_roqoqo_1_8::operations::XY::new(0,1, 0.1.into()).into(); "XY")]
+#[test_case(test_roqoqo_1_8::operations::ControlledPhaseShift::new(0,1, 0.1.into()).into(); "ControlledPhase")]
+#[test_case(test_roqoqo_1_8::operations::ControlledPauliY::new(0,1).into(); "ControlledPauliY")]
+#[test_case(test_roqoqo_1_8::operations::ControlledPauliZ::new(0,1).into(); "ControlledPauliZ")]
+#[test_case(test_roqoqo_1_8::operations::MolmerSorensenXX::new(0,1).into(); "MolmerSorensenXX")]
+#[test_case(test_roqoqo_1_8::operations::VariableMSXX::new(0,1, 0.1.into()).into(); "VariableMSXX")]
+#[test_case(test_roqoqo_1_8::operations::GivensRotation::new(0,1, 0.1.into(), 0.1.into()).into(); "GivensRotation")]
+#[test_case(test_roqoqo_1_8::operations::GivensRotationLittleEndian::new(0,1, 0.1.into(), 0.1.into()).into(); "GivensRotationLittleEndian")]
+#[test_case(test_roqoqo_1_8::operations::Qsim::new(0,1, 0.1.into(), 0.1.into(), 0.1.into()).into(); "Qsim")]
+#[test_case(test_roqoqo_1_8::operations::Fsim::new(0,1, 0.1.into(), 0.1.into(), 0.1.into()).into(); "Fsim")]
+#[test_case(test_roqoqo_1_8::operations::SpinInteraction::new(0,1, 0.1.into(), 0.1.into(), 0.1.into()).into(); "SpinInteraction")]
+#[test_case(test_roqoqo_1_8::operations::Bogoliubov::new(0,1, 0.1.into(), 0.1.into()).into(); "Bogoliubov")]
+#[test_case(test_roqoqo_1_8::operations::PMInteraction::new(0,1, 0.1.into()).into(); "PMInteraction")]
+#[test_case(test_roqoqo_1_8::operations::ComplexPMInteraction::new(0,1, 0.1.into(), 0.1.into()).into(); "ComplexPMInteraction")]
+#[test_case(test_roqoqo_1_8::operations::PhaseShiftedControlledZ::new(0,1, 1.0.into()).into(); "PhaseShiftedControlledZ")]
+#[test_case(test_roqoqo_1_8::operations::PhaseShiftState1::new(0, 1.0.into()).into(); "PhaseShiftState1")]
+#[test_case(test_roqoqo_1_8::operations::PhaseShiftState0::new(0, 1.0.into()).into(); "PhaseShiftState0")]
+#[test_case(test_roqoqo_1_8::operations::MultiQubitMS::new(vec![0,2,3], 1.0.into()).into(); "MultiQubitMS")]
+#[test_case(test_roqoqo_1_8::operations::MultiQubitZZ::new(vec![0,2,3], 1.0.into()).into(); "MultiQubitZZ")]
+// 1.1 and 1.2
+#[test_case(test_roqoqo_1_8::operations::InputBit::new("input".to_string(), 1, true).into(); "InputBit")]
+#[test_case(test_roqoqo_1_8::operations::PragmaLoop::new(2.0.into(), test_roqoqo_1_8::Circuit::new()).into(); "PragmaLoop")]
+#[test_case(test_roqoqo_1_8::operations::PhaseShiftedControlledPhase::new(0,1, 1.0.into(), 1.0.into()).into(); "PhaseShiftedControlledPhase")]
+// 1.3
+#[test_case(test_roqoqo_1_8::operations::ControlledRotateX::new(0,1, 1.0.into()).into(); "ControlledRotateX")]
+#[test_case(test_roqoqo_1_8::operations::ControlledRotateXY::new(0,1, 1.0.into(), 1.0.into()).into(); "ControlledRotateXY")]
+#[test_case(test_roqoqo_1_8::operations::ControlledControlledPauliZ::new(0,1,2).into(); "ControlledControlledPauliZ")]
+#[test_case(test_roqoqo_1_8::operations::ControlledControlledPhaseShift::new(0,1,2, 1.0.into()).into(); "ControlledControlledPhaseShift")]
+#[test_case(test_roqoqo_1_8::operations::Toffoli::new(0,1,2).into(); "Toffoli")]
+// 1.4
+#[test_case(test_roqoqo_1_8::operations::GPi::new(0, 0.1.into()).into(); "GPi")]
+#[test_case(test_roqoqo_1_8::operations::GPi2::new(0, 0.1.into()).into(); "GPi2")]
+// 1.5
+#[test_case(test_roqoqo_1_8::operations::PragmaControlledCircuit::new(0, test_roqoqo_1_8::Circuit::new()).into(); "PragmaControlledCircuit")]
+// Operations from 1.6
+#[test_case(test_roqoqo_1_8::operations::Squeezing::new(0, 0.1.into(), 0.1.into()).into(); "Squeezing")]
+#[test_case(test_roqoqo_1_8::operations::PhaseShift::new(0, 0.1.into()).into(); "PhaseShift")]
+#[test_case(test_roqoqo_1_8::operations::BeamSplitter::new(0, 1, 0.1.into(), 0.2.into()).into(); "BeamSplitter")]
+#[test_case(test_roqoqo_1_8::operations::PhotonDetection::new(0, "ro".into(), 0).into(); "PhotonDetection")]
+// Operations from 1.7
+#[test_case(test_roqoqo_1_8::operations::Identity::new(0).into(); "Identity")]
+// Operations from 1.8
+#[test_case(test_roqoqo_1_8::operations::PhaseDisplacement::new(0, 0.1.into(), 0.1.into()).into(); "PhaseDisplacement")]
+#[test_case(test_roqoqo_1_8::operations::EchoCrossResonance::new(0, 1).into(); "EchoCrossResonance")]
+#[test_case(test_roqoqo_1_8::operations::PragmaAnnotatedOp::new(test_roqoqo_1_8::operations::PauliX::new(0).into(), "test".to_string()).into(); "PragmaAnnotatedOp")]
+// Operations from 1.9 - uncomment for next unittests
+fn test_bincode_compatibility_1_8(operation: test_roqoqo_1_8::operations::Operation) {
+    let mut test_circuit = test_roqoqo_1_8::Circuit::new();
+    test_circuit += operation;
+
+    let test_measurement_input = test_roqoqo_1_8::measurements::PauliZProductInput::new(3, false);
+    let test_measurement = test_roqoqo_1_8::measurements::PauliZProduct {
+        constant_circuit: Some(test_circuit.clone()),
+        circuits: vec![test_circuit],
+        input: test_measurement_input,
+    };
+    let test_program = test_roqoqo_1_8::QuantumProgram::PauliZProduct {
+        measurement: test_measurement,
+        input_parameter_names: vec!["test".to_string()],
+    };
+    let test_serialisation: Vec<u8> = bincode::serialize(&test_program).unwrap();
+
+    let _test_deserialisation: roqoqo::QuantumProgram =
+        bincode::deserialize(&test_serialisation).unwrap();
+}
+
+#[test]
+fn test_device_compat() {
+    let test_device = test_roqoqo_1_8::devices::AllToAllDevice::new(
+        3,
+        &["RotateZ".to_string()],
+        &["CNOT".to_string()],
+        1.0,
+    );
+    let test_serialisation: Vec<u8> = bincode::serialize(&test_device).unwrap();
+
+    let test_deserialisation: roqoqo::devices::AllToAllDevice =
+        bincode::deserialize(&test_serialisation).unwrap();
+
+    let comparsion_device = roqoqo::devices::AllToAllDevice::new(
+        3,
+        &["RotateZ".to_string()],
+        &["CNOT".to_string()],
+        1.0,
+    );
+    assert_eq!(test_deserialisation, comparsion_device);
+}
diff --git a/.compatibility_tests/compatibility_test_1_8/tests/integration/main.rs b/.compatibility_tests/compatibility_test_1_8/tests/integration/main.rs
new file mode 100644
index 00000000..b86a751b
--- /dev/null
+++ b/.compatibility_tests/compatibility_test_1_8/tests/integration/main.rs
@@ -0,0 +1,13 @@
+// Copyright © 2021-2023 HQS Quantum Simulations GmbH. All Rights Reserved.
+//
+// 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.
+#[cfg(test)]
+mod compatibility_1_8;
diff --git a/.compatibility_tests/compatibility_test_sim/Cargo.toml b/.compatibility_tests/compatibility_test_sim/Cargo.toml
index 75232213..8af75a8e 100644
--- a/.compatibility_tests/compatibility_test_sim/Cargo.toml
+++ b/.compatibility_tests/compatibility_test_sim/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "compatibility_test_sim"
-version = "1.8.0"
+version = "1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 license = "Apache-2.0"
 edition = "2021"
diff --git a/.github/workflows/compatibility_tests.yml b/.github/workflows/compatibility_tests.yml
index b812a697..636d28b7 100644
--- a/.github/workflows/compatibility_tests.yml
+++ b/.github/workflows/compatibility_tests.yml
@@ -113,6 +113,21 @@ jobs:
           cd ./.compatibility_tests/compatibility_test_1_7/
           cargo test
   
+  unittests_check_compatibility_1_8:
+    name: unittests_check-compatibility-1-8
+    runs-on: "ubuntu-latest"
+    steps:
+      - uses: actions/checkout@v3
+      - uses: actions-rs/toolchain@v1
+        with:
+          profile: minimal
+          toolchain: stable
+          default: true
+      - uses: Swatinem/rust-cache@v2
+      - run: |
+          cd ./.compatibility_tests/compatibility_test_1_8/
+          cargo test
+  
   unittests_check_circuit_decompositions:
     name: unittests_check_circuit_decompositions
     runs-on: "ubuntu-latest"
diff --git a/qoqo/tests/integration/devices.rs b/qoqo/tests/integration/devices.rs
index 6b929399..8b65b2cd 100644
--- a/qoqo/tests/integration/devices.rs
+++ b/qoqo/tests/integration/devices.rs
@@ -681,3 +681,232 @@ fn test_edges(device: Py<PyAny>, test_edges: Vec<(usize, usize)>) {
         }
     })
 }
+
+#[cfg(feature = "unstable_chain_with_environment")]
+mod test_chain_with_environment {
+    use std::collections::HashMap;
+
+    use super::*;
+    use qoqo::devices::ChainWithEnvironmentCapsule;
+    use roqoqo::devices::{ChainWithEnvironmentDevice, Device};
+    use roqoqo::RoqoqoError;
+    #[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
+    struct TestDevice;
+    use bincode::{deserialize, serialize};
+    use ndarray::Array2;
+    use numpy::{PyArray2, PyReadonlyArray2, ToPyArray};
+    use pyo3::exceptions::{PyTypeError, PyValueError};
+    use pyo3::types::PyByteArray;
+    use qoqo_macros::devicewrapper;
+
+    /// Dummy implementation only for testing ChainWithEnvironment trait
+    impl Device for TestDevice {
+        fn single_qubit_gate_time(&self, _hqslang: &str, _qubit: &usize) -> Option<f64> {
+            None
+        }
+
+        fn two_qubit_gate_time(
+            &self,
+            _hqslang: &str,
+            _control: &usize,
+            _target: &usize,
+        ) -> Option<f64> {
+            None
+        }
+
+        fn three_qubit_gate_time(
+            &self,
+            _hqslang: &str,
+            _control_0: &usize,
+            _control_1: &usize,
+            _target: &usize,
+        ) -> Option<f64> {
+            None
+        }
+
+        fn multi_qubit_gate_time(&self, _hqslang: &str, _qubits: &[usize]) -> Option<f64> {
+            None
+        }
+
+        fn qubit_decoherence_rates(&self, _qubit: &usize) -> Option<Array2<f64>> {
+            None
+        }
+
+        fn number_qubits(&self) -> usize {
+            0
+        }
+
+        fn two_qubit_edges(&self) -> Vec<(usize, usize)> {
+            vec![]
+        }
+
+        fn to_generic_device(&self) -> GenericDevice {
+            GenericDevice::default()
+        }
+    }
+
+    impl TestDevice {
+        pub fn set_single_qubit_gate_time(
+            &mut self,
+            _gate: &str,
+            _qubit: usize,
+            _gate_time: f64,
+        ) -> Result<(), RoqoqoError> {
+            Ok(())
+        }
+
+        pub fn set_two_qubit_gate_time(
+            &mut self,
+            _gate: &str,
+            _control: usize,
+            _target: usize,
+            _gate_time: f64,
+        ) -> Result<(), RoqoqoError> {
+            Ok(())
+        }
+
+        pub fn set_three_qubit_gate_time(
+            &mut self,
+            _gate: &str,
+            _control_0: usize,
+            _control_1: usize,
+            _target: usize,
+            _gate_time: f64,
+        ) -> Result<(), RoqoqoError> {
+            Ok(())
+        }
+
+        pub fn set_multi_qubit_gate_time(
+            &mut self,
+            _gate: &str,
+            _qubits: Vec<usize>,
+            _gate_time: f64,
+        ) -> Result<(), RoqoqoError> {
+            Ok(())
+        }
+
+        pub fn set_qubit_decoherence_rates(
+            &mut self,
+            _qubit: usize,
+            _rates: Array2<f64>,
+        ) -> Result<(), RoqoqoError> {
+            Ok(())
+        }
+
+        pub fn add_damping(&mut self, _qubit: usize, _damping: f64) -> Result<(), RoqoqoError> {
+            Ok(())
+        }
+
+        pub fn add_dephasing(&mut self, _qubit: usize, _dephasing: f64) -> Result<(), RoqoqoError> {
+            Ok(())
+        }
+
+        pub fn add_depolarising(
+            &mut self,
+            _qubit: usize,
+            _depolarising: f64,
+        ) -> Result<(), RoqoqoError> {
+            Ok(())
+        }
+    }
+
+    impl ChainWithEnvironmentDevice for TestDevice {
+        fn environment_chains(&self) -> Vec<roqoqo::devices::ChainAndEnvironment> {
+            // Use device
+            // ```
+            // 0 - 3 - 6
+            // |   |   |
+            // 1 - 4 - 7
+            // |   |
+            // 2 - 5
+            // ```
+            let mut new_chains: Vec<(Vec<usize>, HashMap<usize, Vec<usize>>)> = Vec::new();
+            new_chains.push((vec![4], HashMap::from([(4, vec![1, 3, 5, 7])])));
+            new_chains.push((
+                vec![3, 4],
+                HashMap::from([(3, vec![0, 6]), (4, vec![1, 5, 7])]),
+            ));
+            new_chains.push((
+                vec![0, 1, 4, 3],
+                HashMap::from([(1, vec![2]), (3, vec![6]), (4, vec![5, 7])]),
+            ));
+            new_chains.push((
+                vec![0, 1, 2, 5, 4, 3],
+                HashMap::from([(4, vec![7]), (3, vec![7])]),
+            ));
+            new_chains
+        }
+    }
+
+    #[pyclass(name = "TestDevice", module = "devices")]
+    #[derive(Clone, Debug, PartialEq)]
+    pub struct TestDeviceWrapper {
+        internal: TestDevice,
+    }
+
+    #[devicewrapper(ChainWithEnvironment)]
+    impl TestDeviceWrapper {
+        #[new]
+        pub fn new() -> PyResult<Self> {
+            Ok(Self {
+                internal: TestDevice,
+            })
+        }
+    }
+
+    impl TestDeviceWrapper {
+        /// Fallible conversion of generic python object..
+        fn from_pyany(input: Py<PyAny>) -> PyResult<TestDevice> {
+            Python::with_gil(|py| -> PyResult<TestDevice> {
+                let input = input.as_ref(py);
+                if let Ok(try_downcast) = input.extract::<TestDeviceWrapper>() {
+                    Ok(try_downcast.internal)
+                } else {
+                    panic!()
+                }
+            })
+        }
+    }
+
+    #[test]
+    fn test_chain_with_environment() {
+        pyo3::prepare_freethreaded_python();
+        let test_device = Python::with_gil(|py| -> Py<PyAny> {
+            let device_type = py.get_type::<TestDeviceWrapper>();
+            device_type.call0().unwrap().into()
+        });
+        Python::with_gil(|py| {
+            let __implements_environment_with_chains =
+                test_device.call_method0(py, "__implements_environment_chains");
+            assert!(__implements_environment_with_chains.is_ok());
+            let __implements_environment_with_chains = __implements_environment_with_chains
+                .unwrap()
+                .extract::<bool>(py)
+                .unwrap();
+            assert_eq!(__implements_environment_with_chains, true);
+            let chains_with_environment = test_device
+                .call_method0(py, "__environment_chains")
+                .unwrap();
+            let chains_with_environment = chains_with_environment
+                .extract::<Vec<(Vec<usize>, HashMap<usize, Vec<usize>>)>>(py)
+                .unwrap();
+            let simple_test_device = TestDevice;
+            let comparison = simple_test_device.environment_chains();
+            assert_eq!(chains_with_environment, comparison);
+        })
+    }
+
+    #[test]
+    fn test_chain_with_environment_capsule() {
+        pyo3::prepare_freethreaded_python();
+        let test_device = Python::with_gil(|py| -> Py<PyAny> {
+            let device_type = py.get_type::<TestDeviceWrapper>();
+            device_type.call0().unwrap().into()
+        });
+        let device_capsule = ChainWithEnvironmentCapsule::new(test_device).unwrap();
+        let chains_with_environment = device_capsule.environment_chains();
+        let simple_test_device = TestDevice;
+        let comparison = simple_test_device.environment_chains();
+        assert_eq!(chains_with_environment, comparison);
+    }
+}
diff --git a/roqoqo-test/Cargo.toml b/roqoqo-test/Cargo.toml
index 56fa0bd0..4bf4a219 100644
--- a/roqoqo-test/Cargo.toml
+++ b/roqoqo-test/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "roqoqo-test"
-version = "1.8.0"
+version = "1.9.0"
 authors = ["HQS Quantum Simulations <info@quantumsimulations.de>"]
 license = "Apache-2.0"
 edition = "2021"
@@ -19,7 +19,7 @@ crate-type = ["rlib"]
 
 [dependencies]
 qoqo_calculator = { version="1.1" }
-roqoqo = {version="1.8", path="../roqoqo", features=["serialize"]}
+roqoqo = {version="1.9", path="../roqoqo", features=["serialize"]}
 rand = "0.8"
 nalgebra = "0.32"
 ndarray = { version = "0.15" }