forked from scqubits/scqubits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
166 lines (137 loc) · 4.65 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
"""scqubits: superconducting qubits in Python
===========================================
scqubits is an open-source Python library for simulating superconducting qubits. It is meant to give the user
a convenient way to obtain energy spectra of common superconducting qubits, plot energy levels as a function of
external parameters, calculate matrix elements etc. The library further provides an interface to QuTiP, making it
easy to work with composite Hilbert spaces consisting of coupled superconducting qubits and harmonic modes.
Internally, numerics within scqubits is carried out with the help of Numpy and Scipy; plotting capabilities rely on
Matplotlib.
If scqubits is helpful to you in your research, please support its continued
development and maintenance. Use of scqubits in research publications is
appropriately acknowledged by citing:
Peter Groszkowski and Jens Koch, 'scqubits: a Python package for superconducting qubits',
Quantum 5, 583 (2021). https://quantum-journal.org/papers/q-2021-11-17-583/
"""
#
# This file is part of scqubits.
#
# Copyright (c) 2019, Jens Koch and Peter Groszkowski
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
############################################################################
import os
import sys
import setuptools
DOCLINES = __doc__.split("\n")
CLASSIFIERS = """\
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Programming Language :: Python
Programming Language :: Python :: 3
Topic :: Scientific/Engineering
Operating System :: MacOS
Operating System :: POSIX
Operating System :: Unix
Operating System :: Microsoft :: Windows
"""
EXTRA_KWARGS = {}
# version information about scqubits goes here
MAJOR = 2
MINOR = 2
MICRO = 2
ISRELEASED = True
VERSION = "%d.%d.%d" % (MAJOR, MINOR, MICRO)
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(CURRENT_DIR, "requirements.txt")) as requirements:
INSTALL_REQUIRES = requirements.read().splitlines()
EXTRAS_REQUIRE = {
"graphics": ["matplotlib-label-lines (>=0.3.6)"],
"explorer": ["ipywidgets (>=7.5)"],
"h5-support": ["h5py (>=2.10)"],
"pathos": ["pathos", "dill"],
"fitting": ["lmfit"],
}
TESTS_REQUIRE = ["h5py (>=2.7.1)", "pathos", "dill", "ipywidgets", "pytest", "lmfit"]
PACKAGES = [
"scqubits",
"scqubits/core",
"scqubits/tests",
"scqubits/utils",
"scqubits/ui",
"scqubits/io_utils",
"scqubits/explorer",
]
PYTHON_VERSION = ">=3.6"
NAME = "scqubits"
AUTHOR = "Jens Koch, Peter Groszkowski"
AUTHOR_EMAIL = "[email protected], [email protected]"
LICENSE = "BSD"
DESCRIPTION = DOCLINES[0]
LONG_DESCRIPTION = "\n".join(DOCLINES[2:])
KEYWORDS = "superconducting qubits"
URL = "https://scqubits.readthedocs.io"
CLASSIFIERS = [_f for _f in CLASSIFIERS.split("\n") if _f]
PLATFORMS = ["Linux", "Mac OSX", "Unix", "Windows"]
def git_short_hash():
try:
git_str = "+" + os.popen('git log -1 --format="%h"').read().strip()
except OSError:
git_str = ""
else:
if git_str == "+": # fixes setuptools PEP issues with versioning
git_str = ""
return git_str
FULLVERSION = VERSION
if not ISRELEASED:
FULLVERSION += ".dev" + str(MICRO) + git_short_hash()
def write_version_py(filename="scqubits/version.py"):
cnt = """\
# THIS FILE IS GENERATED FROM scqubits SETUP.PY
short_version = '%(version)s'
version = '%(fullversion)s'
release = %(isrelease)s
"""
versionfile = open(filename, "w")
try:
versionfile.write(
cnt
% {
"version": VERSION,
"fullversion": FULLVERSION,
"isrelease": str(ISRELEASED),
}
)
finally:
versionfile.close()
local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
os.chdir(local_path)
sys.path.insert(0, local_path)
sys.path.insert(0, os.path.join(local_path, "scqubits")) # to retrieve _version
# always rewrite _version
if os.path.exists("scqubits/version.py"):
os.remove("scqubits/version.py")
write_version_py()
setuptools.setup(
name=NAME,
version=FULLVERSION,
packages=PACKAGES,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
license=LICENSE,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
keywords=KEYWORDS,
url=URL,
classifiers=CLASSIFIERS,
platforms=PLATFORMS,
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
tests_require=TESTS_REQUIRE,
zip_safe=False,
include_package_data=True,
python_requires=PYTHON_VERSION,
**EXTRA_KWARGS
)