Maestro 0.1.0
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Network::IController< Time > Class Template Referenceabstract

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.
 

Detailed Description

template<typename Time = Types::time_type>
class Network::IController< Time >

The controller host interface.

The controller is a special kind of host, it is the one that distributes the circuit to the other hosts.

Template Parameters
TimeThe time representation to use for execution times.
See also
IHost
INetwork

Definition at line 105 of file Controller.h.

Member Function Documentation

◆ CreateOptimiser()

template<typename Time = Types::time_type>
virtual void Network::IController< Time >::CreateOptimiser ( Graphs::OptimiserType  type)
pure virtual

Creates an optimiser.

Creates an optimiser of the specified type.

Parameters
typeThe type of optimiser to create.

Implemented in Network::SimpleController< Time >.

◆ CreateScheduler()

template<typename Time = Types::time_type>
virtual void Network::IController< Time >::CreateScheduler ( const std::shared_ptr< INetwork< Time > > &  network,
SchedulerType  schType = SchedulerType::kNoEntanglementQubitsParallel 
)
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.

Parameters
networkThe network to create the scheduler for.
simTypeThe type of the scheduler to create.
See also
SchedulerType

Implemented in Network::SimpleController< Time >.

◆ DistributeCircuit()

template<typename Time = Types::time_type>
virtual std::shared_ptr< Circuits::Circuit< Time > > Network::IController< Time >::DistributeCircuit ( const std::shared_ptr< INetwork< Time > > &  network,
const std::shared_ptr< Circuits::Circuit< Time > > &  circuit 
)
pure virtual

Distributes the circuit on the hosts.

The network will call this, the conversion and distribution that should happen before execution.

Parameters
networkThe network to distribute the circuit for.
circuitThe circuit to distribute.
Returns
The distributed circuit.

Implemented in Network::SimpleController< Time >.

◆ DoNetworkSpecificConversionsForDistribution()

template<typename Time = Types::time_type>
virtual std::shared_ptr< Circuits::Circuit< Time > > Network::IController< Time >::DoNetworkSpecificConversionsForDistribution ( const std::shared_ptr< INetwork< Time > > &  network,
const std::shared_ptr< Circuits::Circuit< Time > > &  circuit 
)
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.

Parameters
networkThe network to convert the circuit for.
circuitThe circuit to convert.
Returns
The converted circuit.
See also
Circuits::Circuit

Implemented in Network::SimpleController< Time >.

◆ GetOptimiser()

template<typename Time = Types::time_type>
virtual std::shared_ptr< Graphs::IOptimiser< Time > > Network::IController< Time >::GetOptimiser ( ) const
pure virtual

Returns the optimiser used.

Returns the optimiser used. Could be nullptr, that is, no optimiser.

Returns
The optimiser used.

Implemented in Network::SimpleController< Time >.

◆ GetOptimizeCircuit()

template<typename Time = Types::time_type>
virtual bool Network::IController< Time >::GetOptimizeCircuit ( ) const
pure virtual

Get circuit optimization.

Returns true if the circuit will be optimized, false otherwise.

Returns
True if the circuit will be optimized, false otherwise.

Implemented in Network::SimpleController< Time >.

◆ GetOptimizeRotationGates()

template<typename Time = Types::time_type>
virtual bool Network::IController< Time >::GetOptimizeRotationGates ( ) const
pure virtual

◆ GetRemapper()

template<typename Time = Types::time_type>
virtual std::shared_ptr< Distribution::IRemapper< Time > > Network::IController< Time >::GetRemapper ( ) const
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.

Returns
The remapper.
See also
Distribution::IRemapper

Implemented in Network::SimpleController< Time >.

◆ GetScheduler()

template<typename Time = Types::time_type>
virtual std::shared_ptr< Schedulers::IScheduler< Time > > Network::IController< Time >::GetScheduler ( ) const
pure virtual

Get the scheduler for the network.

Get the scheduler for the network.

Returns
The scheduler for the network.
See also
Schedulers::IScheduler

Implemented in Network::SimpleController< Time >.

◆ SetOptimizeCircuit()

template<typename Time = Types::time_type>
virtual void Network::IController< Time >::SetOptimizeCircuit ( bool  optimize = true)
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.

Parameters
optimizeTrue if the circuit should be optimized, false otherwise.

Implemented in Network::SimpleController< Time >.

◆ SetOptimizeRotationGates()

template<typename Time = Types::time_type>
virtual void Network::IController< Time >::SetOptimizeRotationGates ( bool  val = true)
pure virtual

◆ SetRemapper()

template<typename Time = Types::time_type>
virtual void Network::IController< Time >::SetRemapper ( const std::shared_ptr< Distribution::IRemapper< Time > > &  remapper)
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.

Parameters
remapperThe new remapper.
See also
Distribution::IRemapper

Implemented in Network::SimpleController< Time >.

◆ SplitCompositeOperations()

template<typename Time = Types::time_type>
virtual std::shared_ptr< Circuits::Circuit< Time > > Network::IController< Time >::SplitCompositeOperations ( const std::shared_ptr< INetwork< Time > > &  network,
const std::shared_ptr< Circuits::Circuit< Time > > &  circuit 
)
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.

Parameters
networkThe network to execute the circuit for.
circuitThe circuit to execute.
Returns
A shared pointer to the modified circuit.
See also
Circuits::Circuit
INetwork

Implemented in Network::SimpleController< Time >.


The documentation for this class was generated from the following file: