Skip to content

Commit

Permalink
Fix implicit default optimization level to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
itoko committed Sep 26, 2022
1 parent 5824df6 commit 7f2396f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _truncate_inactive_qubits(


def _transform_clifford_circuit(circuit: QuantumCircuit, basis_gates: Tuple[str]) -> QuantumCircuit:
return transpile(circuit, basis_gates=list(basis_gates), optimization_level=0)
return transpile(circuit, basis_gates=list(basis_gates), optimization_level=1)


@lru_cache(maxsize=None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,11 @@ def __adjoint_clifford(self, op: SequenceElementType) -> SequenceElementType:
def _transpiled_circuits(self) -> List[QuantumCircuit]:
"""Return a list of experiment circuits, transpiled."""
has_custom_transpile_option = (
any(opt != "basis_gates" for opt in vars(self.transpile_options))
or self.transpile_options.get("optimization_level", 0) != 0
any(
opt not in {"basis_gates", "optimization_level"}
for opt in vars(self.transpile_options)
)
or self.transpile_options.get("optimization_level", 1) != 1
)
if self.num_qubits <= 2 and not has_custom_transpile_option:
transpiled = [
Expand Down

0 comments on commit 7f2396f

Please sign in to comment.