diff --git a/Cargo.lock b/Cargo.lock index 330f6093..09be6353 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,6 +79,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + [[package]] name = "cfg-if" version = "1.0.0" @@ -183,9 +189,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -193,9 +199,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -204,34 +210,34 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.7.1", + "memoffset 0.8.0", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" dependencies = [ "cfg-if", ] [[package]] name = "ctor" -version = "0.1.26" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +checksum = "dd4056f63fce3b82d852c3da92b08ea59959890813a7f4ce9c0ff85b10cf301b" dependencies = [ - "quote 1.0.23", - "syn 1.0.108", + "quote 1.0.26", + "syn 2.0.13", ] [[package]] @@ -252,6 +258,27 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -275,9 +302,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -290,9 +317,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -300,15 +327,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -317,32 +344,32 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.108", + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 2.0.13", ] [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-timer" @@ -352,9 +379,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -370,9 +397,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "libc", @@ -381,13 +408,13 @@ dependencies = [ [[package]] name = "ghost" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41973d4c45f7a35af8753ba3457cc99d406d863941fd7f52663cff54a5ab99b3" +checksum = "e77ac7b51b8e6313251737fcef4b1c01a2ea102bde68415b62c0ee9268fec357" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.108", + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 2.0.13", ] [[package]] @@ -426,11 +453,17 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown", @@ -444,9 +477,9 @@ checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" [[package]] name = "insta" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea5b3894afe466b4bcf0388630fc15e11938a6074af0cd637c825ba2ec8a099" +checksum = "9a28d25139df397cbca21408bb742cf6837e04cdbebf1b07b760caf971d6a972" dependencies = [ "console", "lazy_static", @@ -466,14 +499,25 @@ dependencies = [ [[package]] name = "inventory" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16fe3b35d64bd1f72917f06425e7573a2f63f74f42c8f56e53ea6826dde3a2b5" +checksum = "7741301a6d6a9b28ce77c0fb77a4eb116b6bc8f3bef09923f7743d059c4157d3" dependencies = [ "ctor", "ghost", ] +[[package]] +name = "io-lifetimes" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -485,9 +529,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "js-sys" @@ -579,9 +623,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.139" +version = "0.2.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" [[package]] name = "libm" @@ -595,6 +639,12 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linux-raw-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" + [[package]] name = "lock_api" version = "0.4.9" @@ -631,9 +681,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ "autocfg", ] @@ -708,9 +758,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "parking_lot" @@ -730,16 +780,16 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "windows-sys 0.45.0", ] [[package]] name = "paste" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" [[package]] name = "petgraph" @@ -808,9 +858,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -892,10 +942,10 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94144a1266e236b1c932682136dc35a9dee8d3589728f68130c7c3861ef96b28" dependencies = [ - "proc-macro2 1.0.51", + "proc-macro2 1.0.56", "pyo3-macros-backend", - "quote 1.0.23", - "syn 1.0.108", + "quote 1.0.26", + "syn 1.0.109", ] [[package]] @@ -904,9 +954,9 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8df9be978a2d2f0cdebabb03206ed73b11314701a5bfe71b0d753b81997777f" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.108", + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 1.0.109", ] [[package]] @@ -966,11 +1016,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ - "proc-macro2 1.0.51", + "proc-macro2 1.0.56", ] [[package]] @@ -1014,9 +1064,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ "either", "rayon-core", @@ -1024,9 +1074,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -1043,11 +1093,20 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "regex" -version = "1.7.1" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -1056,18 +1115,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "rigetti-pyo3" @@ -1101,10 +1151,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5015e68a0685a95ade3eee617ff7101ab6a3fc689203101ca16ebc16f2b89c66" dependencies = [ "cfg-if", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.56", + "quote 1.0.26", "rustc_version", - "syn 1.0.108", + "syn 1.0.109", ] [[package]] @@ -1116,11 +1166,25 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.37.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" [[package]] name = "rusty-fork" @@ -1136,9 +1200,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "same-file" @@ -1157,35 +1221,35 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "semver" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.108", + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 2.0.13", ] [[package]] name = "serde_json" -version = "1.0.93" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" dependencies = [ "itoa", "ryu", @@ -1235,10 +1299,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck", - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.56", + "quote 1.0.26", "rustversion", - "syn 1.0.108", + "syn 1.0.109", ] [[package]] @@ -1254,12 +1318,23 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.108" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2 1.0.56", + "quote 1.0.26", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56e159d99e6c2b93995d171050271edb50ecc5288fbc7cc17de8fdce4e58c14" +checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", + "proc-macro2 1.0.56", + "quote 1.0.26", "unicode-ident", ] @@ -1271,16 +1346,15 @@ checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5" [[package]] name = "tempfile" -version = "3.3.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if", "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.45.0", ] [[package]] @@ -1291,29 +1365,29 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.108", + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 2.0.13", ] [[package]] name = "time" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53250a3b3fed8ff8fd988587d8925d26a83ac3845d9e03b220b37f34c2b8d6c2" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" dependencies = [ "serde", "time-core", @@ -1343,9 +1417,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-xid" @@ -1370,12 +1444,11 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -1404,9 +1477,9 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.108", + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -1416,7 +1489,7 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ - "quote 1.0.23", + "quote 1.0.26", "wasm-bindgen-macro-support", ] @@ -1426,9 +1499,9 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ - "proc-macro2 1.0.51", - "quote 1.0.23", - "syn 1.0.108", + "proc-macro2 1.0.56", + "quote 1.0.26", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1486,13 +1559,13 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -1501,65 +1574,131 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "yaml-rust" diff --git a/deny.toml b/deny.toml index e89660a5..e92ba44a 100644 --- a/deny.toml +++ b/deny.toml @@ -24,16 +24,14 @@ yanked = "deny" notice = "deny" # A list of advisory IDs to ignore. Note that ignored advisories will still # output a note when they are encountered. -ignore = [ - "RUSTSEC-2023-0018" # remove_dir_all is used by proptest, a dev dependency -] +ignore = [] # This section is considered when running `cargo deny check licenses` # More documentation for the licenses section can be found here: # https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html [licenses] unlicensed = "deny" -allow = ["Apache-2.0", "Apache-2.0 WITH LLVM-exception", "BSD-2-Clause", "BSD-3-Clause", "MIT", "Unicode-DFS-2016"] +allow = ["Apache-2.0", "Apache-2.0 WITH LLVM-exception", "BSD-3-Clause", "MIT", "Unicode-DFS-2016"] # List of explictly disallowed licenses # See https://spdx.org/licenses/ for list of possible licenses # [possible values: any SPDX 3.11 short identifier (+ optional exception)]. @@ -74,9 +72,10 @@ skip-tree = [ { name = "syn", version = "*", depth = 5 }, # Used in both serde_derive and proptest-derive { name = "quick-error", version = "*" }, # proptest relies on two versions of this { name = "itoa", version = "*" }, # various dependencies rely on two versions of this - { name = "hermit-abi", version = "*" }, # various dependencies rely on two versions of this - { name = "memoffset", version = "*" }, # various dependencies rely on two versions of this - { name = "windows-sys", version = "*" }, # various dependencies rely on two versions of this + { name = "hermit-abi", version = "*" }, # various dependencies rely on two versions of this + { name = "memoffset", version = "*" }, # various dependencies rely on two versions of this + { name = "windows-sys", version = "*" }, # various dependencies rely on two versions of this + { name = "redox_syscall", version = "*" }, # proptest and pyo3 rely on two versions of this ] # This section is considered when running `cargo deny check sources`. diff --git a/quil-py/quil/program/__init__.pyi b/quil-py/quil/program/__init__.pyi index 6ad03063..0591960f 100644 --- a/quil-py/quil/program/__init__.pyi +++ b/quil-py/quil/program/__init__.pyi @@ -83,8 +83,7 @@ class Program: Parses the given Quil string and returns a new ``Program``. Raises a ``ProgramError`` if the given string isn't valid Quil. """ - def to_instructions(self, include_headers: bool) -> List[Instruction]: ... - def to_headers(self) -> List[Instruction]: ... + def to_instructions(self) -> List[Instruction]: ... @final class CalibrationSet: diff --git a/quil-py/src/program/mod.rs b/quil-py/src/program/mod.rs index cc8f1a2c..d109a468 100644 --- a/quil-py/src/program/mod.rs +++ b/quil-py/src/program/mod.rs @@ -93,7 +93,7 @@ impl PyProgram { // declarations and simplify this? pub fn declarations(&self, py: Python<'_>) -> PyResult> { self.as_inner() - .to_instructions(true) + .to_instructions() .iter() .filter_map(|inst| match inst { Instruction::Declaration(declaration) => Some(declaration), @@ -106,7 +106,7 @@ impl PyProgram { #[getter] pub fn defined_gates(&self, py: Python<'_>) -> PyResult> { self.as_inner() - .to_instructions(true) + .to_instructions() .iter() .filter_map(|inst| match inst { Instruction::GateDefinition(gate_def) => Some(gate_def.to_python(py)), @@ -156,28 +156,16 @@ impl PyProgram { .add_instructions(instructions.into_iter().map(Into::into).collect()) } - pub fn to_instructions( - &self, - include_headers: bool, - py: Python<'_>, - ) -> PyResult> { + pub fn to_instructions(&self, py: Python<'_>) -> PyResult> { self.as_inner() - .to_instructions(include_headers) + .to_instructions() .iter() .map(|i| i.to_python(py)) .collect() } - pub fn to_headers(&self, py: Python<'_>) -> PyResult> { - self.as_inner() - .to_headers() - .iter() - .map(|h| h.to_python(py)) - .collect() - } - pub fn __str__(&self) -> String { - self.as_inner().to_string(true) + self.as_inner().to_string() } pub fn __add__(&self, py: Python<'_>, rhs: Self) -> PyResult { @@ -197,7 +185,7 @@ impl PyProgram { // nor be reliably serialized by something like serde using the current // quil-rs data model. pub fn __getstate__<'a>(&self, py: Python<'a>) -> &'a PyBytes { - PyBytes::new(py, self.as_inner().to_string(true).as_bytes()) + PyBytes::new(py, self.as_inner().to_string().as_bytes()) } pub fn __setstate__(&mut self, py: Python<'_>, state: &PyBytes) -> PyResult<()> { diff --git a/quil-rs/src/instruction/calibration.rs b/quil-rs/src/instruction/calibration.rs index 4b9c90e0..7bfc6362 100644 --- a/quil-rs/src/instruction/calibration.rs +++ b/quil-rs/src/instruction/calibration.rs @@ -2,12 +2,14 @@ use std::fmt; use crate::{ instruction::{ - format_instructions, format_qubits, get_expression_parameter_string, Expression, - GateModifier, Instruction, Qubit, + format_instructions, get_expression_parameter_string, Expression, GateModifier, + Instruction, Qubit, }, validation::identifier::{validate_identifier, IdentifierValidationError}, }; +use super::write_qubit_parameters; + #[derive(Clone, Debug, Default, PartialEq)] pub struct Calibration { pub instructions: Vec, @@ -44,13 +46,9 @@ impl Calibration { impl fmt::Display for Calibration { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let parameter_str = get_expression_parameter_string(&self.parameters); - write!( - f, - "DEFCAL {}{} {}:", - self.name, - parameter_str, - format_qubits(&self.qubits) - )?; + write!(f, "DEFCAL {}{}", self.name, parameter_str)?; + write_qubit_parameters(f, &self.qubits)?; + write!(f, ":")?; for instruction in &self.instructions { write!(f, "\n\t{instruction}")?; } diff --git a/quil-rs/src/instruction/mod.rs b/quil-rs/src/instruction/mod.rs index 1dffd720..e9cee839 100644 --- a/quil-rs/src/instruction/mod.rs +++ b/quil-rs/src/instruction/mod.rs @@ -410,6 +410,18 @@ pub fn format_qubits(qubits: &[Qubit]) -> String { .join(" ") } +/// Format qubits as a Quil parameter list, where each variable qubit must be prefixed with a `%`. +fn write_qubit_parameters(f: &mut fmt::Formatter, qubits: &[Qubit]) -> fmt::Result { + for qubit in qubits.iter() { + match qubit { + Qubit::Fixed(index) => write!(f, " {index}")?, + Qubit::Variable(var) => write!(f, " %{var}")?, + } + } + + Ok(()) +} + pub fn get_expression_parameter_string(parameters: &[Expression]) -> String { if parameters.is_empty() { return String::new(); @@ -662,7 +674,7 @@ impl Instruction { /// /// /// let program = Program::from_str("SHIFT-PHASE 0 \"rf\" 2*2").unwrap(); - /// let mut instructions = program.to_instructions(true); + /// let mut instructions = program.to_instructions(); /// instructions.iter_mut().for_each(|inst| inst.apply_to_expressions(Expression::simplify)); /// /// assert_eq!(instructions[0].to_string(), String::from("SHIFT-PHASE 0 \"rf\" 4")) diff --git a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__DECLARE ro BIT[1].snap b/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__DECLARE ro BIT[1].snap deleted file mode 100644 index 71b86454..00000000 --- a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__DECLARE ro BIT[1].snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: quil-rs/src/instruction/declaration.rs -expression: test_name ---- -Basic Declaration diff --git a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__DECLARE ro INTEGER[2] SHARING foo.snap b/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__DECLARE ro INTEGER[2] SHARING foo.snap deleted file mode 100644 index 11fdbb7b..00000000 --- a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__DECLARE ro INTEGER[2] SHARING foo.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: quil-rs/src/instruction/declaration.rs -expression: test_name ---- -Shared Declaration diff --git a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__DECLARE ro REAL[3] SHARING bar OFFSET 4 BIT 5 BIT.snap b/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__DECLARE ro REAL[3] SHARING bar OFFSET 4 BIT 5 BIT.snap deleted file mode 100644 index 2a2208b3..00000000 --- a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__DECLARE ro REAL[3] SHARING bar OFFSET 4 BIT 5 BIT.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: quil-rs/src/instruction/declaration.rs -expression: test_name ---- -Shared Declaration with Offset diff --git a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display-2.snap b/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display-2.snap deleted file mode 100644 index 70379081..00000000 --- a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display-2.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: quil-rs/src/instruction/declaration.rs -description: Shared Declaration -expression: declaration.to_string() ---- -DECLARE ro INTEGER[2] SHARING foo diff --git a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display-3.snap b/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display-3.snap deleted file mode 100644 index 0bf0d20e..00000000 --- a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display-3.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: quil-rs/src/instruction/declaration.rs -description: Basic Declaration -expression: declaration.to_string() ---- -DECLARE ro BIT[1] diff --git a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display.snap b/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display.snap deleted file mode 100644 index 3aeecf42..00000000 --- a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: quil-rs/src/instruction/declaration.rs -description: Shared Declaration with Offsets -expression: declaration.to_string() ---- -DECLARE ro REAL[3] SHARING bar OFFSET 4 BIT 5 BIT diff --git a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display@basic-declaration.snap b/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display@basic-declaration.snap deleted file mode 100644 index bc0cba7f..00000000 --- a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display@basic-declaration.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: quil-rs/src/instruction/declaration.rs -expression: declaration.to_string() ---- -DECLARE ro BIT[1] diff --git a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display@declaration-with-shared-region-and-offsets.snap b/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display@declaration-with-shared-region-and-offsets.snap deleted file mode 100644 index 949915ce..00000000 --- a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display@declaration-with-shared-region-and-offsets.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: quil-rs/src/instruction/declaration.rs -expression: declaration.to_string() ---- -DECLARE ro REAL[3] SHARING bar OFFSET 4 BIT 5 BIT diff --git a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display@declaration-with-shared-region.snap b/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display@declaration-with-shared-region.snap deleted file mode 100644 index 08b79e1a..00000000 --- a/quil-rs/src/instruction/snapshots/quil_rs__instruction__declaration__test_declaration__display@declaration-with-shared-region.snap +++ /dev/null @@ -1,5 +0,0 @@ ---- -source: quil-rs/src/instruction/declaration.rs -expression: declaration.to_string() ---- -DECLARE ro INTEGER[2] SHARING foo diff --git a/quil-rs/src/parser/instruction.rs b/quil-rs/src/parser/instruction.rs index 9a511e2d..81fe9f01 100644 --- a/quil-rs/src/parser/instruction.rs +++ b/quil-rs/src/parser/instruction.rs @@ -1007,10 +1007,9 @@ mod tests { for input in inputs { let program = Program::from_str(input).unwrap(); - let output = program.to_string(true); + let output = program.to_string(); let roundtrip = Program::from_str(&output).unwrap(); - - assert_eq!(program, roundtrip); + assert_eq!(output, roundtrip.to_string()); } } } diff --git a/quil-rs/src/program/calibration.rs b/quil-rs/src/program/calibration.rs index f81d0d09..beb435ee 100644 --- a/quil-rs/src/program/calibration.rs +++ b/quil-rs/src/program/calibration.rs @@ -354,78 +354,70 @@ mod tests { use crate::program::Program; - #[test] - fn expansion() { - struct TestCase<'a> { - input: &'a str, - expected: &'a str, - } - - let cases = vec![ - // Test match ordering/precedence - TestCase { - input: concat!( - "DEFCAL RX(%theta) %qubit:\n", - " PULSE 1 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", - "DEFCAL RX(%theta) 0:\n", - " PULSE 2 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", - "DEFCAL RX(pi/2) 0:\n", - " PULSE 3 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", - "RX(pi/2) 1\n", - "RX(pi) 0\n", - "RX(pi/2) 0\n" - ), - expected: concat!( - "PULSE 1 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", - "PULSE 2 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", - "PULSE 3 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n" - ), - }, - TestCase { - input: concat!( - "DEFCAL X 0:\n", - " PULSE 0 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", - "X 0\n" - ), - expected: "PULSE 0 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", - }, - TestCase { - input: concat!( - "DEFCAL X 0:\n", - " Y 0\n", - "DEFCAL Y 0:\n", - " PULSE 0 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", - "X 0\n" - ), - expected: "PULSE 0 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", - }, - TestCase { - input: concat!( - "DEFCAL MEASURE 0 addr:\n", - " PRAGMA INCORRECT_ORDERING\n", - "DEFCAL MEASURE 0 addr:\n", - " PRAGMA CORRECT\n", - "DEFCAL MEASURE q addr:\n", - " PRAGMA CORRECT\n", - "DEFCAL MEASURE 1 addr:\n", - " PRAGMA INCORRECT_QUBIT\n", - "DEFCAL MEASURE addr:\n", - " PRAGMA INCORRECT_PRECEDENCE\n", - "MEASURE 0 ro\n" - ), - expected: "PRAGMA CORRECT\n", - }, - TestCase { - input: concat!("DEFCAL I q:\n", " DELAY q 4e-8\n", "I 0\n",), - expected: "DELAY 0 4e-8\n", - }, - ]; - - for case in &cases { - let program = Program::from_str(case.input).unwrap(); - let calibrated_program = program.expand_calibrations().unwrap(); - assert_eq!(calibrated_program.to_string(false).as_str(), case.expected); - } + use insta::assert_snapshot; + use rstest::rstest; + + #[rstest] + #[case( + "Calibration-Param-Precedence", + concat!( + "DEFCAL RX(%theta) %qubit:\n", + " PULSE 1 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", + "DEFCAL RX(%theta) 0:\n", + " PULSE 2 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", + "DEFCAL RX(pi/2) 0:\n", + " PULSE 3 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", + "RX(pi/2) 1\n", + "RX(pi) 0\n", + "RX(pi/2) 0\n" + ), + )] + #[case( + "Calibration-Simple", + concat!( + "DEFCAL X 0:\n", + " PULSE 0 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", + "X 0\n", + ), + )] + #[case( + "Calibration-Instruction-Match", + concat!( + "DEFCAL X 0:\n", + " Y 0\n", + "DEFCAL Y 0:\n", + " PULSE 0 \"xy\" gaussian(duration: 1, fwhm: 2, t0: 3)\n", + "X 0\n" + ), + )] + #[case( + "Measure-Calibration", + concat!( + "DEFCAL MEASURE 0 addr:\n", + " PRAGMA INCORRECT_ORDERING\n", + "DEFCAL MEASURE 0 addr:\n", + " PRAGMA CORRECT\n", + "DEFCAL MEASURE q addr:\n", + " PRAGMA CORRECT\n", + "DEFCAL MEASURE 1 addr:\n", + " PRAGMA INCORRECT_QUBIT\n", + "DEFCAL MEASURE addr:\n", + " PRAGMA INCORRECT_PRECEDENCE\n", + "MEASURE 0 ro\n" + ), + )] + #[case( + "Calibration-Variable-Qubit", + concat!("DEFCAL I %q:\n", " DELAY q 4e-8\n", "I 0\n",), + )] + fn test_expansion(#[case] description: &str, #[case] input: &str) { + let program = Program::from_str(input).unwrap(); + let calibrated_program = program.expand_calibrations().unwrap(); + insta::with_settings!({ + snapshot_suffix => description, + }, { + assert_snapshot!(calibrated_program.to_string()) + }) } #[test] diff --git a/quil-rs/src/program/graph.rs b/quil-rs/src/program/graph.rs index 9192412f..7fe36eaa 100644 --- a/quil-rs/src/program/graph.rs +++ b/quil-rs/src/program/graph.rs @@ -510,7 +510,7 @@ impl ScheduledProgram { let mut working_instructions: Vec = vec![]; let mut blocks = IndexMap::new(); - let instructions = program.to_instructions(false); + let instructions = program.to_instructions(); for (index, instruction) in instructions.into_iter().enumerate() { let instruction_index = Some(index); diff --git a/quil-rs/src/program/mod.rs b/quil-rs/src/program/mod.rs index 9ba1e892..3ecd9f8d 100644 --- a/quil-rs/src/program/mod.rs +++ b/quil-rs/src/program/mod.rs @@ -13,6 +13,7 @@ // limitations under the License. use std::collections::{BTreeMap, HashSet}; +use std::fmt; use std::ops; use std::str::FromStr; @@ -121,7 +122,7 @@ impl Program { /// /// Errors if any of the instructions in the program are not [`Instruction::Gate`] pub fn dagger(&self) -> Result { - self.to_instructions(true).into_iter().try_rfold( + self.to_instructions().into_iter().try_rfold( Program::new(), |mut new_program, instruction| match instruction { Instruction::Gate(gate) => { @@ -250,43 +251,40 @@ impl Program { Ok(expanded_program) } - pub fn to_instructions(&self, include_headers: bool) -> Vec { - let mut result = vec![]; + pub fn to_instructions(&self) -> Vec { + let capacity = self.memory_regions.len() + + self.frames.len() + + self.waveforms.len() + + self.instructions.len(); - if include_headers { - result.extend(self.to_headers()) - } - - result.extend(self.instructions.clone()); + let mut instructions: Vec = Vec::with_capacity(capacity); - result - } - - pub fn to_headers(&self) -> Vec { - let mut result = vec![]; - result.extend(self.memory_regions.iter().map(|(name, descriptor)| { + instructions.extend(self.memory_regions.iter().map(|(name, descriptor)| { Instruction::Declaration(Declaration { name: name.clone(), size: descriptor.size.clone(), sharing: descriptor.sharing.clone(), }) })); - result.extend(self.frames.to_instructions()); - result.extend(self.waveforms.iter().map(|(name, definition)| { + instructions.extend(self.frames.to_instructions()); + instructions.extend(self.waveforms.iter().map(|(name, definition)| { Instruction::WaveformDefinition(WaveformDefinition { name: name.clone(), definition: definition.clone(), }) })); - result.extend(self.calibrations.to_instructions()); - result + instructions.extend(self.calibrations.to_instructions()); + instructions.extend(self.instructions.clone()); + instructions } +} - pub fn to_string(&self, include_headers: bool) -> String { - self.to_instructions(include_headers) - .iter() - .map(|inst| format!("{inst}\n")) - .collect() +impl fmt::Display for Program { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + for instruction in self.to_instructions() { + writeln!(f, "{instruction}")?; + } + Ok(()) } } @@ -422,10 +420,8 @@ I 0 assert_eq!(program.waveforms.len(), 1); assert_eq!(program.instructions.len(), 1); - assert_eq!(program.to_string(false), "I 0\n"); - assert_eq!( - program.to_string(true), + program.to_string(), "DECLARE ro BIT[5] DEFFRAME 0 \"rx\": \tHARDWARE-OBJECT: \"hardware\" @@ -445,8 +441,8 @@ DECLARE ro BIT DECLARE anc BIT DECLARE ec BIT "; - let program1 = Program::from_str(input).unwrap().to_string(true); - let program2 = Program::from_str(input).unwrap().to_string(true); + let program1 = Program::from_str(input).unwrap().to_string(); + let program2 = Program::from_str(input).unwrap().to_string(); // verify that each memory declaration in the program is in the same index as the same // program after being re-parsed and serialized. diff --git a/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Instruction-Match.snap b/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Instruction-Match.snap new file mode 100644 index 00000000..1a4b0b49 --- /dev/null +++ b/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Instruction-Match.snap @@ -0,0 +1,10 @@ +--- +source: quil-rs/src/program/calibration.rs +expression: calibrated_program.to_string() +--- +DEFCAL X 0: + Y 0 +DEFCAL Y 0: + PULSE 0 "xy" gaussian(duration: 1, fwhm: 2, t0: 3) +PULSE 0 "xy" gaussian(duration: 1, fwhm: 2, t0: 3) + diff --git a/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Param-Precedence.snap b/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Param-Precedence.snap new file mode 100644 index 00000000..724a2d63 --- /dev/null +++ b/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Param-Precedence.snap @@ -0,0 +1,14 @@ +--- +source: quil-rs/src/program/calibration.rs +expression: calibrated_program.to_string() +--- +DEFCAL RX(%theta) %qubit: + PULSE 1 "xy" gaussian(duration: 1, fwhm: 2, t0: 3) +DEFCAL RX(%theta) 0: + PULSE 2 "xy" gaussian(duration: 1, fwhm: 2, t0: 3) +DEFCAL RX((pi/2)) 0: + PULSE 3 "xy" gaussian(duration: 1, fwhm: 2, t0: 3) +PULSE 1 "xy" gaussian(duration: 1, fwhm: 2, t0: 3) +PULSE 2 "xy" gaussian(duration: 1, fwhm: 2, t0: 3) +PULSE 3 "xy" gaussian(duration: 1, fwhm: 2, t0: 3) + diff --git a/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Simple.snap b/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Simple.snap new file mode 100644 index 00000000..44c8e037 --- /dev/null +++ b/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Simple.snap @@ -0,0 +1,8 @@ +--- +source: quil-rs/src/program/calibration.rs +expression: calibrated_program.to_string() +--- +DEFCAL X 0: + PULSE 0 "xy" gaussian(duration: 1, fwhm: 2, t0: 3) +PULSE 0 "xy" gaussian(duration: 1, fwhm: 2, t0: 3) + diff --git a/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Variable-Qubit.snap b/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Variable-Qubit.snap new file mode 100644 index 00000000..b215a5fe --- /dev/null +++ b/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Calibration-Variable-Qubit.snap @@ -0,0 +1,8 @@ +--- +source: quil-rs/src/program/calibration.rs +expression: calibrated_program.to_string() +--- +DEFCAL I %q: + DELAY q 4e-8 +DELAY 0 4e-8 + diff --git a/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Measure-Calibration.snap b/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Measure-Calibration.snap new file mode 100644 index 00000000..fd7ee4b5 --- /dev/null +++ b/quil-rs/src/program/snapshots/quil_rs__program__calibration__tests__expansion@Measure-Calibration.snap @@ -0,0 +1,21 @@ +--- +source: quil-rs/src/program/calibration.rs +expression: calibrated_program.to_string() +--- +DEFCAL MEASURE 0 addr: + PRAGMA INCORRECT_ORDERING + +DEFCAL MEASURE 0 addr: + PRAGMA CORRECT + +DEFCAL MEASURE q addr: + PRAGMA CORRECT + +DEFCAL MEASURE 1 addr: + PRAGMA INCORRECT_QUBIT + +DEFCAL MEASURE addr: + PRAGMA INCORRECT_PRECEDENCE + +PRAGMA CORRECT + diff --git a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__active_reset_single_frame.snap b/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__active_reset_single_frame.snap deleted file mode 100644 index 55e4a71b..00000000 --- a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__active_reset_single_frame.snap +++ /dev/null @@ -1,43 +0,0 @@ ---- -source: src/program/graph.rs -expression: "ProgramDebugWrapper { program: &scheduled_program }" ---- -digraph { - entry [label="Entry Point"] - entry -> "measure_start" - subgraph "cluster_measure" { - label="measure" - node [ style="filled" ] - "measure_start" [ label=start, shape=circle ] - "measure_start" -> "measure_0" [ label="frame" ] - "measure_start" -> "measure_1" [ label="frame" ] - "measure_start" -> "measure_end" [ label="ordering" ] - "measure_0" [label="NONBLOCKING PULSE 0 \"ro_tx\" test(duration: 1000000.0)"] - "measure_0" -> "measure_end" [ label="frame" ] - "measure_1" [label="NONBLOCKING CAPTURE 0 \"ro_rx\" test(duration: 1000000.0) ro[0]"] - "measure_1" -> "measure_end" [ label="await capture -frame" ] - "measure_end" [ label=end, shape=circle ] - } -"measure_end" -> "end_start" [label="if ro[0] == 0"] -"measure_end" -> "feedback_start" [label="if ro[0] != 0"] - subgraph "cluster_feedback" { - label="feedback" - node [ style="filled" ] - "feedback_start" [ label=start, shape=circle ] - "feedback_start" -> "feedback_0" [ label="frame" ] - "feedback_start" -> "feedback_end" [ label="ordering" ] - "feedback_0" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "feedback_0" -> "feedback_end" [ label="frame" ] - "feedback_end" [ label=end, shape=circle ] - } -"feedback_end" -> "measure_start" [label="always"] - subgraph "cluster_end" { - label="end" - node [ style="filled" ] - "end_start" [ label=start, shape=circle ] - "end_start" -> "end_end" [ label="ordering" ] - "end_end" [ label=end, shape=circle ] - } -} - diff --git a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__chained_pulses.snap b/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__chained_pulses.snap deleted file mode 100644 index 36c8171d..00000000 --- a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__chained_pulses.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -source: src/program/graph.rs -expression: "ProgramDebugWrapper { program: &scheduled_program }" ---- -digraph { - entry [label="Entry Point"] - entry -> "block_0_start" - subgraph "cluster_block_0" { - label="block_0" - node [ style="filled" ] - "block_0_start" [ label=start, shape=circle ] - "block_0_start" -> "block_0_0" [ label="frame" ] - "block_0_start" -> "block_0_end" [ label="ordering" ] - "block_0_0" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_0" -> "block_0_1" [ label="frame" ] - "block_0_1" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_1" -> "block_0_2" [ label="frame" ] - "block_0_2" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_2" -> "block_0_3" [ label="frame" ] - "block_0_3" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_3" -> "block_0_4" [ label="frame" ] - "block_0_4" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_4" -> "block_0_end" [ label="frame" ] - "block_0_end" [ label=end, shape=circle ] - } -} - diff --git a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__different_frames_blocking.snap b/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__different_frames_blocking.snap deleted file mode 100644 index 4712b59d..00000000 --- a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__different_frames_blocking.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: src/program/graph.rs -expression: "ProgramDebugWrapper { program: &scheduled_program }" ---- -digraph { - entry [label="Entry Point"] - entry -> "block_0_start" - subgraph "cluster_block_0" { - label="block_0" - node [ style="filled" ] - "block_0_start" [ label=start, shape=circle ] - "block_0_start" -> "block_0_0" [ label="frame" ] - "block_0_start" -> "block_0_end" [ label="ordering" ] - "block_0_0" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_0" -> "block_0_1" [ label="frame" ] - "block_0_1" [label="PULSE 1 \"rf\" test(duration: 1000000.0)"] - "block_0_1" -> "block_0_2" [ label="frame" ] - "block_0_2" [label="PULSE 2 \"rf\" test(duration: 1000000.0)"] - "block_0_2" -> "block_0_end" [ label="frame" ] - "block_0_end" [ label=end, shape=circle ] - } -} - diff --git a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__different_frames_nonblocking.snap b/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__different_frames_nonblocking.snap deleted file mode 100644 index b338f587..00000000 --- a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__different_frames_nonblocking.snap +++ /dev/null @@ -1,25 +0,0 @@ ---- -source: src/program/graph.rs -expression: "ProgramDebugWrapper { program: &scheduled_program }" ---- -digraph { - entry [label="Entry Point"] - entry -> "block_0_start" - subgraph "cluster_block_0" { - label="block_0" - node [ style="filled" ] - "block_0_start" [ label=start, shape=circle ] - "block_0_start" -> "block_0_0" [ label="frame" ] - "block_0_start" -> "block_0_1" [ label="frame" ] - "block_0_start" -> "block_0_2" [ label="frame" ] - "block_0_start" -> "block_0_end" [ label="ordering" ] - "block_0_0" [label="NONBLOCKING PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_0" -> "block_0_end" [ label="frame" ] - "block_0_1" [label="NONBLOCKING PULSE 1 \"rf\" test(duration: 1000000.0)"] - "block_0_1" -> "block_0_end" [ label="frame" ] - "block_0_2" [label="NONBLOCKING PULSE 2 \"rf\" test(duration: 1000000.0)"] - "block_0_2" -> "block_0_end" [ label="frame" ] - "block_0_end" [ label=end, shape=circle ] - } -} - diff --git a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__fence_all_with_nonblocking_pulses.snap b/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__fence_all_with_nonblocking_pulses.snap deleted file mode 100644 index 47fd0e49..00000000 --- a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__fence_all_with_nonblocking_pulses.snap +++ /dev/null @@ -1,31 +0,0 @@ ---- -source: src/program/graph.rs -expression: "ProgramDebugWrapper { program: &scheduled_program }" ---- -digraph { - entry [label="Entry Point"] - entry -> "block_0_start" - subgraph "cluster_block_0" { - label="block_0" - node [ style="filled" ] - "block_0_start" [ label=start, shape=circle ] - "block_0_start" -> "block_0_0" [ label="frame" ] - "block_0_start" -> "block_0_1" [ label="frame" ] - "block_0_start" -> "block_0_2" [ label="frame" ] - "block_0_start" -> "block_0_end" [ label="ordering" ] - "block_0_0" [label="NONBLOCKING PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_0" -> "block_0_2" [ label="frame" ] - "block_0_1" [label="NONBLOCKING PULSE 1 \"rf\" test(duration: 1000000.0)"] - "block_0_1" -> "block_0_2" [ label="frame" ] - "block_0_2" [label="FENCE"] - "block_0_2" -> "block_0_3" [ label="frame" ] - "block_0_2" -> "block_0_4" [ label="frame" ] - "block_0_2" -> "block_0_end" [ label="frame" ] - "block_0_3" [label="NONBLOCKING PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_3" -> "block_0_end" [ label="frame" ] - "block_0_4" [label="NONBLOCKING PULSE 1 \"rf\" test(duration: 1000000.0)"] - "block_0_4" -> "block_0_end" [ label="frame" ] - "block_0_end" [ label=end, shape=circle ] - } -} - diff --git a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__jump.snap b/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__jump.snap deleted file mode 100644 index d82d08d9..00000000 --- a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__jump.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -source: src/program/graph.rs -expression: "ProgramDebugWrapper { program: &scheduled_program }" ---- -digraph { - entry [label="Entry Point"] - entry -> "first-block_start" - subgraph "cluster_first-block" { - label="first-block" - node [ style="filled" ] - "first-block_start" [ label=start, shape=circle ] - "first-block_start" -> "first-block_0" [ label="frame" ] - "first-block_start" -> "first-block_end" [ label="ordering" ] - "first-block_0" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "first-block_0" -> "first-block_end" [ label="frame" ] - "first-block_end" [ label=end, shape=circle ] - } -"first-block_end" -> "third-block_start" [label="if ro[0] != 0"] -"first-block_end" -> "second-block_start" [label="if ro[0] == 0"] - subgraph "cluster_second-block" { - label="second-block" - node [ style="filled" ] - "second-block_start" [ label=start, shape=circle ] - "second-block_start" -> "second-block_0" [ label="frame" ] - "second-block_start" -> "second-block_end" [ label="ordering" ] - "second-block_0" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "second-block_0" -> "second-block_end" [ label="frame" ] - "second-block_end" [ label=end, shape=circle ] - } -"second-block_end" -> "third-block_start" [label="always"] - subgraph "cluster_third-block" { - label="third-block" - node [ style="filled" ] - "third-block_start" [ label=start, shape=circle ] - "third-block_start" -> "third-block_0" [ label="frame" ] - "third-block_start" -> "third-block_end" [ label="ordering" ] - "third-block_0" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "third-block_0" -> "third-block_end" [ label="frame" ] - "third-block_end" [ label=end, shape=circle ] - } -} - diff --git a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__single_dependency.snap b/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__single_dependency.snap deleted file mode 100644 index eb942446..00000000 --- a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__single_dependency.snap +++ /dev/null @@ -1,21 +0,0 @@ ---- -source: src/program/graph.rs -expression: "ProgramDebugWrapper { program: &scheduled_program }" ---- -digraph { - entry [label="Entry Point"] - entry -> "block_0_start" - subgraph "cluster_block_0" { - label="block_0" - node [ style="filled" ] - "block_0_start" [ label=start, shape=circle ] - "block_0_start" -> "block_0_0" [ label="frame" ] - "block_0_start" -> "block_0_end" [ label="ordering" ] - "block_0_0" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_0" -> "block_0_1" [ label="frame" ] - "block_0_1" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_1" -> "block_0_end" [ label="frame" ] - "block_0_end" [ label=end, shape=circle ] - } -} - diff --git a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__single_instruction.snap b/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__single_instruction.snap deleted file mode 100644 index ef270eb6..00000000 --- a/quil-rs/src/program/snapshots/quil_rs__program__graph__tests__graph__single_instruction.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: src/program/graph.rs -expression: "ProgramDebugWrapper { program: &scheduled_program }" ---- -digraph { - entry [label="Entry Point"] - entry -> "block_0_start" - subgraph "cluster_block_0" { - label="block_0" - node [ style="filled" ] - "block_0_start" [ label=start, shape=circle ] - "block_0_start" -> "block_0_0" [ label="frame" ] - "block_0_start" -> "block_0_end" [ label="ordering" ] - "block_0_0" [label="PULSE 0 \"rf\" test(duration: 1000000.0)"] - "block_0_0" -> "block_0_end" [ label="frame" ] - "block_0_end" [ label=end, shape=circle ] - } -} - diff --git a/quil-rs/src/program/snapshots/quil_rs__program__graphviz_dot__tests__graph__parametric_pulse_using_capture_results.snap b/quil-rs/src/program/snapshots/quil_rs__program__graphviz_dot__tests__graph__parametric_pulse_using_capture_results.snap deleted file mode 100644 index c2f1dd71..00000000 --- a/quil-rs/src/program/snapshots/quil_rs__program__graphviz_dot__tests__graph__parametric_pulse_using_capture_results.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: quil/src/program/graphviz_dot.rs -expression: "ProgramDebugWrapper{program: &scheduled_program,}" - ---- -digraph { - entry [label="Entry Point"] - entry -> "block_0_start" - subgraph "cluster_block_0" { - label="block_0" - node [ style="filled" ] - "block_0_start" [ label=start, shape=circle ] - "block_0_start" -> "block_0_0" [ label="immediate" ] - "block_0_start" -> "block_0_end" [ label="immediate" ] - "block_0_0" [label="CAPTURE 0 \"ro_rx\" test(a: param[0]) ro[0]"] - "block_0_0" -> "block_0_1" [ label="await capture" ] - "block_0_0" -> "block_0_end" [ label="await read" ] - "block_0_1" [label="PULSE 0 \"rf\" test(a: ro[0])"] - "block_0_1" -> "block_0_end" [ label="await read" ] - "block_0_end" [ label=end, shape=circle ] - } -} -