diff --git a/poetry.lock b/poetry.lock index 1600ae8f..d6493097 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,11 @@ +[[package]] +category = "main" +description = "ANTLR 4.7.2 runtime for Python 3.6.3" +name = "antlr4-python3-runtime" +optional = false +python-versions = "*" +version = "4.7.2" + [[package]] category = "main" description = "Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP" @@ -152,6 +160,14 @@ optional = false python-versions = "*" version = "1.1.6" +[[package]] +category = "main" +description = "Clean single-source support for Python 3 and 2" +name = "future" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +version = "0.17.1" + [[package]] category = "main" description = "Google API Client Library for Python" @@ -209,6 +225,14 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" version = "2.8" +[[package]] +category = "main" +description = "Immutable Collections" +name = "immutables" +optional = false +python-versions = "*" +version = "0.6" + [[package]] category = "dev" description = "Read metadata from Python packages" @@ -334,6 +358,14 @@ optional = false python-versions = "*" version = "1.1.0" +[[package]] +category = "main" +description = "MessagePack (de)serializer." +name = "msgpack" +optional = false +python-versions = "*" +version = "0.6.1" + [[package]] category = "main" description = "Python package for creating and manipulating graphs and networks" @@ -561,6 +593,23 @@ optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" version = "2.4.0" +[[package]] +category = "main" +description = "A Python library to generate Quantum Instruction Language (Quil) Programs." +name = "pyquil" +optional = false +python-versions = ">=3.6" +version = "2.9.1" + +[package.dependencies] +antlr4-python3-runtime = "*" +immutables = "0.6" +networkx = ">=2.0.0" +numpy = "*" +requests = "*" +rpcq = ">=2.5.1" +six = "*" + [[package]] category = "dev" description = "pytest: simple powerful testing with Python" @@ -598,6 +647,14 @@ version = "2.8.0" [package.dependencies] six = ">=1.5" +[[package]] +category = "main" +description = "Python wrapper around rapidjson" +name = "python-rapidjson" +optional = false +python-versions = ">=3.4" +version = "0.7.2" + [[package]] category = "main" description = "World timezone definitions, modern and historical" @@ -606,6 +663,14 @@ optional = false python-versions = "*" version = "2019.1" +[[package]] +category = "main" +description = "Python bindings for 0MQ" +name = "pyzmq" +optional = false +python-versions = ">=2.7,!=3.0*,!=3.1*,!=3.2*" +version = "18.0.2" + [[package]] category = "main" description = "Qiskit provider for accessing the quantum devices and simulators at IBMQ" @@ -676,6 +741,22 @@ cryptography = ">=1.3" ntlm-auth = ">=1.0.2" requests = ">=2.0.0" +[[package]] +category = "main" +description = "The RPC framework and message specification for Rigetti QCS." +name = "rpcq" +optional = false +python-versions = ">=3.6" +version = "2.7.1" + +[package.dependencies] +future = "*" +msgpack = ">=0.6" +python-rapidjson = "*" +pyzmq = ">=17" +"ruamel.yaml" = "*" +typing = "*" + [[package]] category = "main" description = "Pure-Python RSA implementation" @@ -687,6 +768,18 @@ version = "4.0" [package.dependencies] pyasn1 = ">=0.1.3" +[[package]] +category = "main" +description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" +name = "ruamel.yaml" +optional = false +python-versions = "*" +version = "0.15.97" + +[package.extras] +docs = ["ryd"] +jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"] + [[package]] category = "main" description = "SciPy: Scientific Library for Python" @@ -818,10 +911,11 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] testing = ["pathlib2", "contextlib2", "unittest2"] [metadata] -content-hash = "432d177b4e1c25d1c57edbb077d1200ebaaa9ff2478834db6019aa43eaff948b" +content-hash = "8d9aa4b7bc758be12f7fd3380faa1500f21d8b0295c7a19b283ae38d8dc48b27" python-versions = ">=3.7.3" [metadata.hashes] +antlr4-python3-runtime = ["168cdcec8fb9152e84a87ca6fd261b3d54c8f6358f42ab3b813b14a7193bb50b"] asn1crypto = ["2f1adbb7546ed199e3c90ef23ec95c5cf3585bac7d11fb7eb562a3fe89c64e87", "9d5c20441baf0cb60a4ac34cc447c6c189024b6b4c6cd7877034f4965c464e49"] astroid = ["6560e1e1749f68c64a4b5dee4e091fce798d2f0d84ebe638cf0e0585a343acf4", "b65db1bbaac9f9f4d190199bb8680af6f6f84fd3769a5ea883df8a91fe68b4c4"] atomicwrites = ["03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", "75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6"] @@ -836,11 +930,13 @@ cryptography = ["24b61e5fcb506424d3ec4e18bca995833839bf13c59fc43e530e488f28d46b8 cycler = ["1d8a5ae1ff6c5cf9b93e8811e581232ad8920aeec647c37316ceac982b08cb2d", "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8"] decorator = ["86156361c50488b84a3f148056ea716ca587df2f0de1d34750d35c21312725de", "f069f3a01830ca754ba5258fde2278454a0b5b79e0d7f5c13b3b97e57d4acff6"] enum34 = ["2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850", "644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a", "6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79", "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"] +future = ["67045236dcfd6816dc439556d009594abf643e5eb48992e36beac09c2ca659b8"] google-api-python-client = ["048da0d68564380ee23b449e5a67d4666af1b3b536d2fb0a02cee1ad540fa5ec", "5def5a485b1cbc998b8f869456c7bde0c0e6d3d0a5ea1f300b5ef57cb4b1ce8f"] google-auth = ["0f7c6a64927d34c1a474da92cfc59e552a5d3b940d3266606c6a28b72888b9e4", "20705f6803fd2c4d1cc2dcb0df09d4dfcb9a7d51fd59e94a3a28231fd93119ed"] google-auth-httplib2 = ["098fade613c25b4527b2c08fa42d11f3c2037dda8995d86de0745228e965d445", "f1c437842155680cf9918df9bc51c1182fda41feef88c34004bd1978c8157e08"] httplib2 = ["158fbd0ffbba536829d664bf3f32c4f45df41f8f791663665162dfaf21ffd075", "d1146939d270f1f1eb8cbf8f5aa72ff37d897faccca448582bb1e180aeb4c6b2"] idna = ["c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", "ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c"] +immutables = ["1e4f4513254ef11e0230a558ee0dcb4551b914993c330005d15338da595d3750", "228e38dc7a810ba4ff88909908ac47f840e5dc6c4c0da6b25009c626a9ae771c", "2ae88fbfe1d04f4e5859c924e97313edf70e72b4f19871bf329b96a67ede9ba0", "2d32b61c222cba1dd11f0faff67c7fb6204ef1982454e1b5b001d4b79966ef17", "35af186bfac5b62522fdf2cab11120d7b0547f405aa399b6a1e443cf5f5e318c", "63023fa0cceedc62e0d1535cd4ca7a1f6df3120a6d8e5c34e89037402a6fd809", "6bf5857f42a96331fd0929c357dc0b36a72f339f3b6acaf870b149c96b141f69", "7bb1590024a032c7a57f79faf8c8ff5e91340662550d2980e0177f67e66e9c9c", "7c090687d7e623d4eca22962635b5e1a1ee2d6f9a9aca2f3fb5a184a1ffef1f2", "bc36a0a8749881eebd753f696b081bd51145e4d77291d671d2e2f622e5b65d2f", "d9fc6a236018d99af6453ead945a6bb55f98d14b1801a2c229dd993edc753a00"] importlib-metadata = ["6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", "cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db"] isort = ["c40744b6bc5162bbb39c1257fe298b7a393861d50978b565f3ccd9cb9de0182a", "f57abacd059dc3bd666258d1efb0377510a89777fda3e3274e3c01f7c03ae22d"] jsonschema = ["000e68abd33c972a5248544925a0cae7d1125f9bf6c58280d37546b946769a08", "6ff5f3180870836cae40f06fa10419f557208175f13ad7bc26caa77beb1f6e02"] @@ -852,6 +948,7 @@ matplotlib = ["029620799e581802961ac1dcff5cb5d3ee2f602e0db9c0f202a90495b37d2126" mccabe = ["ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", "dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"] more-itertools = ["2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7", "c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a"] mpmath = ["fc17abe05fbab3382b61a123c398508183406fa132e0223874578e20946499f6"] +msgpack = ["26cb40116111c232bc235ce131cc3b4e76549088cb154e66a2eb8ff6fcc907ec", "300fd3f2c664a3bf473d6a952f843b4a71454f4c592ed7e74a36b205c1782d28", "3129c355342853007de4a2a86e75eab966119733eb15748819b6554363d4e85c", "31f6d645ee5a97d59d3263fab9e6be76f69fa131cddc0d94091a3c8aca30d67a", "3ce7ef7ee2546c3903ca8c934d09250531b80c6127e6478781ae31ed835aac4c", "4008c72f5ef2b7936447dcb83db41d97e9791c83221be13d5e19db0796df1972", "62bd8e43d204580308d477a157b78d3fee2fb4c15d32578108dc5d89866036c8", "70cebfe08fb32f83051971264466eadf183101e335d8107b80002e632f425511", "72cb7cf85e9df5251abd7b61a1af1fb77add15f40fa7328e924a9c0b6bc7a533", "7c55649965c35eb32c499d17dadfb8f53358b961582846e1bc06f66b9bccc556", "86b963a5de11336ec26bc4f839327673c9796b398b9f1fe6bb6150c2a5d00f0f", "8c73c9bcdfb526247c5e4f4f6cf581b9bb86b388df82cfcaffde0a6e7bf3b43a", "8e68c76c6aff4849089962d25346d6784d38e02baa23ffa513cf46be72e3a540", "97ac6b867a8f63debc64f44efdc695109d541ecc361ee2dce2c8884ab37360a1", "9d4f546af72aa001241d74a79caec278bcc007b4bcde4099994732e98012c858", "a28e69fe5468c9f5251c7e4e7232286d71b7dfadc74f312006ebe984433e9746", "fd509d4aa95404ce8d86b4e32ce66d5d706fd6646c205e1c2a715d87078683a2"] networkx = ["8311ddef63cf5c5c5e7c1d0212dd141d9a1fe3f474915281b73597ed5f1d4e3d"] ntlm-auth = ["bb2fd03c665f0f62c5f65695b62dcdb07fb7a45df6ebc86c770be2054d6902dd", "ce5b4483ed761f341a538a426a71a52e5a9cf5fd834ebef1d2090f9eef14b3f8"] numpy = ["0778076e764e146d3078b17c24c4d89e0ecd4ac5401beff8e1c87879043a0633", "141c7102f20abe6cf0d54c4ced8d565b86df4d3077ba2343b61a6db996cefec7", "14270a1ee8917d11e7753fb54fc7ffd1934f4d529235beec0b275e2ccf00333b", "27e11c7a8ec9d5838bc59f809bfa86efc8a4fd02e58960fa9c49d998e14332d5", "2a04dda79606f3d2f760384c38ccd3d5b9bb79d4c8126b67aff5eb09a253763e", "3c26010c1b51e1224a3ca6b8df807de6e95128b0908c7e34f190e7775455b0ca", "52c40f1a4262c896420c6ea1c6fda62cf67070e3947e3307f5562bd783a90336", "6e4f8d9e8aa79321657079b9ac03f3cf3fd067bf31c1cca4f56d49543f4356a5", "7242be12a58fec245ee9734e625964b97cf7e3f2f7d016603f9e56660ce479c7", "7dc253b542bfd4b4eb88d9dbae4ca079e7bf2e2afd819ee18891a43db66c60c7", "94f5bd885f67bbb25c82d80184abbf7ce4f6c3c3a41fbaa4182f034bba803e69", "a89e188daa119ffa0d03ce5123dee3f8ffd5115c896c2a9d4f0dbb3d8b95bfa3", "ad3399da9b0ca36e2f24de72f67ab2854a62e623274607e37e0ce5f5d5fa9166", "b0348be89275fd1d4c44ffa39530c41a21062f52299b1e3ee7d1c61f060044b8", "b5554368e4ede1856121b0dfa35ce71768102e4aa55e526cb8de7f374ff78722", "cbddc56b2502d3f87fda4f98d948eb5b11f36ff3902e17cb6cc44727f2200525", "d79f18f41751725c56eceab2a886f021d70fd70a6188fd386e29a045945ffc10", "dc2ca26a19ab32dc475dbad9dfe723d3a64c835f4c23f625c2b6566ca32b9f29", "dd9bcd4f294eb0633bb33d1a74febdd2b9018b8b8ed325f861fffcd2c7660bb8", "e8baab1bc7c9152715844f1faca6744f2416929de10d7639ed49555a85549f52", "ec31fe12668af687b99acf1567399632a7c47b0e17cfb9ae47c098644ef36797", "f12b4f7e2d8f9da3141564e6737d79016fe5336cc92de6814eba579744f65b0a", "f58ac38d5ca045a377b3b377c84df8175ab992c970a53332fa8ac2373df44ff7"] @@ -873,14 +970,19 @@ pylatexenc = ["ef2d5260c38e2cb4d2829e8b918914a558557820d4f57cb6588a81e827de2bb3" pylint = ["5d77031694a5fb97ea95e828c8d10fc770a1df6eb3906067aaed42201a8a6a09", "723e3db49555abaf9bf79dc474c6b9e2935ad82230b10c1138a71ea41ac0fff1"] pylint-runner = ["9e04d72471a9225db6734334ec578ac37b47130625553df149ca6a20ecd565a9", "bc44a39ad93ffa865f282dff26632ac78b60ce53c417d4b1de82b52842d1e6e8"] pyparsing = ["1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a", "9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03"] +pyquil = ["4bc4fa3efea9cc78b26a215b87e6a38463cd575addf0d0cb24750532ddbf93b6"] pytest = ["4a784f1d4f2ef198fe9b7aef793e9fa1a3b2f84e822d9b3a64a181293a572d45", "926855726d8ae8371803f7b2e6ec0a69953d9c6311fa7c3b6c1b929ff92d27da"] python-dateutil = ["7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb", "c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"] +python-rapidjson = ["0710751aaf31738c102f41af4330b62df8023914ce9481244a2b3cc964776ceb", "090a0c8604759a47db56fad0a7817eaa072bb7eb3aa76f71a4fa6c58c1302b74", "0d32c2b0f5fc2b29f8317ec77ae141655814fe151ef530adb007b33f8b48abdf", "14929156740a37bc3ec18aa6ac8b17013f4e9ecf2f2ac31267b8b4d601654ea4", "16d7cbf00709a8d849359fa41c5cd462354af1dea10d9e1fe6e2865c36d533ec", "1a6e6e023a42b48f3a440723cca8cc16be3a5db9ea8f5c3e48aa63bc2d5fe79f", "2c639e8f064a1bfa8285fec1cd72361a5ccd8adc64497ab9f9e3799edbbc5694", "3656dba8038ec08fa6aec1ccb9b8b04e4f3d747c41ae2a63a3b40076653d7439", "3e15b1fda6f8b4dc15528c473d1bdb178b942c260a7822f112292059228cf057", "467ca7ee00f20683161c868ce16a3deb68b233a4a4fcc072b41f1cb7c89171f4", "6a09c0bb905fdc30527c0147ba530b26f3091ecdba19eb1aa4a6c0fcfa4230ee", "795e3a0fdaccbf229b7b2b78f2f2b83a6884a6f3690ae49e64e90465401b1a9b", "7bf4c40ad402eacce5a4e80f4bfb39e38fa9662a95c2a58f3f497f590bfd1c7d", "7d38228984ced0a95da469e5f77c5affb67fc6c6dd2214fd738af63d386fc48a", "93804ffffda7bb7db43cd3d736623805adf147372eed4d10ce9464663881acf3", "94a25d52c434439afb6a64930a4dd3ea85fbcbb164a7bddea3ade3552c7e877e", "9c62b96d22203f58183e3cebdbcab407babbad13ed6ccc8b3fd461d9c475157f", "af97a0c37747bf9b9e0176394ebbfe2bb8543eecff91d38824dafbd27fef4a20", "c745bbac3047d9d2dd6dc55d7fdfc34bb08f40a1873ac8c8e2a5bf9a144fb1e5", "eaf930000666aabdb62253201f291406e1dc407655788d8074c91ba361fb1909", "fd665648dc3b4416ceafb7dc155061b639a350c28650b3d028f769a91184ce69"] pytz = ["303879e36b721603cc54604edcac9d20401bdbe31e1e4fdee5b9f98d5d31dfda", "d747dd3d23d77ef44c6a3526e274af6efeb0a6f1afd5a69ba4d5be4098c8e141"] +pyzmq = ["00dd015159eaeb1c0731ad49310e1f5d839c9a35a15e4f3267f5052233fad99b", "03913b6beb8e7b417b9910b0ee1fd5d62e9626d218faefbe879d70714ceab1a2", "13f17386df81d5e6efb9a4faea341d8de22cdc82e49a326dded26e33f42a3112", "16c6281d96885db1e15f7047ddc1a8f48ff4ea35d31ca709f4d2eb39f246d356", "17efab4a804e31f58361631256d660214204046f9e2b962738b171b9ad674ea7", "2b79919ddeff3d3c96aa6087c21d294c8db1c01f6bfeee73324944683685f419", "2f832e4711657bb8d16ea1feba860f676ec5f14fb9fe3b449b5953a60e89edae", "31a11d37ac73107363b47e14c94547dbfc6a550029c3fe0530be443199026fc2", "33a3e928e6c3138c675e1d6702dd11f6b7050177d7aab3fc322db6e1d2274490", "34a38195a6d3a9646cbcdaf8eb245b4d935c7a57f7e1b3af467814bc1a92467e", "42900054f1500acef6df7428edf806abbf641bf92eb9ceded24aa863397c3bae", "4ccc7f3c63aa9d744dadb62c49eda2d0e7de55649b80c45d7c684d70161a69af", "5b220c37c346e6575db8c88a940c1fc234f99ce8e0068c408919bb8896c4b6d2", "6074848da5c8b44a1ca40adf75cf65aa92bc80f635e8249aa8f37a69b2b9b6f5", "61a4155964bd4a14ef95bf46cb1651bcf8dcbbed8c0108e9c974c1fcbb57788f", "62b5774688326600c52f587f7a033ca6b6284bef4c8b1b5fda32480897759eac", "65a9ffa4f9f085d696f16fd7541f34b3c357d25fe99c90e3bce2ea59c3b5b4b6", "76a077d2c30f8adc5e919a55985a784b96aeca69b53c1ea6fd5723d3ae2e6f53", "8e5b4c51557071d6379d6dc1f54f35e9f6a137f5e84e102efb869c8d3c13c8ff", "917f73e07cc04f0678a96d93e7bb8b1adcccdde9ccfe202e622814f4d1d1ecfd", "91c75d3c4c357f9643e739db9e79ab9681b2f6ae8ec5678d6ef2ea0d01532596", "923dd91618b100bb4c92ab9ed7b65825a595b8524a094ce03c7cb2aaae7d353b", "9849054e0355e2bc7f4668766a25517ba76095031c9ff5e39ae8949cee5bb024", "c9d453933f0e3f44b9759189f2a18aa765f7f1a4345c727c18ebe8ad0d748d26", "cb7514936277abce64c2f4c56883e5704d85ed04d98d2d432d1c6764003bb003"] qiskit-ibmq-provider = ["5fc05803ead012ed38601ae7fab5846ee23806929b1056a243c53ef615f92986"] qiskit-terra = ["00ec6540c6bd67bc9fbd0cfa96fe7e78b0ba880d2fbc4d9a0dd96e57e22cff5e", "1433898f50c50fcaf8479abf0fee5ddaf58600e7039b74dc2e5cd2b4c0d91cc0", "1bb07d9c9ae27c7cefca991b973489b3c25b0d1a3ee641f9112bd76b7a9742b2", "278ed6f44fb4d7602cfa99f23c8e64c44c05e3231179d457b5be69c599d8882c", "5e6a20bafb8da900edee07834530be92fdb5c3117ddab2094861a7959d81299a", "7901b111c2b699bac20a66d036e043915099a463576cda4808e6198bb61de95a", "839a58ec5a9847d0670cec54883bfefffa0b90e749ab2c26afdd640bbcd4b83e", "948dd75c6ea78356ea8e6e6cd55ed7d7c7c77f8b9c658b49c93009f2d8e27edb", "9ba5111fdd0c417f5257c703b6c64f3f1873c6538792e527ceb3f1cfbc558031", "abf2c59d4a3a5fab2f1d6c7a67118a178a55178c1e4d893ecca5b3dbb6271a76", "b1fc4c3b82ef72b53d37dfaf25489ffaa7601220e7e86d9a3a8563ca0d60f8dd", "b5334e8c8b4b8c5f26aba2f7a289d74e82add1ec8fdcda4d6600e25019c6cb53", "ba87d8e1f8b0a7f1152878f738d4279d5839cca8d51b9a6a512f4df34b7b8c52", "e4259ebda66dc753315b428be528002caf34ed6d01062de9794873c81763b286", "e51ef8b187006a81ad2eb677cade958cff6788b643f901e4f23c9e4319b6a5e3", "ffa218f1b14c736aae025c99aed58f9d38cf287766c00e7d78024c037e012fa0"] requests = ["11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", "9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31"] requests-ntlm = ["1eb43d1026b64d431a8e0f1e8a8c8119ac698e72e9b95102018214411a8463ea", "9189c92e8c61ae91402a64b972c4802b2457ce6a799d658256ebf084d5c7eb71"] +rpcq = ["21356e3ba4d5068f9b73e08013a8342073d55d367830310ab02874c558d924ed"] rsa = ["14ba45700ff1ec9eeb206a2ce76b32814958a98e372006c8fb76ba820211be66", "1a836406405730121ae9823e19c6e806c62bbad73f890574fff50efa4122c487"] +"ruamel.yaml" = ["17dbf6b7362e7aee8494f7a0f5cffd44902a6331fe89ef0853b855a7930ab845", "23731c9efb79f3f5609dedffeb6c5c47a68125fd3d4b157d9fc71b1cd49076a9", "2bbdd598ae57bac20968cf9028cc67d37d83bdb7942a94b9478110bc72193148", "34586084cdd60845a3e1bece2b58f0a889be25450db8cc0ea143ddf0f40557a2", "35957fedbb287b01313bb5c556ffdc70c0277c3500213b5e73dfd8716f748d77", "414cb87a40974a575830b406ffab4ab8c6cbd82eeb73abd2a9d1397c1f0223e1", "428775be75db68d908b17e4e8dda424c410222f170dc173246aa63e972d094b3", "514f670f7d36519bda504d507edfe63e3c20489f86c86d42bc4d9a6dbdf82c7b", "5cb962c1ac6887c5da29138fbbe3b4b7705372eb54e599907fa63d4cd743246d", "5f6e30282cf70fb7754e1a5f101e27b5240009766376e131b31ab49f14fe81be", "86f8e010af6af0b4f42de2d0d9b19cb441e61d3416082186f9dd03c8552d13ad", "8d47ed1e557d546bd2dfe54f504d7274274602ff7a0652cde84c258ad6c2d96d", "98668876720bce1ac08562d8b93a564a80e3397e442c7ea19cebdcdf73da7f74", "9e1f0ddc18d8355dcf5586a5d90417df56074f237812b8682a93b62cca9d2043", "a7bc812a72a79d6b7dbb96fa5bee3950464b65ec055d3abc4db6572f2373a95c", "b72e13f9f206ee103247b07afd5a39c8b1aa98e8eba80ddba184d030337220ba", "bcff8ea9d916789e85e24beed8830c157fb8bc7c313e554733a8151540e66c01", "c76e78b3bab652069b8d6f7889b0e72f3455c2b854b2e0a8818393d149ad0a0d"] scipy = ["03b1e0775edbe6a4c64effb05fff2ce1429b76d29d754aa5ee2d848b60033351", "09d008237baabf52a5d4f5a6fcf9b3c03408f3f61a69c404472a16861a73917e", "10325f0ffac2400b1ec09537b7e403419dcd25d9fee602a44e8a32119af9079e", "1db9f964ed9c52dc5bd6127f0dd90ac89791daa690a5665cc01eae185912e1ba", "409846be9d6bdcbd78b9e5afe2f64b2da5a923dd7c1cd0615ce589489533fdbb", "4907040f62b91c2e170359c3d36c000af783f0fa1516a83d6c1517cde0af5340", "6c0543f2fdd38dee631fb023c0f31c284a532d205590b393d72009c14847f5b1", "826b9f5fbb7f908a13aa1efd4b7321e36992f5868d5d8311c7b40cf9b11ca0e7", "a7695a378c2ce402405ea37b12c7a338a8755e081869bd6b95858893ceb617ae", "a84c31e8409b420c3ca57fd30c7589378d6fdc8d155d866a7f8e6e80dec6fd06", "adadeeae5500de0da2b9e8dd478520d0a9945b577b2198f2462555e68f58e7ef", "b283a76a83fe463c9587a2c88003f800e08c3929dfbeba833b78260f9c209785", "c19a7389ab3cd712058a8c3c9ffd8d27a57f3d84b9c91a931f542682bb3d269d", "c3bb4bd2aca82fb498247deeac12265921fe231502a6bc6edea3ee7fe6c40a7a", "c5ea60ece0c0c1c849025bfc541b60a6751b491b6f11dd9ef37ab5b8c9041921", "db61a640ca20f237317d27bc658c1fc54c7581ff7f6502d112922dc285bdabee"] six = ["3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"] snowballstemmer = ["919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128", "9f3bcd3c401c3e862ec0ebe6d2c069ebc012ce142cce209c098ccb5b09136e89"] diff --git a/pyproject.toml b/pyproject.toml index 8f744637..c597bfa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ scipy = "^1.3" qiskit-terra = "^0.8.1" qiskit-ibmq-provider = "^0.2.2" cirq = "^0.5.0" +pyquil = "^2.9" [tool.poetry.dev-dependencies] pytest = "*" diff --git a/qctrlopencontrols/__init__.py b/qctrlopencontrols/__init__.py index 2f0f11ee..781c8f9d 100644 --- a/qctrlopencontrols/__init__.py +++ b/qctrlopencontrols/__init__.py @@ -28,11 +28,14 @@ from .dynamic_decoupling_sequences.predefined import new_predefined_dds from .dynamic_decoupling_sequences.driven_controls import convert_dds_to_driven_control +from .pyquil.program import convert_dds_to_pyquil_program + from .qiskit.quantum_circuit import convert_dds_to_qiskit_quantum_circuit __all__ = ['convert_dds_to_cirq_circuit', 'convert_dds_to_cirq_schedule', 'convert_dds_to_driven_control', + 'convert_dds_to_pyquil_program', 'convert_dds_to_qiskit_quantum_circuit', 'new_predefined_dds', 'new_predefined_driven_control', diff --git a/qctrlopencontrols/cirq/circuit.py b/qctrlopencontrols/cirq/circuit.py index fc23ba36..8595946e 100644 --- a/qctrlopencontrols/cirq/circuit.py +++ b/qctrlopencontrols/cirq/circuit.py @@ -108,8 +108,7 @@ def convert_dds_to_cirq_circuit( 'Time delay of gates must be greater than zero.', {'gate_time': gate_time}) - if target_qubits is None: - target_qubits = [cirq.LineQubit(0)] + target_qubits = target_qubits or [cirq.LineQubit(0)] if algorithm not in [FIX_DURATION_UNITARY, INSTANT_UNITARY]: raise ArgumentsValueError('Algorithm must be one of {} or {}'.format( @@ -123,42 +122,37 @@ def convert_dds_to_cirq_circuit( azimuthal_angles = dynamic_decoupling_sequence.azimuthal_angles detuning_rotations = dynamic_decoupling_sequence.detuning_rotations - if len(rabi_rotations.shape) == 1: - rabi_rotations = rabi_rotations[np.newaxis, :] - if len(azimuthal_angles.shape) == 1: - azimuthal_angles = azimuthal_angles[np.newaxis, :] - if len(detuning_rotations.shape) == 1: - detuning_rotations = detuning_rotations[np.newaxis, :] - - operations = np.vstack((rabi_rotations, azimuthal_angles, detuning_rotations)) offsets = dynamic_decoupling_sequence.offsets time_covered = 0 circuit = cirq.Circuit() - for operation_idx in range(operations.shape[1]): + for offset, rabi_rotation, azimuthal_angle, detuning_rotation in zip( + list(offsets), list(rabi_rotations), + list(azimuthal_angles), list(detuning_rotations)): - offset_distance = offsets[operation_idx] - time_covered + offset_distance = offset - time_covered if np.isclose(offset_distance, 0.0): offset_distance = 0.0 if offset_distance < 0: - raise ArgumentsValueError("Offsets cannot be placed properly", - {'sequence_operations': operations}) - - if offset_distance > 0: - while (time_covered+gate_time) <= offsets[operation_idx]: - gate_list = [] - for qubit in target_qubits: - gate_list.append(cirq.I(qubit)) - time_covered += gate_time - circuit.append(gate_list) - - rabi_rotation = operations[0, operation_idx] - azimuthal_angle = operations[1, operation_idx] + raise ArgumentsValueError( + "Offsets cannot be placed properly. Spacing between the rotations" + "is smaller than the time required to perform the rotation. Provide" + "a longer dynamic decoupling sequence or shorted gate time.", + {'dynamic_decoupling_sequence': dynamic_decoupling_sequence, + 'gate_time': gate_time}) + + while (time_covered+gate_time) <= offset: + gate_list = [] + for qubit in target_qubits: + gate_list.append(cirq.I(qubit)) + time_covered += gate_time + circuit.append(gate_list) + x_rotation = rabi_rotation * np.cos(azimuthal_angle) y_rotation = rabi_rotation * np.sin(azimuthal_angle) - z_rotation = operations[2, operation_idx] + z_rotation = detuning_rotation rotations = np.array([x_rotation, y_rotation, z_rotation]) zero_pulses = np.isclose(rotations, 0.0).astype(np.int) @@ -166,16 +160,13 @@ def convert_dds_to_cirq_circuit( if nonzero_pulse_counts > 1: raise ArgumentsValueError( 'Open Controls support a sequence with one ' - 'valid pulse at any offset. Found sequence ' + 'valid rotation at any offset. Found a sequence ' 'with multiple rotation operations at an offset.', - {'dynamic_decoupling_sequence': str(dynamic_decoupling_sequence), - 'offset': dynamic_decoupling_sequence.offsets[operation_idx], - 'rabi_rotation': dynamic_decoupling_sequence.rabi_rotations[ - operation_idx], - 'azimuthal_angle': dynamic_decoupling_sequence.azimuthal_angles[ - operation_idx], - 'detuning_rotaion': dynamic_decoupling_sequence.detuning_rotations[ - operation_idx]} + {'dynamic_decoupling_sequence': dynamic_decoupling_sequence}, + extras={'offset': offset, + 'rabi_rotation': rabi_rotation, + 'azimuthal_angle': azimuthal_angle, + 'detuning_rotation': detuning_rotation} ) gate_list = [] @@ -190,10 +181,9 @@ def convert_dds_to_cirq_circuit( elif not np.isclose(rotations[2], 0.): gate_list.append(cirq.Rz(rotations[2])(qubit)) circuit.append(gate_list) - if np.isclose(np.sum(rotations), 0.0): - time_covered = offsets[operation_idx] - else: - time_covered = offsets[operation_idx] + unitary_time + + time_covered = offset + unitary_time + if add_measurement: gate_list = [] for idx, qubit in enumerate(target_qubits): diff --git a/qctrlopencontrols/driven_controls/__init__.py b/qctrlopencontrols/driven_controls/__init__.py index 40858ed5..2bb15b13 100644 --- a/qctrlopencontrols/driven_controls/__init__.py +++ b/qctrlopencontrols/driven_controls/__init__.py @@ -13,11 +13,10 @@ # limitations under the License. """ -=============== -driven_controls -=============== +====================== +driven_controls module +====================== """ - ##### Maximum and Minimum bounds ###### UPPER_BOUND_RABI_RATE = 1e10 diff --git a/qctrlopencontrols/driven_controls/predefined.py b/qctrlopencontrols/driven_controls/predefined.py index ee529af3..879f02e8 100644 --- a/qctrlopencontrols/driven_controls/predefined.py +++ b/qctrlopencontrols/driven_controls/predefined.py @@ -65,7 +65,6 @@ def new_predefined_driven_control( Raised when an argument is invalid. """ - # Forced to import here to avoid cyclic imports, need to review # Raise error if the input driven_control_type is not known if scheme == PRIMITIVE: driven_control = _new_primitive_control(**kwargs) @@ -99,6 +98,7 @@ def new_predefined_driven_control( {'scheme': scheme}) return driven_control + def _predefined_common_attributes(maximum_rabi_rate, rabi_rotation, azimuthal_angle): diff --git a/qctrlopencontrols/dynamic_decoupling_sequences/dynamic_decoupling_sequence.py b/qctrlopencontrols/dynamic_decoupling_sequences/dynamic_decoupling_sequence.py index 33eff97c..39986852 100644 --- a/qctrlopencontrols/dynamic_decoupling_sequences/dynamic_decoupling_sequence.py +++ b/qctrlopencontrols/dynamic_decoupling_sequences/dynamic_decoupling_sequence.py @@ -22,7 +22,6 @@ from ..base.utils import create_repr_from_attributes from ..exceptions.exceptions import ArgumentsValueError - from ..globals import ( QCTRL_EXPANDED, CSV, CYLINDRICAL) diff --git a/qctrlopencontrols/pyquil/__init__.py b/qctrlopencontrols/pyquil/__init__.py new file mode 100644 index 00000000..a2b61496 --- /dev/null +++ b/qctrlopencontrols/pyquil/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Q-CTRL Pty Ltd & Q-CTRL Inc +# +# 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. diff --git a/qctrlopencontrols/pyquil/program.py b/qctrlopencontrols/pyquil/program.py new file mode 100644 index 00000000..52e18a29 --- /dev/null +++ b/qctrlopencontrols/pyquil/program.py @@ -0,0 +1,197 @@ +# Copyright 2019 Q-CTRL Pty Ltd & Q-CTRL Inc +# +# 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. + +""" +============== +pyquil.program +============== +""" + +import numpy as np + +from pyquil import Program +from pyquil.gates import I, RX, RY, RZ, MEASURE +from pyquil.quil import Pragma + +from ..dynamic_decoupling_sequences.dynamic_decoupling_sequence import DynamicDecouplingSequence +from ..exceptions.exceptions import ArgumentsValueError +from ..globals import ( + FIX_DURATION_UNITARY, INSTANT_UNITARY) + + +def convert_dds_to_pyquil_program( + dynamic_decoupling_sequence, + target_qubits=None, + gate_time=0.1, + add_measurement=True, + algorithm=INSTANT_UNITARY): + + """Converts a Dynamic Decoupling Sequence into quantum program + as defined in Pyquil + + Parameters + ---------- + dynamic_decoupling_sequence : DynamicDecouplingSequence + The dynamic decoupling sequence + target_qubits : list, optional + List of integers specifying target qubits for the sequence operation; + defaults to None in which case 0-th Qubit is used + gate_time : float, optional + Time (in seconds) delay introduced by a gate; defaults to 0.1 + add_measurement : bool, optional + If True, the circuit contains a measurement operation for each of the + target qubits and a set of ClassicalRegister objects created with length + equal to `len(target_qubits)` + algorithm : str, optional + One of 'fixed duration unitary' or 'instant unitary'; In the case of + 'fixed duration unitary', the sequence operations are assumed to be + taking the amount of gate_time while 'instant unitary' assumes the sequence + operations are instantaneous (and hence does not contribute to the delay between + offsets). Defaults to 'instant unitary'. + + Returns + ------- + pyquil.Program + The Pyquil program containting gates specified by the rotations of + dynamic decoupling sequence + + + Raises + ------ + ArgumentsValueError + If any of the input parameters are invalid + + Notes + ----- + + Dynamic Decoupling Sequences (DDS) consist of idealized pulse operation. Theoretically, + these operations (pi-pulses in X,Y or Z) occur instantaneously. However, in practice, + pulses require time. Therefore, this method of converting an idealized sequence + results to a circuit that is only an approximate implementation of the idealized sequence. + + In idealized definition of DDS, `offsets` represents the instances within sequence + `duration` where a pulse occurs instantaneously. A series of appropriate gatges + is placed in order to represent these pulses. The `gaps` or idle time in between active + pulses are filled up with `identity` gates. Each identity gate introduces a delay of + `gate_time`. In this implementation, the number of identity gates is determined by + :math:`np.int(np.floor(offset_distance / gate_time))`. As a consequence, the duration of + the real-circuit is :math:`gate_time \\times number_of_identity_gates + + pulse_gate_time \\times number_of_pulses`. + + Q-CTRL Open Controls support operation resulting in rotation around at most one axis at + any offset. + """ + + if dynamic_decoupling_sequence is None: + raise ArgumentsValueError('No dynamic decoupling sequence provided.', + {'dynamic_decoupling_sequence': dynamic_decoupling_sequence}) + + if not isinstance(dynamic_decoupling_sequence, DynamicDecouplingSequence): + raise ArgumentsValueError('Dynamical decoupling sequence is not recognized.' + 'Expected DynamicDecouplingSequence instance', + {'type(dynamic_decoupling_sequence)': + type(dynamic_decoupling_sequence)}) + + target_qubits = target_qubits or [0] + + if gate_time <= 0: + raise ArgumentsValueError( + 'Time delay of identity gate must be greater than zero.', + {'gate_time': gate_time}) + + if np.any(target_qubits) < 0: + raise ArgumentsValueError( + 'Every target qubits index must be non-negative.', + {'target_qubits': target_qubits}) + + if algorithm not in [FIX_DURATION_UNITARY, INSTANT_UNITARY]: + raise ArgumentsValueError('Algorithm must be one of {} or {}'.format( + INSTANT_UNITARY, FIX_DURATION_UNITARY), {'algorithm': algorithm}) + + unitary_time = 0. + if algorithm == FIX_DURATION_UNITARY: + unitary_time = gate_time + + rabi_rotations = dynamic_decoupling_sequence.rabi_rotations + azimuthal_angles = dynamic_decoupling_sequence.azimuthal_angles + detuning_rotations = dynamic_decoupling_sequence.detuning_rotations + + offsets = dynamic_decoupling_sequence.offsets + + time_covered = 0 + program = Program() + program += Pragma('PRESERVE_BLOCK') + + for offset, rabi_rotation, azimuthal_angle, detuning_rotation in zip( + list(offsets), list(rabi_rotations), + list(azimuthal_angles), list(detuning_rotations)): + + offset_distance = offset - time_covered + + if np.isclose(offset_distance, 0.0): + offset_distance = 0.0 + + if offset_distance < 0: + raise ArgumentsValueError( + "Offsets cannot be placed properly. Spacing between the rotations" + "is smaller than the time required to perform the rotation. Provide" + "a longer dynamic decoupling sequence or shorted gate time.", + {'dynamic_decoupling_sequence': dynamic_decoupling_sequence, + 'gate_time': gate_time}) + + while (time_covered+gate_time) <= offset: + for qubit in target_qubits: + program += I(qubit) + time_covered += gate_time + + x_rotation = rabi_rotation * np.cos(azimuthal_angle) + y_rotation = rabi_rotation * np.sin(azimuthal_angle) + z_rotation = detuning_rotation + + rotations = np.array([x_rotation, y_rotation, z_rotation]) + zero_pulses = np.isclose(rotations, 0.0).astype(np.int) + nonzero_pulse_counts = 3 - np.sum(zero_pulses) + if nonzero_pulse_counts > 1: + raise ArgumentsValueError( + 'Open Controls support a sequence with one ' + 'valid rotation at any offset. Found a sequence ' + 'with multiple rotation operations at an offset.', + {'dynamic_decoupling_sequence': dynamic_decoupling_sequence}, + extras={'offset': offset, + 'rabi_rotation': rabi_rotation, + 'azimuthal_angle': azimuthal_angle, + 'detuning_rotation': detuning_rotation} + ) + + for qubit in target_qubits: + if nonzero_pulse_counts == 0: + program += I(qubit) + else: + if not np.isclose(rotations[0], 0.0): + program += RX(rotations[0], qubit) + elif not np.isclose(rotations[1], 0.0): + program += RY(rotations[1], qubit) + elif not np.isclose(rotations[2], 0.): + program += RZ(rotations[2], qubit) + + time_covered = offset + unitary_time + + if add_measurement: + readout = program.declare('ro', 'BIT', len(target_qubits)) + for idx, qubit in enumerate(target_qubits): + program += MEASURE(qubit, readout[idx]) + + program += Pragma('END_PRESERVE_BLOCK') + + return program diff --git a/qctrlopencontrols/qiskit/quantum_circuit.py b/qctrlopencontrols/qiskit/quantum_circuit.py index e5177453..ca348cab 100644 --- a/qctrlopencontrols/qiskit/quantum_circuit.py +++ b/qctrlopencontrols/qiskit/quantum_circuit.py @@ -107,8 +107,7 @@ def convert_dds_to_qiskit_quantum_circuit( {'type(dynamic_decoupling_sequence)': type(dynamic_decoupling_sequence)}) - if target_qubits is None: - target_qubits = [0] + target_qubits = target_qubits or [0] if gate_time <= 0: raise ArgumentsValueError( @@ -117,7 +116,7 @@ def convert_dds_to_qiskit_quantum_circuit( if np.any(target_qubits) < 0: raise ArgumentsValueError( - 'Every target qubits index must be positive.', + 'Every target qubits index must be non-negative.', {'target_qubits': target_qubits}) if algorithm not in [FIX_DURATION_UNITARY, INSTANT_UNITARY]: @@ -152,40 +151,35 @@ def convert_dds_to_qiskit_quantum_circuit( azimuthal_angles = dynamic_decoupling_sequence.azimuthal_angles detuning_rotations = dynamic_decoupling_sequence.detuning_rotations - if len(rabi_rotations.shape) == 1: - rabi_rotations = rabi_rotations[np.newaxis, :] - if len(azimuthal_angles.shape) == 1: - azimuthal_angles = azimuthal_angles[np.newaxis, :] - if len(detuning_rotations.shape) == 1: - detuning_rotations = detuning_rotations[np.newaxis, :] - - operations = np.vstack((rabi_rotations, azimuthal_angles, detuning_rotations)) offsets = dynamic_decoupling_sequence.offsets time_covered = 0 - for operation_idx in range(operations.shape[1]): + for offset, rabi_rotation, azimuthal_angle, detuning_rotation in zip( + list(offsets), list(rabi_rotations), + list(azimuthal_angles), list(detuning_rotations)): - offset_distance = offsets[operation_idx] - time_covered + offset_distance = offset - time_covered if np.isclose(offset_distance, 0.0): offset_distance = 0.0 if offset_distance < 0: - raise ArgumentsValueError("Offsets cannot be placed properly", - {'sequence_operations': operations}) - - if offset_distance > 0: - while (time_covered+gate_time) <= offsets[operation_idx]: - for qubit in target_qubits: - quantum_circuit.iden(quantum_registers[qubit]) # pylint: disable=no-member - quantum_circuit.barrier(quantum_registers[qubit]) # pylint: disable=no-member - time_covered += gate_time - - rabi_rotation = operations[0, operation_idx] - azimuthal_angle = operations[1, operation_idx] + raise ArgumentsValueError( + "Offsets cannot be placed properly. Spacing between the rotations" + "is smaller than the time required to perform the rotation. Provide" + "a longer dynamic decoupling sequence or shorted gate time.", + {'dynamic_decoupling_sequence': dynamic_decoupling_sequence, + 'gate_time': gate_time}) + + while (time_covered+gate_time) <= offset: + for qubit in target_qubits: + quantum_circuit.iden(quantum_registers[qubit]) # pylint: disable=no-member + quantum_circuit.barrier(quantum_registers[qubit]) # pylint: disable=no-member + time_covered += gate_time + x_rotation = rabi_rotation * np.cos(azimuthal_angle) y_rotation = rabi_rotation * np.sin(azimuthal_angle) - z_rotation = operations[2, operation_idx] + z_rotation = detuning_rotation rotations = np.array([x_rotation, y_rotation, z_rotation]) zero_pulses = np.isclose(rotations, 0.0).astype(np.int) @@ -193,16 +187,13 @@ def convert_dds_to_qiskit_quantum_circuit( if nonzero_pulse_counts > 1: raise ArgumentsValueError( 'Open Controls support a sequence with one ' - 'valid pulse at any offset. Found sequence ' + 'valid rotation at any offset. Found a sequence ' 'with multiple rotation operations at an offset.', - {'dynamic_decoupling_sequence': str(dynamic_decoupling_sequence), - 'offset': dynamic_decoupling_sequence.offsets[operation_idx], - 'rabi_rotation': dynamic_decoupling_sequence.rabi_rotations[ - operation_idx], - 'azimuthal_angle': dynamic_decoupling_sequence.azimuthal_angles[ - operation_idx], - 'detuning_rotaion': dynamic_decoupling_sequence.detuning_rotations[ - operation_idx]} + {'dynamic_decoupling_sequence': dynamic_decoupling_sequence}, + extras={'offset': offset, + 'rabi_rotation': rabi_rotation, + 'azimuthal_angle': azimuthal_angle, + 'detuning_rotation': detuning_rotation} ) for qubit in target_qubits: @@ -225,10 +216,7 @@ def convert_dds_to_qiskit_quantum_circuit( quantum_registers[qubit]) quantum_circuit.barrier(quantum_registers[qubit]) # pylint: disable=no-member - if np.isclose(np.sum(rotations), 0.0): - time_covered = offsets[operation_idx] - else: - time_covered = offsets[operation_idx] + unitary_time + time_covered = offset + unitary_time if add_measurement: for q_index, qubit in enumerate(target_qubits): diff --git a/setup.py b/setup.py index b8724f42..e8b68da5 100644 --- a/setup.py +++ b/setup.py @@ -33,8 +33,8 @@ license='Apache-2.0', keywords='quantum computing open source engineering', classifiers=['Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3.6', 'Topic :: Scientific/Engineering :: Physics', 'Topic :: Scientific/Engineering :: Visualization', 'Topic :: Software Development :: Embedded Systems', 'Topic :: System :: Distributed Computing'], - packages=['qctrlopencontrols', 'qctrlopencontrols.base', 'qctrlopencontrols.cirq', 'qctrlopencontrols.driven_controls', 'qctrlopencontrols.dynamic_decoupling_sequences', 'qctrlopencontrols.exceptions', 'qctrlopencontrols.globals', 'qctrlopencontrols.qiskit'], + packages=['qctrlopencontrols', 'qctrlopencontrols.base', 'qctrlopencontrols.cirq', 'qctrlopencontrols.driven_controls', 'qctrlopencontrols.dynamic_decoupling_sequences', 'qctrlopencontrols.exceptions', 'qctrlopencontrols.globals', 'qctrlopencontrols.pyquil', 'qctrlopencontrols.qiskit'], package_data={}, - install_requires=['cirq==0.*,>=0.5.0', 'numpy==1.*,>=1.16.0', 'qiskit-ibmq-provider==0.*,>=0.2.2', 'qiskit-terra==0.*,>=0.8.1', 'scipy==1.*,>=1.3.0'], + install_requires=['cirq==0.*,>=0.5.0', 'numpy==1.*,>=1.16.0', 'pyquil==2.*,>=2.9.0', 'qiskit-ibmq-provider==0.*,>=0.2.2', 'qiskit-terra==0.*,>=0.8.1', 'scipy==1.*,>=1.3.0'], extras_require={'dev': ['pylama', 'pylint', 'pylint-runner', 'pytest']}, ) diff --git a/tests/test_cirq_circuits.py b/tests/test_cirq_sequence.py similarity index 100% rename from tests/test_cirq_circuits.py rename to tests/test_cirq_sequence.py diff --git a/tests/test_pyquil_sequence.py b/tests/test_pyquil_sequence.py new file mode 100644 index 00000000..fd38ac5a --- /dev/null +++ b/tests/test_pyquil_sequence.py @@ -0,0 +1,67 @@ +# Copyright 2019 Q-CTRL Pty Ltd & Q-CTRL Inc +# +# 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. + +""" +=================================== +Tests converstion to Pyquil program +=================================== +""" + +import numpy as np + +from pyquil.gates import RX, RY, RZ, I +from pyquil.quil import Pragma + +from qctrlopencontrols import ( + DynamicDecouplingSequence, + convert_dds_to_pyquil_program) + +def test_pyquil_program(): + + """Tests if the Dynamic Decoupling Sequence gives rise to Identity + operation in Pyquil + """ + _duration = 5e-6 + _offsets = [0, 1e-6, 2.5e-6, 4e-6, 5e-6] + _rabi_rotations = [np.pi / 2, np.pi / 2, np.pi, 0, np.pi / 2] + _azimuthal_angles = [0, 0, np.pi / 2, 0, 0] + _detuning_rotations = [0, 0, 0, np.pi, 0] + + sequence = DynamicDecouplingSequence( + duration=_duration, + offsets=_offsets, + rabi_rotations=_rabi_rotations, + azimuthal_angles=_azimuthal_angles, + detuning_rotations=_detuning_rotations) + + program = convert_dds_to_pyquil_program( + sequence, + [0], + gate_time=1e-6) + + assert len(program) == 13 + assert program[0] == Pragma("PRESERVE_BLOCK") + assert program[-1] == Pragma("END_PRESERVE_BLOCK") + assert program[1] == RX(np.pi/2, 0) + assert program[2] == I(0) + assert program[3] == RX(np.pi / 2, 0) + assert program[4] == I(0) + assert program[5] == RY(np.pi, 0) + assert program[6] == I(0) + assert program[7] == RZ(np.pi, 0) + assert program[8] == I(0) + assert program[9] == RX(np.pi / 2, 0) + +if __name__ == '__main__': + test_pyquil_program()