|
Maestro 0.1.0
Unified interface for quantum circuit simulation
|
The controller host interface. More...
#include <Controller.h>
Inheritance diagram for Network::IController< Time >:
Collaboration diagram for Network::IController< Time >:Public Member Functions | |
| virtual std::shared_ptr< Circuits::Circuit< Time > > | DistributeCircuit (const std::shared_ptr< INetwork< Time > > &network, const std::shared_ptr< Circuits::Circuit< Time > > &circuit)=0 |
| Distributes the circuit on the hosts. | |
| virtual std::shared_ptr< Circuits::Circuit< Time > > | SplitCompositeOperations (const std::shared_ptr< INetwork< Time > > &network, const std::shared_ptr< Circuits::Circuit< Time > > &circuit)=0 |
| Splits the composite operations from the circuit. | |
| virtual void | SetRemapper (const std::shared_ptr< Distribution::IRemapper< Time > > &remapper)=0 |
| Changes the remapper that is used for remapping a circuit to a distributed one. | |
| virtual std::shared_ptr< Distribution::IRemapper< Time > > | GetRemapper () const =0 |
| Gets the remapper that is used for remapping a circuit to a distributed one. | |
| virtual std::shared_ptr< Circuits::Circuit< Time > > | DoNetworkSpecificConversionsForDistribution (const std::shared_ptr< INetwork< Time > > &network, const std::shared_ptr< Circuits::Circuit< Time > > &circuit)=0 |
| Convert the circuit for distribution for specific networks. | |
| virtual std::shared_ptr< Graphs::IOptimiser< Time > > | GetOptimiser () const =0 |
| Returns the optimiser used. | |
| virtual void | CreateOptimiser (Graphs::OptimiserType type)=0 |
| Creates an optimiser. | |
| virtual void | CreateScheduler (const std::shared_ptr< INetwork< Time > > &network, SchedulerType schType=SchedulerType::kNoEntanglementQubitsParallel)=0 |
| Create the scheduler for the network. | |
| virtual std::shared_ptr< Schedulers::IScheduler< Time > > | GetScheduler () const =0 |
| Get the scheduler for the network. | |
| virtual void | SetOptimizeCircuit (bool optimize=true)=0 |
| Set circuit optimization. | |
| virtual bool | GetOptimizeCircuit () const =0 |
| Get circuit optimization. | |
| virtual bool | GetOptimizeRotationGates () const =0 |
| virtual void | SetOptimizeRotationGates (bool val=true)=0 |
Public Member Functions inherited from Network::IHost< Time > | |
| virtual | ~IHost ()=default |
| The destructor. | |
| virtual size_t | GetId () const =0 |
| Get the host id. | |
| virtual size_t | GetNumQubits () const =0 |
| Get the number of qubits. | |
| virtual size_t | GetNumNetworkEntangledQubits () const =0 |
| Get the number of network entangled qubits. | |
| virtual size_t | GetNumClassicalBits () const =0 |
| Get the number of classical bits. | |
| virtual bool | IsQubitOnHost (size_t qubitId) const =0 |
| Check if a qubit is in the host. | |
| virtual bool | AreQubitsOnSameHost (size_t qubitId1, size_t qubitId2) const =0 |
| Check if two qubits are in the same host. | |
| virtual bool | IsClassicalBitOnHost (size_t cbitId) const =0 |
| Check if a classical bit is in the host. | |
| virtual bool | AreCbitsOnSameHost (size_t cbitId1, size_t cbitId2) const =0 |
| Check if two classical bits are in the same host. | |
| virtual bool | IsEntangledQubitOnHost (size_t qubitId) const =0 |
| Check if a qubit used for entanglement between hosts is in the host. | |
| virtual std::vector< size_t > | GetQubitsIds () const =0 |
| Get the ids of the qubits in the host. | |
| virtual std::vector< size_t > | GetClassicalBitsIds () const =0 |
| Get the ids of the classical bits in the host. | |
| virtual std::vector< size_t > | GetNetworkEntangledQubitsIds () const =0 |
| Get the ids of the qubits used for entanglement between hosts in the host. | |
| virtual std::vector< size_t > | GetEntangledQubitMeasurementBitIds () const =0 |
| Get the ids of the classical bits used for measurement of the qubits used for entanglement between hosts present in the host. | |
| virtual bool | SendPacketToHost (size_t hostId, const std::vector< uint8_t > &packet)=0 |
| Send a packet to a host. | |
| virtual bool | RecvPacketFromHost (size_t hostId, const std::vector< uint8_t > &packet)=0 |
| Receive a packet from a host. | |
| virtual size_t | GetStartQubitId () const =0 |
| Get the id of the first qubit assigned to the host. | |
| virtual size_t | GetStartClassicalBitId () const =0 |
| Get the id of the first classical bit assigned to the host. | |
| std::shared_ptr< IHost< Time > > | getptr () |
| Get a shared pointer to this object. | |
The controller host interface.
The controller is a special kind of host, it is the one that distributes the circuit to the other hosts.
| Time | The time representation to use for execution times. |
Definition at line 105 of file Controller.h.
|
pure virtual |
Creates an optimiser.
Creates an optimiser of the specified type.
| type | The type of optimiser to create. |
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Create the scheduler for the network.
Creates the scheduler for the network. Call this only after the network topology has been set up. Should create the scheduler and set the network for it and any other necessary parameters.
| network | The network to create the scheduler for. |
| simType | The type of the scheduler to create. |
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Distributes the circuit on the hosts.
The network will call this, the conversion and distribution that should happen before execution.
| network | The network to distribute the circuit for. |
| circuit | The circuit to distribute. |
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Convert the circuit for distribution for specific networks.
Convert the circuit for distribution for specific networks. Particular networks might need additional circuit conversions before distribution. They should override this implementation. By default, it does nothing.
| network | The network to convert the circuit for. |
| circuit | The circuit to convert. |
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Returns the optimiser used.
Returns the optimiser used. Could be nullptr, that is, no optimiser.
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Get circuit optimization.
Returns true if the circuit will be optimized, false otherwise.
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Gets the remapper that is used for remapping a circuit to a distributed one.
The remapper is used to remap the circuit to a distributed one.
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Get the scheduler for the network.
Get the scheduler for the network.
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Set circuit optimization.
If the parameter is true, the circuit will be optimized, otherwise it will not be optimized. The default value is true.
| optimize | True if the circuit should be optimized, false otherwise. |
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Changes the remapper that is used for remapping a circuit to a distributed one.
The remapper is used to remap the circuit to a distributed one.
| remapper | The new remapper. |
Implemented in Network::SimpleController< Time >.
|
pure virtual |
Splits the composite operations from the circuit.
Splits some composite operations. There are composite operations - other than multiple qubits quantum gates - that act on multiple qubits/classical bits that might act on qubits that are not local. This function splits those operations into ones that act on a single qubit/classical bit. For example measurements on several qubits are split into several measurements on a single qubit.
| network | The network to execute the circuit for. |
| circuit | The circuit to execute. |
Implemented in Network::SimpleController< Time >.