qiskit_noise_learning.circuit_generator.ExecutorCircuitGenerator
class qiskit_noise_learning.circuit_generator.ExecutorCircuitGenerator(gate_set: QiskitGateSet, creg_prefix: str = 'meas', local_clifford_ref_prefix: str = 'c', pass_manager: PassManager | None = None)
Bases: CircuitGenerator[QuantumProgram, ExecutorDataMapper, QuantumProgramResult]
A circuit generator that converts sequences of Qiskit gates into a samplex items.
Parameters
- gate_set – The Qiskit gate set that this generator constructs against.
- creg_prefix – The prefix assigned to all creg names used in instruction sequence measurements. Defaults to
"meas". - local_clifford_ref_prefix – The prefix assigned to all local Clifford parameter references in template circuits. Defaults to
"c". - pass_manager – An optional
PassManagerto apply to all template circuits produced byExecutorCircuitGenerator.generate().
__init__
__init__(gate_set: QiskitGateSet, creg_prefix: str = 'meas', local_clifford_ref_prefix: str = 'c', pass_manager: PassManager | None = None)
Methods
Column 1 | Column 2 |
|---|---|
__init__(gate_set[, creg_prefix, ...]) | |
collect(result, data_mapper) | Coerce data from a specific execution framework into a canonical form. |
generate(experiment) | Generate a new experimental task from the provided experiment. |
generate_samplex_item(instruction_sequences, ...) | Generate a samplex item from instruction sequences with the same structure. |
generate_samplex_items(...) | Generate samplex items from instruction sequences. |
partition(sequences) | Partition the positions of instruction sequences that can share a generation output. |
Attributes
Column 1 | Column 2 |
|---|---|
gate_set | The gate set this generator constructs against. |
gate_set
Type: QiskitGateSet
The gate set this generator constructs against.
collect
static collect(result, data_mapper)
Coerce data from a specific execution framework into a canonical form.
generate
generate(experiment)
Generate a new experimental task from the provided experiment.
generate_samplex_items
generate_samplex_items(instruction_sequences: list[InstructionSequence], num_randomizations: int) → tuple[list[SamplexItem], ExecutorDataMapper]
Generate samplex items from instruction sequences.
Parameters
- instruction_sequences – The instruction sequences to generate circuits for.
- num_randomizations – The number of randomizations per sequence.
Returns
A tuple of samplex items and a data mapper.
generate_samplex_item
generate_samplex_item(instruction_sequences: list[InstructionSequence], num_randomizations: int) → tuple[SamplexItem, list[str], dict[str, ndarray[int]]]
Generate a samplex item from instruction sequences with the same structure.
Parameters
- instruction_sequences – The similar instruction sequences to generate.
- num_randomizations – The number of randomizations per sequence.
Returns
A samplex item where the order of the arguments correspond to the order of instruction_sequences, an ordered list of creg names, and a dictionary mapping creg names to the ordered list of qubit indices they measure.
Raises
- ValueError – If
instruction_sequencesis empty. - ValueError – If any of the instruction sequences is not complete.
- ValueError – If any of the instruction sequences have different structure.