Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions simulaqron/virtNode/pyqrackSimulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,9 @@ def add_qubit(self, newQubit):
phase1 = complex(newQubit[1]) / sqrt1MinProb

cMtrx = [sqrt1MinProb * phase0, sqrtProb * phase0, sqrtProb * phase1, -sqrt1MinProb * phase1]
dMtrx = [
cMtrx[0].real, cMtrx[0].imag, cMtrx[1].real, cMtrx[1].imag,
cMtrx[2].real, cMtrx[2].imag, cMtrx[3].real, cMtrx[3].imag
]

# Transform the new qubit into the correct state
self.engine.mtrx(dMtrx, qid)
self.engine.mtrx(cMtrx, qid)

return qid

Expand Down Expand Up @@ -238,7 +234,7 @@ def apply_onequbit_gate(self, gate, qubitNum):
Applies a unitary gate to the specified qubit.

Arguments:
gate The project Q gate to be applied
gate The pyqrack gate to be applied
qubitNum the number of the qubit this gate is applied to
"""
self.validate_qid(qubitNum)
Expand All @@ -250,7 +246,7 @@ def apply_twoqubit_gate(self, gate, qubit1, qubit2):
Applies a unitary gate to the two specified qubits.

Arguments:
gate The project Q gate to be applied
gate The pyqrack gate to be applied
qubit1 the first qubit
qubit2 the second qubit
"""
Expand Down