Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Procatv committed Jun 23, 2024
1 parent e13aa82 commit 076d1d9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/benchmarks/manipulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def dag_twirl(dag, twirled_gate="cx", seed=None):
}


class CircuitManipulate:
class TestCircuitManipulate:
def setup(self):
qasm_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "qasm")
self.qft_qasm = os.path.join(qasm_dir, "dtc_100_cx_12345.qasm")
Expand All @@ -143,10 +143,7 @@ def setup(self):
self.qv_qc = QuantumCircuit.from_qasm_file(self.qv_qasm)
self.dtc_qasm = os.path.join(qasm_dir, "dtc_100_cx_12345.qasm")
self.dtc_qc = QuantumCircuit.from_qasm_file(self.dtc_qasm)
self.muti = multi_control_circuit(16)
self.translate = generate_preset_pass_manager(1, basis_gates=["rx", "ry", "rz", "cz"])
self.translate.property_set = PropertySet()
self.out = self.translate.run(self.qv_qc)

def time_DTC100_twirling(self):
"""Perform Pauli-twirling on a 100Q QV
Expand All @@ -159,20 +156,23 @@ def time_multi_control_decompose(self):
"""Decompose a multi-control gate into the
basis [rx, ry, rz, cz]
"""

out = self.translate.run(self.muti)
circ = multi_control_circuit(16)
self.translate.property_set = PropertySet()
out = self.translate.run(circ)
return out

def time_QV100_basis_change(self):
"""Change a QV100 circuit basis from [rx, ry, rz, cx]
to [sx, x, rz, cz]
"""

self.translate.property_set = PropertySet()
out = self.translate.run(self.qv_qc)
return out

def time_DTC100_twirling_dag(self):
"""Perform Pauli-twirling on a 100Q QV
circuit
"""
return circuit_to_dag(self.out)
self.translate.property_set = PropertySet()
out = self.translate.run(self.qv_qc)
return circuit_to_dag(out)

0 comments on commit 076d1d9

Please sign in to comment.