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

The host interface. More...

#include <Host.h>

+ Inheritance diagram for Network::IHost< Time >:
+ Collaboration diagram for Network::IHost< Time >:

Public Member Functions

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::IHost< Time >

The host interface.

The interface for the hosts in the network. Must be derived from by the particular host implementations. Most of the hosts will be quantum computers but classical computers are also possible. One that is possible is a controller, a classical computer responsible with the network management, circuit distribution and so on.

Template Parameters
TimeThe time type for the execution time.
See also
IController
INetwork

Definition at line 51 of file Host.h.

Constructor & Destructor Documentation

◆ ~IHost()

template<typename Time = Types::time_type>
virtual Network::IHost< Time >::~IHost ( )
virtualdefault

The destructor.

The destructor. Virtual since this is an interface.

Member Function Documentation

◆ AreCbitsOnSameHost()

template<typename Time = Types::time_type>
virtual bool Network::IHost< Time >::AreCbitsOnSameHost ( size_t  cbitId1,
size_t  cbitId2 
) const
pure virtual

Check if two classical bits are in the same host.

Checks if two classical bits with the specified ids are in the same host.

Returns
True if the classical bits are on the same host, false otherwise.

Implemented in Network::SimpleHost< Time >, and Network::SimpleController< Time >.

◆ AreQubitsOnSameHost()

template<typename Time = Types::time_type>
virtual bool Network::IHost< Time >::AreQubitsOnSameHost ( size_t  qubitId1,
size_t  qubitId2 
) const
pure virtual

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.

Returns
True if the qubits are on the same host, false otherwise.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ GetClassicalBitsIds()

template<typename Time = Types::time_type>
virtual std::vector< size_t > Network::IHost< Time >::GetClassicalBitsIds ( ) const
pure virtual

Get the ids of the classical bits in the host.

Obtain the ids of the classical bits in the host.

Returns
The ids of the classical bits in the host.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ GetEntangledQubitMeasurementBitIds()

template<typename Time = Types::time_type>
virtual std::vector< size_t > Network::IHost< Time >::GetEntangledQubitMeasurementBitIds ( ) const
pure virtual

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.

Returns
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 >.

◆ GetId()

template<typename Time = Types::time_type>
virtual size_t Network::IHost< Time >::GetId ( ) const
pure virtual

Get the host id.

Obtain a host id used to identify the host in the network.

Returns
The host id.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ GetNetworkEntangledQubitsIds()

template<typename Time = Types::time_type>
virtual std::vector< size_t > Network::IHost< Time >::GetNetworkEntangledQubitsIds ( ) const
pure virtual

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.

Returns
The ids of the qubits used for entanglement between hosts in the host.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ GetNumClassicalBits()

template<typename Time = Types::time_type>
virtual size_t Network::IHost< Time >::GetNumClassicalBits ( ) const
pure virtual

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.

Returns
The number of classical bits.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ GetNumNetworkEntangledQubits()

template<typename Time = Types::time_type>
virtual size_t Network::IHost< Time >::GetNumNetworkEntangledQubits ( ) const
pure virtual

Get the number of network entangled qubits.

Obtain the number of qubits in the host used for entanglement with other hosts.

Returns
The number of network entangled qubits.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ GetNumQubits()

template<typename Time = Types::time_type>
virtual size_t Network::IHost< Time >::GetNumQubits ( ) const
pure virtual

Get the number of qubits.

Obtain the number of qubits in the host, excluding the one(s) used only for entanglement with other hosts.

Returns
The number of qubits.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ getptr()

template<typename Time = Types::time_type>
std::shared_ptr< IHost< Time > > Network::IHost< Time >::getptr ( )
inline

Get a shared pointer to this object.

Returns a shared pointer to this object. The object needs to be already wrapped in a shared pointer.

Returns
A shared pointer to this object.

Definition at line 232 of file Host.h.

◆ GetQubitsIds()

template<typename Time = Types::time_type>
virtual std::vector< size_t > Network::IHost< Time >::GetQubitsIds ( ) const
pure virtual

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.

Returns
The ids of the qubits in the host.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ GetStartClassicalBitId()

template<typename Time = Types::time_type>
virtual size_t Network::IHost< Time >::GetStartClassicalBitId ( ) const
pure virtual

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.

Returns
The id of the first classical bit assigned to the host.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ GetStartQubitId()

template<typename Time = Types::time_type>
virtual size_t Network::IHost< Time >::GetStartQubitId ( ) const
pure virtual

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.

Returns
The id of the first qubit assigned to the host.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ IsClassicalBitOnHost()

template<typename Time = Types::time_type>
virtual bool Network::IHost< Time >::IsClassicalBitOnHost ( size_t  cbitId) const
pure virtual

Check if a classical bit is in the host.

Checks if a classical bit with the specified id is in the host.

Returns
True if the classical bit is on this host, false otherwise.

Implemented in Network::SimpleHost< Time >, and Network::SimpleController< Time >.

◆ IsEntangledQubitOnHost()

template<typename Time = Types::time_type>
virtual bool Network::IHost< Time >::IsEntangledQubitOnHost ( size_t  qubitId) const
pure virtual

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.

Returns
True if the network entangled qubit is on this host, false otherwise.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ IsQubitOnHost()

template<typename Time = Types::time_type>
virtual bool Network::IHost< Time >::IsQubitOnHost ( size_t  qubitId) const
pure virtual

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.

Returns
True if the qubit is on this host, false otherwise.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ RecvPacketFromHost()

template<typename Time = Types::time_type>
virtual bool Network::IHost< Time >::RecvPacketFromHost ( size_t  hostId,
const std::vector< uint8_t > &  packet 
)
pure virtual

Receive a packet from a host.

Receive a packet from a host. Usually called by the network implementation.

Parameters
hostIdThe id of the host to receive the packet from.
packetThe packet to receive.
Returns
True if the packet was received successfully, false otherwise.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.

◆ SendPacketToHost()

template<typename Time = Types::time_type>
virtual bool Network::IHost< Time >::SendPacketToHost ( size_t  hostId,
const std::vector< uint8_t > &  packet 
)
pure virtual

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.

Parameters
hostIdThe id of the host to send the packet to.
packetThe packet to send.
Returns
True if the packet was sent successfully, false otherwise.

Implemented in Network::SimpleController< Time >, and Network::SimpleHost< Time >.


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