qgym.generators package
This subpackage contains data generation functionality.
These data generators can be used during training, as well as during evaluation.
- class qgym.generators.BasicCircuitGenerator(seed=None)[source]
Bases:
CircuitGenerator
BasicCircuitGenerator
is a basic random circuit generation implementation.- __init__(seed=None)[source]
Init of the
BasicInteractionGenerator
.- Parameters:
seed (
Generator
|SupportsInt
|None
) – Seed to use.
- __next__()[source]
Create a new randomly generated circuit.
The length of the circuit is a random integer in the interval [n_qubits, max_length].
- __repr__()[source]
String representation of the
BasicCircuitGenerator
.- Return type:
- set_state_attributes(machine_properties=None, max_gates=0, **kwargs)[source]
Set the n_qubits and max_gates attributes.
- Parameters:
machine_properties (
Any
) –MachineProperties
containing at least the number of qubits of the machine.max_gates (
SupportsInt
) – Maximum number of gates allowed in the circuit.kwargs (
Any
) – Additional keyword arguments. These are not used.
- Return type:
- class qgym.generators.BasicGraphGenerator(interaction_graph_edge_probability=0.5, seed=None)[source]
Bases:
GraphGenerator
BasicGraphGenerator
is a simple graph generation implementation.It uses
fast_gnp_random_graph()
to generate graphs.- __init__(interaction_graph_edge_probability=0.5, seed=None)[source]
Init of the
BasicGraphGenerator
.- Parameters:
interaction_graph_edge_probability (
SupportsFloat
) – Probability to add an edge between two nodes. See the documentation offast_gnp_random_graph()
for more information.seed (
Generator
|SupportsInt
|None
) – Seed to use.
- __repr__()[source]
String representation of the
BasicGraphGenerator
.- Return type:
- class qgym.generators.BasicInteractionGenerator(max_length=10, seed=None)[source]
Bases:
InteractionGenerator
BasicInteractionGenerator
is an interaction generation implementation.Interactions are completely randomly generated using the
numpy.random.choice()
method.- __init__(max_length=10, seed=None)[source]
Init of the
BasicInteractionGenerator
.- Parameters:
max_length (
SupportsInt
) – Maximum length of the generated interaction circuits. Defaults to 10.seed (
Generator
|SupportsInt
|None
) – Seed to use.
- __repr__()[source]
String representation of the
BasicInteractionGenerator
.- Return type:
- class qgym.generators.NullCircuitGenerator[source]
Bases:
CircuitGenerator
Generator class for generating empty circuits.
Useful for unit testing.
- __init__()[source]
Init of the
NullCircuitGenerator
- __repr__()[source]
String representation of the
NullCircuitGenerator
.- Return type:
- class qgym.generators.NullGraphGenerator[source]
Bases:
GraphGenerator
Generator class for generating empty
Graphs
.Useful for unit testing.
- __init__()[source]
Init of the
NullGraphGenerator
- __repr__()[source]
String representation of the
NullGraphGenerator
.- Return type:
- class qgym.generators.NullInteractionGenerator[source]
Bases:
InteractionGenerator
Generator class for generating empty interaction circuits.
Useful for unit testing.
- __init__()[source]
Init of the
NullInteractionGenerator
- __repr__()[source]
String representation of the
NullInteractionGenerator
.- Return type:
- class qgym.generators.WorkshopCircuitGenerator(seed=None)[source]
Bases:
CircuitGenerator
WorkshopCircuitGenerator
is a simplified random circuit generation implementation.- __init__(seed=None)[source]
Init of the
WorkshopCircuitGenerator
.- Parameters:
seed (
Generator
|SupportsInt
|None
) – Seed to use.
- __next__()[source]
Create a new randomly generated circuit.
The length of the circuit is a random integer in the interval [n_qubits, max_length].
- __repr__()[source]
String representation of the
WorkshopCircuitGenerator
.- Return type:
- qgym.generators.circuit module
- qgym.generators.graph module
- qgym.generators.interaction module