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:
CircuitGeneratorBasicCircuitGeneratoris 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) –MachinePropertiescontaining 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:
GraphGeneratorBasicGraphGeneratoris 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:
InteractionGeneratorBasicInteractionGeneratoris 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:
CircuitGeneratorGenerator 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:
GraphGeneratorGenerator 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:
InteractionGeneratorGenerator 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:
CircuitGeneratorWorkshopCircuitGeneratoris 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