-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
58 lines (53 loc) · 1.55 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
import os
import sys
import subprocess
import setuptools
try:
import numpy as np
except ImportError:
subprocess.call([sys.executable, '-m', 'pip', 'install', 'numpy>=1.17'])
import numpy as np
try:
from Cython.Build import cythonize
except ImportError:
subprocess.call([sys.executable, '-m', 'pip', 'install', 'cython>=0.29'])
from Cython.Build import cythonize
from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize
from Cython.Distutils import build_ext
from distutils.core import setup
ext_modules = [
Extension(
"libs_qrem",
sources=[
"./libs_qrem/libs_qrem.pyx",
"./cpp/eigen_utils.cpp",
"./cpp/combinations.cpp",
"./cpp/hamming.cpp",
"./cpp/sgs_algorithm.cpp",
"./cpp/harger_higham.cpp",
"./cpp/qrem_filter.cpp",
"./cpp/ignis_filter.cpp",
"./cpp/delta_filter.cpp",
"./cpp/least_norm_filter.cpp",
"./cpp/mooney_etal_filter.cpp",
"./cpp/nation_etal_filter.cpp",
],
extra_compile_args=["-std=c++17", "-pthread"],
include_dirs=["./eigen"],
language="c++"
),
]
setup(
name="libs_qrem",
version="0.1.6",
description="efficient quantum readout error mitigation library",
cmdclass={"build_ext": build_ext},
ext_modules=cythonize(ext_modules, language_level=3),
include_dirs=[np.get_include()],
zip_safe=False,
packages=["libs_qrem"],
package_dir={
"libs_qrem": "libs_qrem"
},
)