SingleQuditLayerGenerator
- class SingleQuditLayerGenerator(gates, allow_repeats=False)[source]
Bases:
LayerGenerator
The SingleQuditLayerGenerator class.
This module implements a layer generator for a single-qudit circuits with hetergenous gate support.
- __init__(gates, allow_repeats=False)[source]
Construct a SingleQuditLayerGenerator.
- Parameters:
gates (
Sequence[Gate] | None
) – The single-qudit gate list. If None, then the generator will read the pass data for the model’s gate set.allow_repeats (
bool
) – By default this is set to False, and the generator will not generate a circuit that has the same gate twice in a row. Some gates are not closed under multiplication and it may be beneficial to allow them to repeat. In this case, allow_repeats should be True.
- Raises:
ValueError – If any pair of gates from gates has a different radix.
ValueError – If any gate from gates is not single-qudit.
ValueError – If gates is empty.
Methods
gen_initial_layer
(target, data)Generate the initial layer, see LayerGenerator for more.
gen_successors
(circuit, data)Generate the successors of a circuit node.