Skip to content

Commit

Permalink
Remove Imports
Browse files Browse the repository at this point in the history
  • Loading branch information
adamisntdead committed Jan 18, 2017
1 parent a97773f commit e0eb014
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions QuSim.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import random
import string
from math import e, log, pi, sqrt
from functools import reduce

import numpy as np
Expand Down Expand Up @@ -30,7 +27,7 @@ class gates:
[0, -1]
]),
# Hadamard Gate
'H': np.multiply(1. / sqrt(2), np.matrix([
'H': np.multiply(1. / np.sqrt(2), np.matrix([
[1, 1],
[1, -1]
])),
Expand All @@ -48,11 +45,11 @@ class gates:
# T & T Dagger / Pi over 8 Gate
'T': np.matrix([
[1, 0],
[0, e**(i * pi / 4.)]
[0, np.e**(i * np.pi / 4.)]
]),
'TDagger': np.matrix([
[1, 0],
[0, e**(i * pi / 4.)]
[0, np.e**(i * np.pi / 4.)]
]).conjugate().transpose()
}

Expand Down Expand Up @@ -121,7 +118,7 @@ def __init__(self, numQubits):
self.value = False

def applyGate(self, gate, qubit1, qubit2=-1):
if self.measured:
if self.value:
raise ValueError(
'Cannot Apply Gate to a Measured Quantum Register')
else:
Expand Down

0 comments on commit e0eb014

Please sign in to comment.