quantify 0.0.0a0__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.
- quantify/__init__.py +78 -0
- quantify/_static_version.py +2 -0
- quantify/_version.py +195 -0
- quantify/analysis/__init__.py +30 -0
- quantify/analysis/base_analysis.py +1094 -0
- quantify/analysis/calibration.py +141 -0
- quantify/analysis/conditional_oscillation_analysis.py +279 -0
- quantify/analysis/cosine_analysis.py +97 -0
- quantify/analysis/fitting_models.py +741 -0
- quantify/analysis/interpolation_analysis.py +82 -0
- quantify/analysis/optimization_analysis.py +135 -0
- quantify/analysis/readout_calibration_analysis.py +286 -0
- quantify/analysis/schemas/__init__.py +3 -0
- quantify/analysis/single_qubit_timedomain.py +756 -0
- quantify/analysis/spectroscopy_analysis.py +769 -0
- quantify/analysis/time_of_flight_analysis.py +160 -0
- quantify/analysis/types.py +37 -0
- quantify/backends/__init__.py +12 -0
- quantify/backends/circuit_to_device.py +832 -0
- quantify/backends/graph_compilation.py +613 -0
- quantify/backends/mock/__init__.py +3 -0
- quantify/backends/mock/mock_rom.py +118 -0
- quantify/backends/types/__init__.py +3 -0
- quantify/backends/types/common.py +352 -0
- quantify/compilation.py +277 -0
- quantify/data/__init__.py +3 -0
- quantify/data/dataset_adapters.py +193 -0
- quantify/data/dataset_attrs.py +382 -0
- quantify/data/experiment.py +252 -0
- quantify/data/handling.py +1472 -0
- quantify/data/types.py +103 -0
- quantify/device_under_test/__init__.py +15 -0
- quantify/device_under_test/composite_square_edge.py +128 -0
- quantify/device_under_test/device_element.py +54 -0
- quantify/device_under_test/edge.py +90 -0
- quantify/device_under_test/mock_setup.py +154 -0
- quantify/device_under_test/quantum_device.py +436 -0
- quantify/device_under_test/transmon_element.py +653 -0
- quantify/enums.py +74 -0
- quantify/helpers/__init__.py +3 -0
- quantify/helpers/collections.py +70 -0
- quantify/helpers/deprecation.py +74 -0
- quantify/helpers/importers.py +45 -0
- quantify/helpers/inspect.py +156 -0
- quantify/helpers/schedule.py +253 -0
- quantify/helpers/validators.py +139 -0
- quantify/helpers/waveforms.py +561 -0
- quantify/instrument_coordinator/__init__.py +7 -0
- quantify/instrument_coordinator/components/__init__.py +16 -0
- quantify/instrument_coordinator/components/base.py +154 -0
- quantify/instrument_coordinator/components/generic.py +139 -0
- quantify/instrument_coordinator/instrument_coordinator.py +406 -0
- quantify/instrument_coordinator/utility.py +181 -0
- quantify/json_utils.py +466 -0
- quantify/math.py +36 -0
- quantify/measurement/__init__.py +3 -0
- quantify/measurement/control.py +1295 -0
- quantify/measurement/schemas/__init__.py +3 -0
- quantify/measurement/types.py +91 -0
- quantify/operations/__init__.py +138 -0
- quantify/operations/acquisition_library.py +936 -0
- quantify/operations/composite_factories.py +62 -0
- quantify/operations/control_flow_library.py +273 -0
- quantify/operations/gate_library.py +802 -0
- quantify/operations/measurement_factories.py +824 -0
- quantify/operations/operation.py +338 -0
- quantify/operations/pulse_compensation_library.py +120 -0
- quantify/operations/pulse_factories.py +333 -0
- quantify/operations/pulse_library.py +1187 -0
- quantify/pulse_compensation.py +317 -0
- quantify/resources.py +169 -0
- quantify/schedules/__init__.py +57 -0
- quantify/schedules/_visualization/__init__.py +13 -0
- quantify/schedules/_visualization/circuit_diagram.py +787 -0
- quantify/schedules/_visualization/constants.py +22 -0
- quantify/schedules/_visualization/pulse_diagram.py +989 -0
- quantify/schedules/_visualization/pulse_scheme.py +506 -0
- quantify/schedules/schedule.py +1143 -0
- quantify/schedules/spectroscopy_schedules.py +514 -0
- quantify/schedules/timedomain_schedules.py +638 -0
- quantify/schedules/trace_schedules.py +394 -0
- quantify/schedules/two_qubit_transmon_schedules.py +117 -0
- quantify/schedules/verification.py +327 -0
- quantify/schemas/__init__.py +3 -0
- quantify/structure/__init__.py +14 -0
- quantify/structure/model.py +98 -0
- quantify/structure/types.py +128 -0
- quantify/utilities/__init__.py +10 -0
- quantify/utilities/_tests_helpers.py +54 -0
- quantify/utilities/experiment_helpers.py +283 -0
- quantify/utilities/general.py +239 -0
- quantify/utilities/inspect_utils.py +116 -0
- quantify/visualization/SI_utilities.py +560 -0
- quantify/visualization/__init__.py +23 -0
- quantify/visualization/_appnope.py +30 -0
- quantify/visualization/color_utilities.py +86 -0
- quantify/visualization/ins_mon_widget/__init__.py +3 -0
- quantify/visualization/ins_mon_widget/qc_snapshot_widget.py +233 -0
- quantify/visualization/instrument_monitor.py +250 -0
- quantify/visualization/mpl_plotting.py +713 -0
- quantify/visualization/plot_interpolation.py +134 -0
- quantify/visualization/pyqt_plotmon.py +291 -0
- quantify/visualization/pyqt_plotmon_remote.py +778 -0
- quantify/waveforms.py +525 -0
- quantify-0.0.0a0.dist-info/METADATA +91 -0
- quantify-0.0.0a0.dist-info/RECORD +109 -0
- quantify-0.0.0a0.dist-info/WHEEL +5 -0
- quantify-0.0.0a0.dist-info/licenses/LICENSE +29 -0
- quantify-0.0.0a0.dist-info/top_level.txt +1 -0
quantify/__init__.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Repository: https://gitlab.com/quantify-os/quantify
|
|
2
|
+
# Licensed according to the LICENSE file on the main branch
|
|
3
|
+
"""
|
|
4
|
+
Data acquisition framework focused on Quantum Computing and solid-state physics
|
|
5
|
+
experiments.
|
|
6
|
+
|
|
7
|
+
.. list-table::
|
|
8
|
+
:header-rows: 1
|
|
9
|
+
:widths: auto
|
|
10
|
+
|
|
11
|
+
* - Import alias
|
|
12
|
+
- Target
|
|
13
|
+
* - :class:`.QuantumDevice`
|
|
14
|
+
- :class:`!quantify.QuantumDevice`
|
|
15
|
+
* - :class:`.Schedule`
|
|
16
|
+
- :class:`!quantify.Schedule`
|
|
17
|
+
* - :class:`.Resource`
|
|
18
|
+
- :class:`!quantify.Resource`
|
|
19
|
+
* - :class:`.ClockResource`
|
|
20
|
+
- :class:`!quantify.ClockResource`
|
|
21
|
+
* - :class:`.BasebandClockResource`
|
|
22
|
+
- :class:`!quantify.BasebandClockResource`
|
|
23
|
+
* - :class:`.DigitalClockResource`
|
|
24
|
+
- :class:`!quantify.DigitalClockResource`
|
|
25
|
+
* - :class:`.Operation`
|
|
26
|
+
- :class:`!quantify.Operation`
|
|
27
|
+
* - :obj:`.structure`
|
|
28
|
+
- :obj:`!quantify.structure`
|
|
29
|
+
* - :class:`.BasicTransmonElement`
|
|
30
|
+
- :class:`!quantify.BasicTransmonElement`
|
|
31
|
+
* - :class:`.CompositeSquareEdge`
|
|
32
|
+
- :class:`!quantify.CompositeSquareEdge`
|
|
33
|
+
* - :class:`.InstrumentCoordinator`
|
|
34
|
+
- :class:`!quantify.InstrumentCoordinator`
|
|
35
|
+
* - :class:`.GenericInstrumentCoordinatorComponent`
|
|
36
|
+
- :class:`!quantify.GenericInstrumentCoordinatorComponent`
|
|
37
|
+
* - :class:`.SerialCompiler`
|
|
38
|
+
- :class:`!quantify.SerialCompiler`
|
|
39
|
+
* - :class:`.MockLocalOscillator`
|
|
40
|
+
- :class:`!quantify.MockLocalOscillator`
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
from quantify import structure, waveforms
|
|
44
|
+
from quantify._version import __version__
|
|
45
|
+
from quantify.backends import SerialCompiler
|
|
46
|
+
from quantify.device_under_test import (
|
|
47
|
+
BasicTransmonElement,
|
|
48
|
+
QuantumDevice,
|
|
49
|
+
)
|
|
50
|
+
from quantify.instrument_coordinator.components.generic import (
|
|
51
|
+
GenericInstrumentCoordinatorComponent,
|
|
52
|
+
)
|
|
53
|
+
from quantify.instrument_coordinator.instrument_coordinator import InstrumentCoordinator
|
|
54
|
+
from quantify.operations import Operation
|
|
55
|
+
from quantify.resources import (
|
|
56
|
+
BasebandClockResource,
|
|
57
|
+
ClockResource,
|
|
58
|
+
DigitalClockResource,
|
|
59
|
+
Resource,
|
|
60
|
+
)
|
|
61
|
+
from quantify.schedules import Schedule
|
|
62
|
+
|
|
63
|
+
__all__ = [
|
|
64
|
+
"structure",
|
|
65
|
+
"__version__",
|
|
66
|
+
"SerialCompiler",
|
|
67
|
+
"BasicTransmonElement",
|
|
68
|
+
"QuantumDevice",
|
|
69
|
+
"InstrumentCoordinator",
|
|
70
|
+
"GenericInstrumentCoordinatorComponent",
|
|
71
|
+
"Operation",
|
|
72
|
+
"BasebandClockResource",
|
|
73
|
+
"ClockResource",
|
|
74
|
+
"DigitalClockResource",
|
|
75
|
+
"Resource",
|
|
76
|
+
"Schedule",
|
|
77
|
+
"waveforms",
|
|
78
|
+
]
|
quantify/_version.py
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is part of 'miniver': https://github.com/jbweston/miniver
|
|
3
|
+
#
|
|
4
|
+
from collections import namedtuple
|
|
5
|
+
import os
|
|
6
|
+
|
|
7
|
+
Version = namedtuple("Version", ("release", "dev", "labels"))
|
|
8
|
+
|
|
9
|
+
# No public API
|
|
10
|
+
__all__ = []
|
|
11
|
+
|
|
12
|
+
package_root = os.path.dirname(os.path.realpath(__file__))
|
|
13
|
+
package_name = os.path.basename(package_root)
|
|
14
|
+
|
|
15
|
+
STATIC_VERSION_FILE = "_static_version.py"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def get_version(version_file=STATIC_VERSION_FILE):
|
|
19
|
+
version_info = get_static_version_info(version_file)
|
|
20
|
+
version = version_info["version"]
|
|
21
|
+
if version == "__use_git__":
|
|
22
|
+
version = get_version_from_git()
|
|
23
|
+
if not version:
|
|
24
|
+
version = get_version_from_git_archive(version_info)
|
|
25
|
+
if not version:
|
|
26
|
+
version = Version("unknown", None, None)
|
|
27
|
+
return pep440_format(version)
|
|
28
|
+
else:
|
|
29
|
+
return version
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def get_static_version_info(version_file=STATIC_VERSION_FILE):
|
|
33
|
+
version_info = {}
|
|
34
|
+
with open(os.path.join(package_root, version_file), "rb") as f:
|
|
35
|
+
exec(f.read(), {}, version_info)
|
|
36
|
+
return version_info
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def version_is_from_git(version_file=STATIC_VERSION_FILE):
|
|
40
|
+
return get_static_version_info(version_file)["version"] == "__use_git__"
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def pep440_format(version_info):
|
|
44
|
+
release, dev, labels = version_info
|
|
45
|
+
|
|
46
|
+
version_parts = [release]
|
|
47
|
+
if dev:
|
|
48
|
+
if release.endswith("-dev") or release.endswith(".dev"):
|
|
49
|
+
version_parts.append(dev)
|
|
50
|
+
else: # prefer PEP440 over strict adhesion to semver
|
|
51
|
+
version_parts.append(".dev{}".format(dev))
|
|
52
|
+
|
|
53
|
+
if labels:
|
|
54
|
+
version_parts.append("+")
|
|
55
|
+
version_parts.append(".".join(labels))
|
|
56
|
+
|
|
57
|
+
return "".join(version_parts)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def get_version_from_git():
|
|
61
|
+
import subprocess
|
|
62
|
+
|
|
63
|
+
# git describe --first-parent does not take into account tags from branches
|
|
64
|
+
# that were merged-in. The '--long' flag gets us the 'dev' version and
|
|
65
|
+
# git hash, '--always' returns the git hash even if there are no tags.
|
|
66
|
+
for opts in [["--first-parent"], []]:
|
|
67
|
+
try:
|
|
68
|
+
p = subprocess.Popen(
|
|
69
|
+
["git", "describe", "--long", "--always"] + opts,
|
|
70
|
+
cwd=package_root,
|
|
71
|
+
stdout=subprocess.PIPE,
|
|
72
|
+
stderr=subprocess.PIPE,
|
|
73
|
+
)
|
|
74
|
+
except OSError:
|
|
75
|
+
return
|
|
76
|
+
if p.wait() == 0:
|
|
77
|
+
break
|
|
78
|
+
else:
|
|
79
|
+
return
|
|
80
|
+
|
|
81
|
+
description = (
|
|
82
|
+
p.communicate()[0]
|
|
83
|
+
.decode()
|
|
84
|
+
.strip("v") # Tags can have a leading 'v', but the version should not
|
|
85
|
+
.rstrip("\n")
|
|
86
|
+
.rsplit("-", 2) # Split the latest tag, commits since tag, and hash
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
try:
|
|
90
|
+
release, dev, git = description
|
|
91
|
+
except ValueError: # No tags, only the git hash
|
|
92
|
+
# prepend 'g' to match with format returned by 'git describe'
|
|
93
|
+
git = "g{}".format(*description)
|
|
94
|
+
release = "unknown"
|
|
95
|
+
dev = None
|
|
96
|
+
|
|
97
|
+
labels = []
|
|
98
|
+
if dev == "0":
|
|
99
|
+
dev = None
|
|
100
|
+
else:
|
|
101
|
+
labels.append(git)
|
|
102
|
+
|
|
103
|
+
try:
|
|
104
|
+
p = subprocess.Popen(
|
|
105
|
+
["git", "describe", "--dirty"],
|
|
106
|
+
cwd=package_root,
|
|
107
|
+
stdout=subprocess.PIPE,
|
|
108
|
+
stderr=subprocess.PIPE,
|
|
109
|
+
)
|
|
110
|
+
except OSError:
|
|
111
|
+
labels.append("confused") # This should never happen.
|
|
112
|
+
else:
|
|
113
|
+
dirty_output = p.communicate()[0].decode().strip("\n")
|
|
114
|
+
if dirty_output.endswith("dirty"):
|
|
115
|
+
labels.append("dirty")
|
|
116
|
+
|
|
117
|
+
return Version(release, dev, labels)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
# TODO: change this logic when there is a git pretty-format
|
|
121
|
+
# that gives the same output as 'git describe'.
|
|
122
|
+
# Currently we can only tell the tag the current commit is
|
|
123
|
+
# pointing to, or its hash (with no version info)
|
|
124
|
+
# if it is not tagged.
|
|
125
|
+
def get_version_from_git_archive(version_info):
|
|
126
|
+
try:
|
|
127
|
+
refnames = version_info["refnames"]
|
|
128
|
+
git_hash = version_info["git_hash"]
|
|
129
|
+
except KeyError:
|
|
130
|
+
# These fields are not present if we are running from an sdist.
|
|
131
|
+
# Execution should never reach here, though
|
|
132
|
+
return None
|
|
133
|
+
|
|
134
|
+
if git_hash.startswith("$Format") or refnames.startswith("$Format"):
|
|
135
|
+
# variables not expanded during 'git archive'
|
|
136
|
+
return None
|
|
137
|
+
|
|
138
|
+
VTAG = "tag: v"
|
|
139
|
+
refs = set(r.strip() for r in refnames.split(","))
|
|
140
|
+
version_tags = set(r[len(VTAG) :] for r in refs if r.startswith(VTAG))
|
|
141
|
+
if version_tags:
|
|
142
|
+
release, *_ = sorted(version_tags) # prefer e.g. "2.0" over "2.0rc1"
|
|
143
|
+
return Version(release, dev=None, labels=None)
|
|
144
|
+
else:
|
|
145
|
+
return Version("unknown", dev=None, labels=["g{}".format(git_hash)])
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
__version__ = get_version()
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
# The following section defines a 'get_cmdclass' function
|
|
152
|
+
# that can be used from setup.py. The '__version__' module
|
|
153
|
+
# global is used (but not modified).
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def _write_version(fname):
|
|
157
|
+
# This could be a hard link, so try to delete it first. Is there any way
|
|
158
|
+
# to do this atomically together with opening?
|
|
159
|
+
try:
|
|
160
|
+
os.remove(fname)
|
|
161
|
+
except OSError:
|
|
162
|
+
pass
|
|
163
|
+
with open(fname, "w") as f:
|
|
164
|
+
f.write(
|
|
165
|
+
"# This file has been created by setup.py.\n"
|
|
166
|
+
"version = '{}'\n".format(__version__)
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def get_cmdclass(pkg_source_path):
|
|
171
|
+
from setuptools.command.build_py import build_py as build_py_orig
|
|
172
|
+
from setuptools.command.sdist import sdist as sdist_orig
|
|
173
|
+
|
|
174
|
+
class _build_py(build_py_orig):
|
|
175
|
+
def run(self):
|
|
176
|
+
super().run()
|
|
177
|
+
|
|
178
|
+
src_marker = "".join(["src", os.path.sep])
|
|
179
|
+
|
|
180
|
+
if pkg_source_path.startswith(src_marker):
|
|
181
|
+
path = pkg_source_path[len(src_marker) :]
|
|
182
|
+
else:
|
|
183
|
+
path = pkg_source_path
|
|
184
|
+
_write_version(
|
|
185
|
+
os.path.join(self.build_lib, path, STATIC_VERSION_FILE)
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
class _sdist(sdist_orig):
|
|
189
|
+
def make_release_tree(self, base_dir, files):
|
|
190
|
+
super().make_release_tree(base_dir, files)
|
|
191
|
+
_write_version(
|
|
192
|
+
os.path.join(base_dir, pkg_source_path, STATIC_VERSION_FILE)
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
return dict(sdist=_sdist, build_py=_build_py)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Repository: https://gitlab.com/quantify-os/quantify
|
|
2
|
+
# Licensed according to the LICENSE file on the main branch
|
|
3
|
+
"""Quantify's analysis module."""
|
|
4
|
+
|
|
5
|
+
from .base_analysis import Basic2DAnalysis, BasicAnalysis
|
|
6
|
+
from .cosine_analysis import CosineAnalysis
|
|
7
|
+
from .interpolation_analysis import InterpolationAnalysis2D
|
|
8
|
+
from .optimization_analysis import OptimizationAnalysis
|
|
9
|
+
from .single_qubit_timedomain import (
|
|
10
|
+
AllXYAnalysis,
|
|
11
|
+
EchoAnalysis,
|
|
12
|
+
RabiAnalysis,
|
|
13
|
+
RamseyAnalysis,
|
|
14
|
+
T1Analysis,
|
|
15
|
+
)
|
|
16
|
+
from .spectroscopy_analysis import ResonatorSpectroscopyAnalysis
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"Basic2DAnalysis",
|
|
20
|
+
"BasicAnalysis",
|
|
21
|
+
"CosineAnalysis",
|
|
22
|
+
"InterpolationAnalysis2D",
|
|
23
|
+
"OptimizationAnalysis",
|
|
24
|
+
"AllXYAnalysis",
|
|
25
|
+
"EchoAnalysis",
|
|
26
|
+
"RabiAnalysis",
|
|
27
|
+
"RamseyAnalysis",
|
|
28
|
+
"T1Analysis",
|
|
29
|
+
"ResonatorSpectroscopyAnalysis",
|
|
30
|
+
]
|