qoro-divi 0.2.0b1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of qoro-divi might be problematic. Click here for more details.

Files changed (58) hide show
  1. qoro_divi-0.2.0b1/LICENSE +190 -0
  2. qoro_divi-0.2.0b1/LICENSES/Apache-2.0.txt +73 -0
  3. qoro_divi-0.2.0b1/PKG-INFO +57 -0
  4. qoro_divi-0.2.0b1/README.md +24 -0
  5. qoro_divi-0.2.0b1/divi/__init__.py +8 -0
  6. qoro_divi-0.2.0b1/divi/_pbar.py +73 -0
  7. qoro_divi-0.2.0b1/divi/circuits.py +139 -0
  8. qoro_divi-0.2.0b1/divi/exp/cirq/__init__.py +7 -0
  9. qoro_divi-0.2.0b1/divi/exp/cirq/_lexer.py +126 -0
  10. qoro_divi-0.2.0b1/divi/exp/cirq/_parser.py +889 -0
  11. qoro_divi-0.2.0b1/divi/exp/cirq/_qasm_export.py +37 -0
  12. qoro_divi-0.2.0b1/divi/exp/cirq/_qasm_import.py +35 -0
  13. qoro_divi-0.2.0b1/divi/exp/cirq/exception.py +21 -0
  14. qoro_divi-0.2.0b1/divi/exp/scipy/_cobyla.py +342 -0
  15. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/LICENCE.txt +28 -0
  16. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/__init__.py +263 -0
  17. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/cobyla/__init__.py +0 -0
  18. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/cobyla/cobyla.py +599 -0
  19. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/cobyla/cobylb.py +849 -0
  20. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/cobyla/geometry.py +240 -0
  21. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/cobyla/initialize.py +269 -0
  22. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/cobyla/trustregion.py +540 -0
  23. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/cobyla/update.py +331 -0
  24. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/__init__.py +0 -0
  25. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/_bounds.py +41 -0
  26. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/_linear_constraints.py +46 -0
  27. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/_nonlinear_constraints.py +64 -0
  28. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/_project.py +224 -0
  29. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/checkbreak.py +107 -0
  30. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/consts.py +48 -0
  31. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/evaluate.py +101 -0
  32. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/history.py +39 -0
  33. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/infos.py +30 -0
  34. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/linalg.py +452 -0
  35. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/message.py +336 -0
  36. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/powalg.py +131 -0
  37. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/preproc.py +393 -0
  38. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/present.py +5 -0
  39. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/ratio.py +56 -0
  40. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/redrho.py +49 -0
  41. qoro_divi-0.2.0b1/divi/exp/scipy/pyprima/common/selectx.py +346 -0
  42. qoro_divi-0.2.0b1/divi/interfaces.py +25 -0
  43. qoro_divi-0.2.0b1/divi/parallel_simulator.py +258 -0
  44. qoro_divi-0.2.0b1/divi/qasm.py +220 -0
  45. qoro_divi-0.2.0b1/divi/qem.py +191 -0
  46. qoro_divi-0.2.0b1/divi/qlogger.py +119 -0
  47. qoro_divi-0.2.0b1/divi/qoro_service.py +343 -0
  48. qoro_divi-0.2.0b1/divi/qprog/__init__.py +13 -0
  49. qoro_divi-0.2.0b1/divi/qprog/_graph_partitioning.py +619 -0
  50. qoro_divi-0.2.0b1/divi/qprog/_mlae.py +182 -0
  51. qoro_divi-0.2.0b1/divi/qprog/_qaoa.py +440 -0
  52. qoro_divi-0.2.0b1/divi/qprog/_vqe.py +275 -0
  53. qoro_divi-0.2.0b1/divi/qprog/_vqe_sweep.py +144 -0
  54. qoro_divi-0.2.0b1/divi/qprog/batch.py +235 -0
  55. qoro_divi-0.2.0b1/divi/qprog/optimizers.py +75 -0
  56. qoro_divi-0.2.0b1/divi/qprog/quantum_program.py +493 -0
  57. qoro_divi-0.2.0b1/divi/utils.py +116 -0
  58. qoro_divi-0.2.0b1/pyproject.toml +85 -0
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2025 Qoro Quantum Ltd
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,73 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright 2025 Qoro Quantum Ltd.
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.1
2
+ Name: qoro-divi
3
+ Version: 0.2.0b1
4
+ Summary:
5
+ Author: Ahmed Darwish
6
+ Author-email: ahmed@qoroquantum.de
7
+ Requires-Python: >=3.11,<3.13
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Requires-Dist: cirq-core (<1.5.0)
12
+ Requires-Dist: dill (>=0.4.0,<0.5.0)
13
+ Requires-Dist: matplotlib (>=3.10.3,<4.0.0)
14
+ Requires-Dist: mitiq (>=0.46,<0.47)
15
+ Requires-Dist: networkx (>=3.5,<4.0)
16
+ Requires-Dist: pennylane (>=0.40,<0.41)
17
+ Requires-Dist: ply (>=3.11,<4.0)
18
+ Requires-Dist: pymetis (>=2025.1.1,<2026.0.0)
19
+ Requires-Dist: pyqt6 (>=6.9.1,<7.0.0)
20
+ Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
21
+ Requires-Dist: qiskit (<2.0)
22
+ Requires-Dist: qiskit-aer (>=0.17.1,<0.18.0)
23
+ Requires-Dist: qiskit-algorithms (>=0.3.1,<0.4.0)
24
+ Requires-Dist: qiskit-ibm-runtime (>=0.37,<0.38)
25
+ Requires-Dist: qiskit-optimization (>=0.6.1,<0.7.0)
26
+ Requires-Dist: requests (>=2.32.4,<3.0.0)
27
+ Requires-Dist: rich (>=14.0.0,<15.0.0)
28
+ Requires-Dist: scikit-learn (>=1.7.0,<2.0.0)
29
+ Requires-Dist: scipy (<=1.15.2)
30
+ Requires-Dist: sympy (>=1.14.0,<2.0.0)
31
+ Description-Content-Type: text/markdown
32
+
33
+ # Divi
34
+
35
+ **Divi** is a Python library for generating quantum programs at scale. It allows users to parallelize quantum workloads, manage hardware or simulator execution, and interact with cloud-based compute clusters—all through a simple and flexible API.
36
+
37
+ Divi is designed to allow researchers, students, and enterprises to deploy quantum workloads efficiently across hybrid and distributed environments.
38
+
39
+ ---
40
+
41
+ ## 🚀 Features
42
+
43
+ - 🧠 **Smart Job Parallelization**: Automatically parallelizes your quantum programs based on task structure.
44
+ - 🌐 **Cloud Execution**: Send jobs to local or remote clusters with minimal configuration.
45
+ - 🔌 **Extensible API**: Easily integrate with your existing quantum stack.
46
+ - 📦 **Lightweight & Modular**: Install and use only what you need.
47
+
48
+ ---
49
+
50
+ ## 📦 Installation
51
+
52
+ [TODO]
53
+
54
+ ## 📚 Documentation
55
+
56
+ Full documentation is available at: <https://docs.qoroquantum.net/divi>
57
+
@@ -0,0 +1,24 @@
1
+ # Divi
2
+
3
+ **Divi** is a Python library for generating quantum programs at scale. It allows users to parallelize quantum workloads, manage hardware or simulator execution, and interact with cloud-based compute clusters—all through a simple and flexible API.
4
+
5
+ Divi is designed to allow researchers, students, and enterprises to deploy quantum workloads efficiently across hybrid and distributed environments.
6
+
7
+ ---
8
+
9
+ ## 🚀 Features
10
+
11
+ - 🧠 **Smart Job Parallelization**: Automatically parallelizes your quantum programs based on task structure.
12
+ - 🌐 **Cloud Execution**: Send jobs to local or remote clusters with minimal configuration.
13
+ - 🔌 **Extensible API**: Easily integrate with your existing quantum stack.
14
+ - 📦 **Lightweight & Modular**: Install and use only what you need.
15
+
16
+ ---
17
+
18
+ ## 📦 Installation
19
+
20
+ [TODO]
21
+
22
+ ## 📚 Documentation
23
+
24
+ Full documentation is available at: <https://docs.qoroquantum.net/divi>
@@ -0,0 +1,8 @@
1
+ # SPDX-FileCopyrightText: 2025 Qoro Quantum Ltd <divi@qoroquantum.de>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ from .qlogger import enable_logging
6
+ from .qoro_service import QoroService
7
+
8
+ enable_logging()
@@ -0,0 +1,73 @@
1
+ # SPDX-FileCopyrightText: 2025 Qoro Quantum Ltd <divi@qoroquantum.de>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ from typing import Optional
6
+
7
+ from rich.progress import (
8
+ BarColumn,
9
+ MofNCompleteColumn,
10
+ Progress,
11
+ ProgressColumn,
12
+ SpinnerColumn,
13
+ TextColumn,
14
+ )
15
+ from rich.text import Text
16
+
17
+
18
+ class ConditionalSpinnerColumn(ProgressColumn):
19
+ def __init__(self):
20
+ super().__init__()
21
+ self.spinner = SpinnerColumn("point")
22
+
23
+ def render(self, task):
24
+ status = task.fields.get("final_status")
25
+
26
+ if status in ("Success", "Failed"):
27
+ return Text("")
28
+
29
+ return self.spinner.render(task)
30
+
31
+
32
+ class PhaseStatusColumn(ProgressColumn):
33
+ def __init__(self, max_retries: int, table_column=None):
34
+ super().__init__(table_column)
35
+
36
+ self._max_retries = max_retries
37
+ self._last_message = ""
38
+
39
+ def render(self, task):
40
+ final_status = task.fields.get("final_status")
41
+
42
+ if final_status == "Success":
43
+ return Text("• Success! ✅", style="bold green")
44
+ elif final_status == "Failed":
45
+ return Text("• Failed! ❌", style="bold red")
46
+
47
+ message = task.fields.get("message")
48
+ if message != "":
49
+ self._last_message = message
50
+
51
+ poll_attempt = task.fields.get("poll_attempt")
52
+ if poll_attempt > 0:
53
+ return Text(
54
+ f"[{self._last_message}] Polling {poll_attempt}/{self._max_retries}"
55
+ )
56
+
57
+ return Text(f"[{self._last_message}]")
58
+
59
+
60
+ def make_progress_bar(
61
+ max_retries: Optional[int] = None, is_jupyter: bool = False
62
+ ) -> Progress:
63
+ return Progress(
64
+ TextColumn("[bold blue]{task.fields[job_name]}"),
65
+ BarColumn(),
66
+ MofNCompleteColumn(),
67
+ ConditionalSpinnerColumn(),
68
+ PhaseStatusColumn(max_retries=max_retries),
69
+ # For jupyter notebooks, refresh manually instead
70
+ auto_refresh=not is_jupyter,
71
+ # Give a dummy positive value if is_jupyter
72
+ refresh_per_second=10 if not is_jupyter else 999,
73
+ )
@@ -0,0 +1,139 @@
1
+ # SPDX-FileCopyrightText: 2025 Qoro Quantum Ltd <divi@qoroquantum.de>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ import re
6
+ from copy import deepcopy
7
+ from itertools import product
8
+ from typing import Literal, Optional
9
+
10
+ import dill
11
+ import pennylane as qml
12
+ from pennylane.transforms.core.transform_program import TransformProgram
13
+ from qiskit.qasm2 import dumps
14
+
15
+ from divi.qasm import to_openqasm
16
+ from divi.qem import QEMProtocol
17
+
18
+ TRANSFORM_PROGRAM = TransformProgram()
19
+ TRANSFORM_PROGRAM.add_transform(qml.transforms.split_to_single_terms)
20
+ TRANSFORM_PROGRAM.add_transform(qml.transforms.split_non_commuting)
21
+
22
+
23
+ class Circuit:
24
+ _id_counter = 0
25
+
26
+ def __init__(
27
+ self,
28
+ main_circuit,
29
+ tags: list[str],
30
+ qasm_circuits: list[str] = None,
31
+ ):
32
+ self.main_circuit = main_circuit
33
+ self.circuit_type = main_circuit.__module__.split(".")[0]
34
+ self.tags = tags
35
+
36
+ self.qasm_circuits = qasm_circuits
37
+
38
+ if self.qasm_circuits is None:
39
+ self.convert_to_qasm()
40
+
41
+ self.circuit_id = Circuit._id_counter
42
+ Circuit._id_counter += 1
43
+
44
+ def __str__(self):
45
+ return f"Circuit: {self.circuit_id}"
46
+
47
+ def convert_to_qasm(self):
48
+ if self.circuit_type == "pennylane":
49
+ self.qasm_circuits = to_openqasm(
50
+ self.main_circuit,
51
+ measurement_groups=[self.main_circuit.measurements],
52
+ return_measurements_separately=False,
53
+ )
54
+
55
+ elif self.circuit_type == "qiskit":
56
+ self.qasm_circuits = [dumps(self.main_circuit)]
57
+
58
+ else:
59
+ raise ValueError(
60
+ f"Invalid circuit type. Circuit type {self.circuit_type} not currently supported."
61
+ )
62
+
63
+
64
+ class MetaCircuit:
65
+ def __init__(
66
+ self,
67
+ main_circuit,
68
+ symbols,
69
+ grouping_strategy: Optional[Literal["wires", "default", "qwc"]] = None,
70
+ qem_protocol: Optional[QEMProtocol] = None,
71
+ ):
72
+ self.main_circuit = main_circuit
73
+ self.symbols = symbols
74
+ self.qem_protocol = qem_protocol
75
+
76
+ transform_program = deepcopy(TRANSFORM_PROGRAM)
77
+ transform_program[1].kwargs["grouping_strategy"] = grouping_strategy
78
+
79
+ qscripts, self.postprocessing_fn = transform_program((main_circuit,))
80
+
81
+ self.compiled_circuits_bodies, self.measurements = to_openqasm(
82
+ main_circuit,
83
+ measurement_groups=[qsc.measurements for qsc in qscripts],
84
+ return_measurements_separately=True,
85
+ # TODO: optimize later
86
+ measure_all=True,
87
+ symbols=self.symbols,
88
+ qem_protocol=qem_protocol,
89
+ )
90
+
91
+ # Need to store the measurement groups for computing
92
+ # expectation values later on, stripped of the `qml.expval` wrapper
93
+ self.measurement_groups = [
94
+ [meas.obs for meas in qsc.measurements] for qsc in qscripts
95
+ ]
96
+
97
+ def __getstate__(self):
98
+ state = self.__dict__.copy()
99
+ state["postprocessing_fn"] = dill.dumps(self.postprocessing_fn)
100
+ return state
101
+
102
+ def __setstate__(self, state):
103
+ state["postprocessing_fn"] = dill.loads(state["postprocessing_fn"])
104
+
105
+ self.__dict__.update(state)
106
+
107
+ def initialize_circuit_from_params(
108
+ self, param_list, tag_prefix: str = "", precision: int = 8
109
+ ) -> Circuit:
110
+ mapping = dict(
111
+ zip(
112
+ map(lambda x: re.escape(str(x)), self.symbols),
113
+ map(lambda x: f"{x:.{precision}f}", param_list),
114
+ )
115
+ )
116
+ pattern = re.compile("|".join(k for k in mapping.keys()))
117
+
118
+ final_qasm_strs = []
119
+ for circuit_body in self.compiled_circuits_bodies:
120
+ final_qasm_strs.append(
121
+ pattern.sub(lambda match: mapping[match.group(0)], circuit_body)
122
+ )
123
+
124
+ tags = []
125
+ qasm_circuits = []
126
+ for (i, body_str), (j, meas_str) in product(
127
+ enumerate(final_qasm_strs), enumerate(self.measurements)
128
+ ):
129
+ qasm_circuits.append(body_str + meas_str)
130
+
131
+ nonempty_subtags = filter(
132
+ None,
133
+ [tag_prefix, f"{self.qem_protocol.name}:{i}", str(j)],
134
+ )
135
+ tags.append("_".join(nonempty_subtags))
136
+
137
+ # Note: The main circuit's parameters are still in symbol form.
138
+ # Not sure if it is necessary for any useful application to parameterize them.
139
+ return Circuit(self.main_circuit, qasm_circuits=qasm_circuits, tags=tags)
@@ -0,0 +1,7 @@
1
+ # SPDX-FileCopyrightText: 2025 Qoro Quantum Ltd <divi@qoroquantum.de>
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ # TODO: delete whole module once Cirq properly supports parameters in openqasm 3.0
6
+ from . import _qasm_export # Does nothing, just initiates the patch
7
+ from ._qasm_import import cirq_circuit_from_qasm