Skip to content

Commit

Permalink
Fixed version mismatch qutip (rotation)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniSean committed Mar 27, 2024
1 parent 77d6afe commit ff8e4c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 9 additions & 8 deletions pycqed/analysis/tomography.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# except ImportError as e:
# logging.warning('Could not import qutip, tomo code will not work')
import qutip as qtp
from qutip.qip import operations
import numpy as np
import time
import scipy
Expand Down Expand Up @@ -38,10 +39,10 @@ class TomoAnalysis_JointRO():
# The set of single qubit rotation matrixes used in the tomography
# measurement (will be assumed to be used on all qubits)
rotation_matrixes = [qtp.identity(2), qtp.sigmax(),
qtp.rotation(qtp.sigmax(), np.pi / 2),
qtp.rotation(qtp.sigmay(), np.pi / 2),
qtp.rotation(qtp.sigmax(), -np.pi / 2),
qtp.rotation(qtp.sigmay(), -np.pi / 2)]
operations.gates.rotation(qtp.sigmax(), np.pi / 2),
operations.gates.rotation(qtp.sigmay(), np.pi / 2),
operations.gates.rotation(qtp.sigmax(), -np.pi / 2),
operations.gates.rotation(qtp.sigmay(), -np.pi / 2)]
measurement_operator_labels = ['I', 'X', 'x', 'y', '-x', '-y']
# MAKE SURE THE LABELS CORRESPOND TO THE ROTATION MATRIXES DEFINED ABOVE

Expand Down Expand Up @@ -1164,10 +1165,10 @@ def run_default_analysis(self, **kw):
TomoAnalysis_JointRO.rotation_matrixes = [
qtp.identity(2),
qtp.sigmax(),
qtp.rotation(qtp.sigmay(), np.pi / 2),
qtp.rotation(qtp.sigmay(), -np.pi / 2),
qtp.rotation(qtp.sigmax(), np.pi / 2),
qtp.rotation(qtp.sigmax(), -np.pi / 2)]
operations.gates.rotation(qtp.sigmay(), np.pi / 2),
operations.gates.rotation(qtp.sigmay(), -np.pi / 2),
operations.gates.rotation(qtp.sigmax(), np.pi / 2),
operations.gates.rotation(qtp.sigmax(), -np.pi / 2)]
TomoAnalysis_JointRO.measurement_operator_labels = ['I', 'X', 'y',
'-y', 'x', '-x']
TomoAnalysis_JointRO.measurement_basis = [qtp.identity(2),
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# If you are installing pycqed on your computer run
# `pip install qutip` before you install pycqed

qutip-qip
qcodes
numpy<=1.21 # Required for 3rd party packages that still rely on (deprecated) numpy dtype aliases. Such as np.float, np.complex, etc. (sklearn, ...)
cython
Expand Down Expand Up @@ -46,4 +47,5 @@ pytest
# cmake
# wheel
# # Manually build from source.
# qutechopenql @ git+https://github.com/DiCarloLab-Delft/OpenQL@82a9881bdb2c2f2b0620c14c549c436f21d1607c # Build from commit
# qutechopenql @ git+https://github.com/DiCarloLab-Delft/OpenQL@82a9881bdb2c2f2b0620c14c549c436f21d1607c # Build from commit
git+https://github.com/DiCarloLab-Delft/QCoCircuits

0 comments on commit ff8e4c1

Please sign in to comment.