Skip to content

Commit

Permalink
add generator of circuits
Browse files Browse the repository at this point in the history
  • Loading branch information
itoko committed Dec 22, 2023
1 parent f92f8f6 commit 3acc38a
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ def circuits(self) -> List[QuantumCircuit]:
Returns:
A list of :class:`QuantumCircuit`.
"""
return list(self.circuits_generator())

def circuits_generator(self) -> Iterable[QuantumCircuit]:
"""Generate physical circuits to measure layer fidelity.
Returns:
A generator of :class:`QuantumCircuit`s.
"""
opts = self.experiment_options
residal_qubits_by_layer = [self.__residual_qubits(layer) for layer in opts.two_qubit_layers]
rng = default_rng(seed=opts.seed)
Expand Down Expand Up @@ -325,9 +333,7 @@ def circuits(self) -> List[QuantumCircuit]:
],
"composite_index": [i_set],
}
circuits.append(circ)

return circuits
yield circ

@staticmethod
def __circuit_body(
Expand Down

0 comments on commit 3acc38a

Please sign in to comment.