浏览代码

Remove scipy dependency, add requirements.txt

master
Pete Shadbolt 9 年前
父节点
当前提交
0bbec5ce97
共有 4 个文件被更改,包括 19 次插入9 次删除
  1. +2
    -0
      .gitignore
  2. +6
    -8
      abp/qi.py
  3. +11
    -0
      requirements.txt
  4. +0
    -1
      tests/test_clifford.py

+ 2
- 0
.gitignore 查看文件

@@ -1,3 +1,5 @@
venv/
fresh_venv/
*.npy *.npy
*.cache *.cache
*.pkl *.pkl


+ 6
- 8
abp/qi.py 查看文件

@@ -7,7 +7,6 @@ And a circuit-model simulator
""" """


import numpy as np import numpy as np
from scipy.linalg import sqrtm
import itertools as it import itertools as it


def hermitian_conjugate(u): def hermitian_conjugate(u):
@@ -25,13 +24,12 @@ ha = hadamard = np.array([[1, 1], [1, -1]], dtype=complex) * ir2
ph = np.array([[1, 0], [0, 1j]], dtype=complex) ph = np.array([[1, 0], [0, 1j]], dtype=complex)
t = np.array([[1, 0], [0, np.exp(1j*np.pi/4)]], dtype=complex) t = np.array([[1, 0], [0, np.exp(1j*np.pi/4)]], dtype=complex)


sqy = sqrtm(1j * py)
msqy = np.array(sqrtm(-1j * py))
sqz = np.array(sqrtm(1j * pz))
msqz = np.array(sqrtm(-1j * pz))
sqx = np.array(sqrtm(1j * px))
msqx = np.array(sqrtm(-1j * px))
paulis = (px, py, pz)
sqx = np.array([[ 1.+0.j, -0.+1.j], [-0.+1.j, 1.-0.j]], dtype=complex)*ir2
msqx = np.array([[ 1.+0.j, 0.-1.j], [ 0.-1.j, 1.-0.j]], dtype=complex)*ir2
sqy = np.array([[ 1.+0.j, 1.+0.j], [-1.-0.j, 1.-0.j]], dtype=complex)*ir2
msqy = np.array([[ 1.+0.j, -1.-0.j], [ 1.+0.j, 1.-0.j]], dtype=complex)*ir2
sqz = np.array([[ 1.+1.j, 0.+0.j], [ 0.+0.j, 1.-1.j]], dtype=complex)*ir2
msqz = np.array([[ 1.-1.j, 0.+0.j], [ 0.+0.j, 1.+1.j]], dtype=complex)*ir2


# CZ gate # CZ gate
cz = np.array(np.eye(4), dtype=complex) cz = np.array(np.eye(4), dtype=complex)


+ 11
- 0
requirements.txt 查看文件

@@ -0,0 +1,11 @@
-e git+pete@rpi:gitpi/abp.git@68e7de7088ff268a21a7df05435120f328ad7eae#egg=abp-github/master
argparse==1.2.1
backports.ssl-match-hostname==3.5.0.1
decorator==4.0.9
networkx==1.11
numpy==1.11.0
six==1.10.0
tqdm==4.7.0
websocket-client==0.37.0
websocket-server==0.4
wsgiref==0.1.2

+ 0
- 1
tests/test_clifford.py 查看文件

@@ -1,5 +1,4 @@
from numpy import * from numpy import *
from scipy.linalg import sqrtm
from tqdm import tqdm from tqdm import tqdm
import itertools as it import itertools as it
from abp import clifford from abp import clifford


正在加载...
取消
保存