Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
edyounis committed Sep 19, 2022
1 parent 30edf77 commit f540062
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/passes/synthesis/test_qpredict.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,28 @@ def test_small_qubit(self) -> None:
qpredict = QPredictDecompositionPass()
qpredict.run(circuit)
dist = circuit.get_unitary().get_distance_from(utry)
assert dist <= 1e-5
assert dist <= 1e-3

def test_small_qubit_with_compiler(self, compiler: Compiler) -> None:
utry = UnitaryMatrix.random(2)
circuit = Circuit.from_unitary(utry)
qpredict = QPredictDecompositionPass()
circuit = compiler.compile(CompilationTask(circuit, [qpredict]))
dist = circuit.get_unitary().get_distance_from(utry)
assert dist <= 1e-5
assert dist <= 1e-3

def test_3_qubit(self) -> None:
utry = UnitaryMatrix.random(3)
circuit = Circuit.from_unitary(utry)
qpredict = QPredictDecompositionPass()
qpredict.run(circuit)
dist = circuit.get_unitary().get_distance_from(utry)
assert dist <= 1e-4
assert dist <= 1e-3

def test_3_qubit_with_compiler(self, compiler: Compiler) -> None:
utry = UnitaryMatrix.random(3)
circuit = Circuit.from_unitary(utry)
qpredict = QPredictDecompositionPass()
circuit = compiler.compile(CompilationTask(circuit, [qpredict]))
dist = circuit.get_unitary().get_distance_from(utry)
assert dist <= 1e-4
assert dist <= 1e-3

0 comments on commit f540062

Please sign in to comment.