cirq-core 1.5.0.dev20250404021339__py3-none-any.whl → 1.5.0.dev20250404201823__py3-none-any.whl
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 cirq-core might be problematic. Click here for more details.
- cirq/_version.py +1 -1
- cirq/_version_test.py +1 -1
- cirq/contrib/qcircuit/qcircuit_pdf.py +7 -11
- cirq/contrib/qcircuit/qcircuit_pdf_test.py +10 -2
- {cirq_core-1.5.0.dev20250404021339.dist-info → cirq_core-1.5.0.dev20250404201823.dist-info}/METADATA +1 -1
- {cirq_core-1.5.0.dev20250404021339.dist-info → cirq_core-1.5.0.dev20250404201823.dist-info}/RECORD +9 -9
- {cirq_core-1.5.0.dev20250404021339.dist-info → cirq_core-1.5.0.dev20250404201823.dist-info}/LICENSE +0 -0
- {cirq_core-1.5.0.dev20250404021339.dist-info → cirq_core-1.5.0.dev20250404201823.dist-info}/WHEEL +0 -0
- {cirq_core-1.5.0.dev20250404021339.dist-info → cirq_core-1.5.0.dev20250404201823.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
cirq/_version_test.py
CHANGED
|
@@ -29,7 +29,6 @@ def circuit_to_pdf_using_qcircuit_via_tex(
|
|
|
29
29
|
qcircuit_kwargs=None,
|
|
30
30
|
clean_ext=('dvi', 'ps'),
|
|
31
31
|
documentclass='article',
|
|
32
|
-
prepare_only=False,
|
|
33
32
|
):
|
|
34
33
|
"""Compiles the QCircuit-based latex diagram of the given circuit.
|
|
35
34
|
|
|
@@ -43,8 +42,6 @@ def circuit_to_pdf_using_qcircuit_via_tex(
|
|
|
43
42
|
default, latexmk is used with the '-pdfps' flag, which produces
|
|
44
43
|
intermediary dvi and ps files.
|
|
45
44
|
documentclass: The documentclass of the latex file.
|
|
46
|
-
prepare_only: If True, only prepare the document, do not generate PDF.
|
|
47
|
-
Used only for testing.
|
|
48
45
|
|
|
49
46
|
Raises:
|
|
50
47
|
OSError, IOError: If cleanup fails.
|
|
@@ -61,11 +58,10 @@ def circuit_to_pdf_using_qcircuit_via_tex(
|
|
|
61
58
|
doc.packages.append(Package('qcircuit'))
|
|
62
59
|
doc.preamble.append(Package('inputenc', options=['utf8']))
|
|
63
60
|
doc.append(NoEscape(tex))
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
raise
|
|
61
|
+
doc.generate_pdf(filepath, **pdf_kwargs)
|
|
62
|
+
for ext in clean_ext:
|
|
63
|
+
try:
|
|
64
|
+
os.remove(filepath + '.' + ext)
|
|
65
|
+
except (OSError, IOError) as e:
|
|
66
|
+
if e.errno != errno.ENOENT:
|
|
67
|
+
raise # pragma: nocover
|
|
@@ -12,10 +12,18 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
from unittest import mock
|
|
16
|
+
|
|
17
|
+
import pylatex
|
|
18
|
+
|
|
15
19
|
import cirq
|
|
16
20
|
import cirq.contrib.qcircuit.qcircuit_pdf as qcircuit_pdf
|
|
17
21
|
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
@mock.patch.object(pylatex.Document, "generate_pdf")
|
|
24
|
+
def test_qcircuit_pdf(mock_generate_pdf):
|
|
20
25
|
circuit = cirq.Circuit(cirq.X(cirq.q(0)), cirq.CZ(cirq.q(0), cirq.q(1)))
|
|
21
|
-
qcircuit_pdf.circuit_to_pdf_using_qcircuit_via_tex(circuit, "/tmp/test_file"
|
|
26
|
+
qcircuit_pdf.circuit_to_pdf_using_qcircuit_via_tex(circuit, "/tmp/test_file")
|
|
27
|
+
mock_generate_pdf.assert_called_once_with(
|
|
28
|
+
"/tmp/test_file", compiler="latexmk", compiler_args=["-pdfps"]
|
|
29
|
+
)
|
{cirq_core-1.5.0.dev20250404021339.dist-info → cirq_core-1.5.0.dev20250404201823.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cirq-core
|
|
3
|
-
Version: 1.5.0.
|
|
3
|
+
Version: 1.5.0.dev20250404201823
|
|
4
4
|
Summary: A framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
|
|
5
5
|
Home-page: http://github.com/quantumlib/cirq
|
|
6
6
|
Author: The Cirq Developers
|
{cirq_core-1.5.0.dev20250404021339.dist-info → cirq_core-1.5.0.dev20250404201823.dist-info}/RECORD
RENAMED
|
@@ -4,8 +4,8 @@ cirq/_compat_test.py,sha256=0m3sYIyxRNv9jvAo6rzJ-cnbpny3KGnAByrbU7bApgQ,34720
|
|
|
4
4
|
cirq/_doc.py,sha256=yDyWUD_2JDS0gShfGRb-rdqRt9-WeL7DhkqX7np0Nko,2879
|
|
5
5
|
cirq/_import.py,sha256=cfocxtT1BJ4HkfZ-VO8YyIhPP-xfqHDkLrzz6eeO5U0,8421
|
|
6
6
|
cirq/_import_test.py,sha256=6K_v0riZJXOXUphHNkGA8MY-JcmGlezFaGmvrNhm3OQ,1015
|
|
7
|
-
cirq/_version.py,sha256=
|
|
8
|
-
cirq/_version_test.py,sha256=
|
|
7
|
+
cirq/_version.py,sha256=gDB3pvaiHg-ASTFdz8awrGgRtJyUfnKgWV9A7BmbWqQ,1206
|
|
8
|
+
cirq/_version_test.py,sha256=jVvr6hdlvevz_z9osskEc5xfRuoxNM3Xnv3ExYFPWao,147
|
|
9
9
|
cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=YVamU72nCUT5dG0bhAvRKVX5lXcZMNTwP3H36v-cYag,13615
|
|
11
11
|
cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
|
|
@@ -116,8 +116,8 @@ cirq/contrib/qcircuit/__init__.py,sha256=6-pIZQUK3LlPVGiPFI7HJTl2_O1P-Rts0MsdDgQ
|
|
|
116
116
|
cirq/contrib/qcircuit/qcircuit_diagram.py,sha256=pwaqM9CERfePRxH6Xx3PtMLVIcN1Z375DYfAhpkDVAs,2780
|
|
117
117
|
cirq/contrib/qcircuit/qcircuit_diagram_info.py,sha256=T1-FVcVgVtHG524MrhheqQ-GfiYY-tvKP3wH5ODcWl8,4560
|
|
118
118
|
cirq/contrib/qcircuit/qcircuit_diagram_info_test.py,sha256=2CEJ3LCA-kaBeZOAc-2RRG5wEIdQLQVTqBpQ7lV2MWI,2393
|
|
119
|
-
cirq/contrib/qcircuit/qcircuit_pdf.py,sha256=
|
|
120
|
-
cirq/contrib/qcircuit/qcircuit_pdf_test.py,sha256=
|
|
119
|
+
cirq/contrib/qcircuit/qcircuit_pdf.py,sha256=LwXyz5_Amz0RCE4gQKmPgVp6HLD89htEvawqhuKuY-E,2412
|
|
120
|
+
cirq/contrib/qcircuit/qcircuit_pdf_test.py,sha256=rpb146aadlvEIHPXPyZqRlSDte2ldlKuanKryJU3cnk,1078
|
|
121
121
|
cirq/contrib/qcircuit/qcircuit_test.py,sha256=g6lbhtkq85hKAwp1-dcU73LpAt0_RcmPKMApxd6X_6E,6041
|
|
122
122
|
cirq/contrib/quantum_volume/__init__.py,sha256=RF_nbmm9s9A8sLhsnb7aZnuuoeHnsvlRNuoK8nBBW2w,1038
|
|
123
123
|
cirq/contrib/quantum_volume/quantum_volume.py,sha256=x1nmPFHlp1ZAQC41aYZsHzvBvTRzNZ0azXb-a62ylsQ,19389
|
|
@@ -1209,8 +1209,8 @@ cirq/work/sampler.py,sha256=sW0RhIelGABAKbqTM58shwyyCPgf86JIv9IGdJe__js,19186
|
|
|
1209
1209
|
cirq/work/sampler_test.py,sha256=mdk1J-WrvbPUYhY41VhWf9_te4DnXr_XMPcugWwc4-I,13281
|
|
1210
1210
|
cirq/work/zeros_sampler.py,sha256=8_Ne6dBkDANtTZuql7Eb0Qg_E_P3-_gu-ybFzxTbKAQ,2356
|
|
1211
1211
|
cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
|
|
1212
|
-
cirq_core-1.5.0.
|
|
1213
|
-
cirq_core-1.5.0.
|
|
1214
|
-
cirq_core-1.5.0.
|
|
1215
|
-
cirq_core-1.5.0.
|
|
1216
|
-
cirq_core-1.5.0.
|
|
1212
|
+
cirq_core-1.5.0.dev20250404201823.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1213
|
+
cirq_core-1.5.0.dev20250404201823.dist-info/METADATA,sha256=IuBz7lTZvD97JHd6CxsVeyGc1KzPVTz4sYjDwYjzk2c,4584
|
|
1214
|
+
cirq_core-1.5.0.dev20250404201823.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
1215
|
+
cirq_core-1.5.0.dev20250404201823.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1216
|
+
cirq_core-1.5.0.dev20250404201823.dist-info/RECORD,,
|
{cirq_core-1.5.0.dev20250404021339.dist-info → cirq_core-1.5.0.dev20250404201823.dist-info}/LICENSE
RENAMED
|
File without changes
|
{cirq_core-1.5.0.dev20250404021339.dist-info → cirq_core-1.5.0.dev20250404201823.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|