chencrafts 1.1__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.
- chencrafts-1.1/LICENSE +29 -0
- chencrafts-1.1/MANIFEST.in +13 -0
- chencrafts-1.1/PKG-INFO +59 -0
- chencrafts-1.1/README.md +20 -0
- chencrafts-1.1/chencrafts/__init__.py +47 -0
- chencrafts-1.1/chencrafts/bsqubits/QEC_graph/__init__.py +36 -0
- chencrafts-1.1/chencrafts/bsqubits/QEC_graph/cat_tree.py +882 -0
- chencrafts-1.1/chencrafts/bsqubits/QEC_graph/edge.py +297 -0
- chencrafts-1.1/chencrafts/bsqubits/QEC_graph/graph.py +170 -0
- chencrafts-1.1/chencrafts/bsqubits/QEC_graph/node.py +640 -0
- chencrafts-1.1/chencrafts/bsqubits/QEC_graph/settings.py +3 -0
- chencrafts-1.1/chencrafts/bsqubits/__init__.py +62 -0
- chencrafts-1.1/chencrafts/bsqubits/batched_custom_sweeps.py +349 -0
- chencrafts-1.1/chencrafts/bsqubits/cat_ideal.py +324 -0
- chencrafts-1.1/chencrafts/bsqubits/cat_real.py +478 -0
- chencrafts-1.1/chencrafts/bsqubits/derive_var.py +938 -0
- chencrafts-1.1/chencrafts/bsqubits/error_rates.py +380 -0
- chencrafts-1.1/chencrafts/bsqubits/pulse_utils.py +59 -0
- chencrafts-1.1/chencrafts/bsqubits/systems.py +722 -0
- chencrafts-1.1/chencrafts/cqed/__init__.py +151 -0
- chencrafts-1.1/chencrafts/cqed/block_diag.py +186 -0
- chencrafts-1.1/chencrafts/cqed/crit_photon_num.py +715 -0
- chencrafts-1.1/chencrafts/cqed/custom_sweeps/__init__.py +16 -0
- chencrafts-1.1/chencrafts/cqed/custom_sweeps/crit_photon_num.py +123 -0
- chencrafts-1.1/chencrafts/cqed/custom_sweeps/decoherence.py +199 -0
- chencrafts-1.1/chencrafts/cqed/custom_sweeps/general.py +9 -0
- chencrafts-1.1/chencrafts/cqed/custom_sweeps/utils.py +59 -0
- chencrafts-1.1/chencrafts/cqed/decoherence.py +240 -0
- chencrafts-1.1/chencrafts/cqed/flexible_sweep.py +274 -0
- chencrafts-1.1/chencrafts/cqed/mode_assignment.py +337 -0
- chencrafts-1.1/chencrafts/cqed/pulses.py +787 -0
- chencrafts-1.1/chencrafts/cqed/qt_helper.py +387 -0
- chencrafts-1.1/chencrafts/cqed/scq_helper.py +59 -0
- chencrafts-1.1/chencrafts/cqed/spec_poly_fit.py +127 -0
- chencrafts-1.1/chencrafts/cqed/special_states.py +79 -0
- chencrafts-1.1/chencrafts/cqed/symbolic_bosons.py +111 -0
- chencrafts-1.1/chencrafts/projects/__init__.py +16 -0
- chencrafts-1.1/chencrafts/projects/fluxonium_tunable_coupler.py +2066 -0
- chencrafts-1.1/chencrafts/projects/protomon_disorder.py +356 -0
- chencrafts-1.1/chencrafts/projects/protomon_full_disorder.py +1142 -0
- chencrafts-1.1/chencrafts/py.typed +0 -0
- chencrafts-1.1/chencrafts/settings.py +18 -0
- chencrafts-1.1/chencrafts/toolbox/__init__.py +99 -0
- chencrafts-1.1/chencrafts/toolbox/data_processing.py +345 -0
- chencrafts-1.1/chencrafts/toolbox/gadgets.py +126 -0
- chencrafts-1.1/chencrafts/toolbox/optimize.py +1174 -0
- chencrafts-1.1/chencrafts/toolbox/plot.py +241 -0
- chencrafts-1.1/chencrafts/toolbox/save.py +139 -0
- chencrafts-1.1/chencrafts/toolbox/useless.py +84 -0
- chencrafts-1.1/chencrafts/version.py +2 -0
- chencrafts-1.1/chencrafts.egg-info/PKG-INFO +59 -0
- chencrafts-1.1/chencrafts.egg-info/SOURCES.txt +59 -0
- chencrafts-1.1/chencrafts.egg-info/dependency_links.txt +1 -0
- chencrafts-1.1/chencrafts.egg-info/not-zip-safe +1 -0
- chencrafts-1.1/chencrafts.egg-info/requires.txt +16 -0
- chencrafts-1.1/chencrafts.egg-info/top_level.txt +1 -0
- chencrafts-1.1/pyproject.toml +3 -0
- chencrafts-1.1/requirements.txt +9 -0
- chencrafts-1.1/setup.cfg +4 -0
- chencrafts-1.1/setup.py +74 -0
- chencrafts-1.1/tests/test_optimization.py +103 -0
chencrafts-1.1/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 and later, Danyang Chen
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
chencrafts-1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: chencrafts
|
|
3
|
+
Version: 1.1
|
|
4
|
+
Summary: CHEN CRAFTS, my personal toolbox!
|
|
5
|
+
Home-page: https://github.com/Harrinive/chencrafts
|
|
6
|
+
Author: Danyang Chen
|
|
7
|
+
Author-email: DanyangChen2026@u.northwestern.edu
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: personal toolbox,superconducting qubits,quantum mechanics
|
|
10
|
+
Platform: Linux
|
|
11
|
+
Platform: Mac OSX
|
|
12
|
+
Platform: Unix
|
|
13
|
+
Platform: Windows
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering
|
|
20
|
+
Classifier: Operating System :: MacOS
|
|
21
|
+
Classifier: Operating System :: POSIX
|
|
22
|
+
Classifier: Operating System :: Unix
|
|
23
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: matplotlib
|
|
28
|
+
Requires-Dist: numpy
|
|
29
|
+
Requires-Dist: scipy
|
|
30
|
+
Requires-Dist: tqdm
|
|
31
|
+
Requires-Dist: pandas
|
|
32
|
+
Requires-Dist: dill
|
|
33
|
+
Requires-Dist: pathos
|
|
34
|
+
Requires-Dist: scqubits
|
|
35
|
+
Requires-Dist: IPython
|
|
36
|
+
Provides-Extra: cqed
|
|
37
|
+
Requires-Dist: torch; extra == "cqed"
|
|
38
|
+
Requires-Dist: multiprocess; extra == "cqed"
|
|
39
|
+
Provides-Extra: bsqubits
|
|
40
|
+
Requires-Dist: networkx; extra == "bsqubits"
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
There are four main parts in this package: `Toolbox`, `cqed`, `bsqubits`, and `projects`. They serves for different purposes in Danyang's research.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Modules
|
|
47
|
+
- `Toolbox` (or `tb`): Toolbox includes functions for optimization, saving and loading data, etc. It is a general toolbox for all the projects.
|
|
48
|
+
|
|
49
|
+
- `cqed`: General codes for simulating the cqed systems. It includes simulations for pulse, decoherence, critical photon number, etc. I also define the FlexibleSweep class, inherited from the scqubits.ParameterSweep class, which helps to define swept parameters in a different way. Specifically, it has module `custom_sweeps` for a bunch of pre-defined custom sweeps, which can be used in `scqubits.ParameterSweep` class.
|
|
50
|
+
|
|
51
|
+
- `bsqubits` (or `bsq`): A package for simulating and studying some spacific systems, especially for the resonator-qubit systems. The code isn't general enough to be used for other systems. Very high level and practical. Specifically, it has module `QEC_graph` for simulating the cat code using a graph representation.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
- `projects` (or `prj`): A collection for all other projects, including files collected from other collaborators.
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
```bash
|
|
58
|
+
pip install chencrafts
|
|
59
|
+
```
|
chencrafts-1.1/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
CHEN CRAFTS, my personal toolbox!
|
|
2
|
+
=================================
|
|
3
|
+
|
|
4
|
+
There are four main parts in this package: `Toolbox`, `cqed`, `bsqubits`, and `projects`. They serves for different purposes in Danyang's research.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## Modules
|
|
8
|
+
- `Toolbox` (or `tb`): Toolbox includes functions for optimization, saving and loading data, etc. It is a general toolbox for all the projects.
|
|
9
|
+
|
|
10
|
+
- `cqed`: General codes for simulating the cqed systems. It includes simulations for pulse, decoherence, critical photon number, etc. I also define the FlexibleSweep class, inherited from the scqubits.ParameterSweep class, which helps to define swept parameters in a different way. Specifically, it has module `custom_sweeps` for a bunch of pre-defined custom sweeps, which can be used in `scqubits.ParameterSweep` class.
|
|
11
|
+
|
|
12
|
+
- `bsqubits` (or `bsq`): A package for simulating and studying some spacific systems, especially for the resonator-qubit systems. The code isn't general enough to be used for other systems. Very high level and practical. Specifically, it has module `QEC_graph` for simulating the cat code using a graph representation.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
- `projects` (or `prj`): A collection for all other projects, including files collected from other collaborators.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
```bash
|
|
19
|
+
pip install chencrafts
|
|
20
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from chencrafts.version import version as __version__
|
|
2
|
+
|
|
3
|
+
# import submodules
|
|
4
|
+
# when changed, remember to change setup.py
|
|
5
|
+
import chencrafts.bsqubits as bsq
|
|
6
|
+
import chencrafts.cqed as cqed
|
|
7
|
+
import chencrafts.projects as prj
|
|
8
|
+
import chencrafts.toolbox as tb
|
|
9
|
+
|
|
10
|
+
# set matplotlib
|
|
11
|
+
import matplotlib as _mpl
|
|
12
|
+
import matplotlib.font_manager as _mpl_font
|
|
13
|
+
from chencrafts.toolbox.plot import color_cyclers as _color_cyclers
|
|
14
|
+
_mpl.rcParams = _mpl.rcParamsDefault.copy()
|
|
15
|
+
# figure format
|
|
16
|
+
|
|
17
|
+
# set figure format in jupyter notebook
|
|
18
|
+
try:
|
|
19
|
+
get_ipython()
|
|
20
|
+
import matplotlib_inline.backend_inline as _backend_inline
|
|
21
|
+
_backend_inline.set_matplotlib_formats("png")
|
|
22
|
+
except NameError:
|
|
23
|
+
pass
|
|
24
|
+
|
|
25
|
+
# color cycle
|
|
26
|
+
_mpl.rcParams["axes.prop_cycle"] = _color_cyclers["PGL"]
|
|
27
|
+
_mpl.rcParams['text.usetex'] = False
|
|
28
|
+
# disable font warning message
|
|
29
|
+
font_selected = None
|
|
30
|
+
try:
|
|
31
|
+
font_names = _mpl_font.get_font_names()
|
|
32
|
+
for font in ["IBM Plex Sans", "Roboto", "Arial", "Helvetica"]:
|
|
33
|
+
if font in font_names:
|
|
34
|
+
font_selected = font
|
|
35
|
+
break
|
|
36
|
+
if not font_selected:
|
|
37
|
+
font_selected = "sans-serif"
|
|
38
|
+
except AttributeError:
|
|
39
|
+
font_selected = "sans-serif"
|
|
40
|
+
_mpl.rcParams["font.family"] = font_selected
|
|
41
|
+
|
|
42
|
+
# set numpy print options
|
|
43
|
+
import numpy as _np
|
|
44
|
+
_np.set_printoptions(precision=6, linewidth=130)
|
|
45
|
+
|
|
46
|
+
# public modules
|
|
47
|
+
__all__ = ["bsq", "cqed", "prj", "sf", "tb"]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from chencrafts.bsqubits.QEC_graph.node import (
|
|
2
|
+
StateNode,
|
|
3
|
+
StateEnsemble
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
from chencrafts.bsqubits.QEC_graph.edge import (
|
|
7
|
+
PropagatorEdge,
|
|
8
|
+
MeasurementEdge,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
from chencrafts.bsqubits.QEC_graph.graph import (
|
|
12
|
+
EvolutionGraph,
|
|
13
|
+
EvolutionTree,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
from chencrafts.bsqubits.QEC_graph.cat_tree import (
|
|
17
|
+
CatGraphBuilder,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
from chencrafts.bsqubits.QEC_graph.settings import (
|
|
21
|
+
IDEAL_STATE_THRESHOLD_0,
|
|
22
|
+
IDEAL_STATE_THRESHOLD_1,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
__all__ = [
|
|
26
|
+
'StateNode',
|
|
27
|
+
'StateEnsemble',
|
|
28
|
+
'PropagatorEdge',
|
|
29
|
+
'MeasurementEdge',
|
|
30
|
+
'EvolutionGraph',
|
|
31
|
+
'EvolutionTree',
|
|
32
|
+
'CatGraphBuilder',
|
|
33
|
+
|
|
34
|
+
'IDEAL_STATE_THRESHOLD_0',
|
|
35
|
+
'IDEAL_STATE_THRESHOLD_1',
|
|
36
|
+
]
|