|
Maestro 0.2.5
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 bool | AreCbitsOnSameHost (size_t cbitId1, size_t cbitId2) const =0 |
| Check if two classical bits are in the same host. | |
| virtual bool | AreQubitsOnSameHost (size_t qubitId1, size_t qubitId2) const =0 |
| Check if two qubits are in the same host. | |
| 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< 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 > > | 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::vector< size_t > | GetClassicalBitsIds () const =0 |
| Get the ids of the classical bits 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 size_t | GetId () const =0 |
| Get the host id. | |
| virtual std::vector< size_t > | GetNetworkEntangledQubitsIds () const =0 |
| Get the ids of the qubits used for entanglement between hosts in the host. | |
| virtual size_t | GetNumClassicalBits () const =0 |
| Get the number of classical bits. | |
| virtual size_t | GetNumNetworkEntangledQubits () const =0 |
| Get the number of network entangled qubits. | |
| virtual size_t | GetNumQubits () const =0 |
| Get the number of qubits. | |
| virtual std::shared_ptr< Graphs::IOptimiser< Time > > | GetOptimiser () const =0 |
| Returns the optimiser used. | |
| virtual bool | GetOptimizeCircuit () const =0 |
| Get circuit optimization. | |
| virtual bool | GetOptimizeRotationGates () const =0 |
| std::shared_ptr< IHost< Time > > | getptr () |
| Get a shared pointer to this object. | |
| virtual std::vector< size_t > | GetQubitsIds () const =0 |
| Get the ids of the qubits in the host. | |
| 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< Schedulers::IScheduler< Time > > | GetScheduler () const =0 |
| Get the scheduler for the network. | |
| virtual size_t | GetStartClassicalBitId () const =0 |
| Get the id of the first classical bit assigned to the host. | |
| virtual size_t | GetStartQubitId () const =0 |
| Get the id of the first qubit assigned to the host. | |
| virtual bool | IsClassicalBitOnHost (size_t cbitId) const =0 |
| Check if a classical bit is in the host. | |
| virtual bool | IsEntangledQubitOnHost (size_t qubitId) const =0 |
| Check if a qubit used for entanglement between hosts is in the host. | |
| virtual bool | IsQubitOnHost (size_t qubitId) const =0 |
| Check if a qubit is in the host. | |
| virtual bool | RecvPacketFromHost (size_t hostId, const std::vector< uint8_t > &packet)=0 |
| Receive a packet from a host. | |
| virtual bool | SendPacketToHost (size_t hostId, const std::vector< uint8_t > &packet)=0 |
| Send a packet to a host. | |
| virtual void | SetOptimizeCircuit (bool optimize=true)=0 |
| Set circuit optimization. | |
| virtual void | SetOptimizeRotationGates (bool val=true)=0 |
| 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< 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. | |
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 106 of file Controller.h.
|
pure virtualinherited |
Check if two classical bits are in the same host.
Checks if two classical bits with the specified ids are in the same host.
Implemented in Network::SimpleHost< Time >, and Network::SimpleController< Time >.
|
pure virtualinherited |
Check if two qubits are in the same host.
Checks if two qubits with the specified ids are in the same host, excluding the one(s) used only for entanglement with other hosts.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
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 virtualinherited |
Get the ids of the classical bits in the host.
Obtain the ids of the classical bits in the host.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Get the ids of the classical bits used for measurement of the qubits used for entanglement between hosts present in the host.
Obtain the ids of the classical bits used for measurement of the qubits used for entanglement between hosts present in the host.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Get the host id.
Obtain a host id used to identify the host in the network.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Get the ids of the qubits used for entanglement between hosts in the host.
Obtain the ids of the qubits used for entanglement between hosts in the host.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Get the number of classical bits.
Obtain the number of classical bits in the host. This does not include the bits used for measurement of the network entangled qubits.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Get the number of network entangled qubits.
Obtain the number of qubits in the host used for entanglement with other hosts.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Get the number of qubits.
Obtain the number of qubits in the host, excluding the one(s) used only for entanglement with other hosts.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< 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 >.
|
inlineinherited |
|
pure virtualinherited |
Get the ids of the qubits in the host.
Obtain the ids of the qubits in the host, excluding the one(s) used only for entanglement with other hosts.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< 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 virtualinherited |
Get the id of the first classical bit assigned to the host.
Obtain the id of the first classical bit assigned to the host, the other ones are assigned contiquously.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Get the id of the first qubit assigned to the host.
Obtain the id of the first qubit assigned to the host, the other ones are assigned contiquously.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Check if a classical bit is in the host.
Checks if a classical bit with the specified id is in the host.
Implemented in Network::SimpleHost< Time >, and Network::SimpleController< Time >.
|
pure virtualinherited |
Check if a qubit used for entanglement between hosts is in the host.
Checks if a qubit used for entanglement between hosts with the specified id is in the host.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Check if a qubit is in the host.
Checks if a qubit with the specified id is in the host, excluding the one(s) used only for entanglement with other hosts.
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Receive a packet from a host.
Receive a packet from a host. Usually called by the network implementation.
| hostId | The id of the host to receive the packet from. |
| packet | The packet to receive. |
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.
|
pure virtualinherited |
Send a packet to a host.
Send a packet to a host. Usually called by the host implementation or perhaps in some cases by the network implementation.
| hostId | The id of the host to send the packet to. |
| packet | The packet to send. |
Implemented in Network::SimpleController< Time >, and Network::SimpleHost< 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 >.