|
Maestro 0.1.0
Unified interface for quantum circuit simulation
|
The simple host implementation. More...
#include <SimpleHost.h>
Inheritance diagram for Network::SimpleHost< Time >:
Collaboration diagram for Network::SimpleHost< Time >:Public Member Functions | |
| SimpleHost (size_t hostId, size_t startQubitId, size_t numQubits, size_t startClassicalBitId, size_t numClassicalBits) | |
| The constructor. | |
| size_t | GetId () const override |
| Get the host id. | |
| size_t | GetNumQubits () const override |
| Get the number of qubits. | |
| size_t | GetNumNetworkEntangledQubits () const override |
| Get the number of network entangled qubits. | |
| size_t | GetNumClassicalBits () const override |
| Get the number of classical bits. | |
| bool | IsQubitOnHost (size_t qubitId) const override |
| Check if a qubit is in the host. | |
| bool | AreQubitsOnSameHost (size_t qubitId1, size_t qubitId2) const override |
| Check if two qubits are in the same host. | |
| bool | IsClassicalBitOnHost (size_t cbitId) const override |
| Check if a classical bit is in the host. | |
| bool | IsEntangledQubitOnHost (size_t qubitId) const override |
| Check if a qubit used for entanglement between hosts is in the host. | |
| bool | AreCbitsOnSameHost (size_t cbitId1, size_t cbitId2) const override |
| Check if two classical bits are in the same host. | |
| std::vector< size_t > | GetQubitsIds () const override |
| Get the ids of the qubits in the host. | |
| std::vector< size_t > | GetNetworkEntangledQubitsIds () const override |
| Get the ids of the qubits used for entanglement between hosts in the host. | |
| std::vector< size_t > | GetClassicalBitsIds () const override |
| Get the ids of the classical bits in the host. | |
| std::vector< size_t > | GetEntangledQubitMeasurementBitIds () const override |
| Get the ids of the classical bits used for measurement of the qubits used for entanglement between hosts present in the host. | |
| bool | SendPacketToHost (size_t hostId, const std::vector< uint8_t > &packet) override |
| Send a packet to a host. | |
| bool | RecvPacketFromHost (size_t hostId, const std::vector< uint8_t > &packet) override |
| Receive a packet from a host. | |
| size_t | GetStartQubitId () const override |
| Get the id of the first qubit assigned to the host. | |
| size_t | GetStartClassicalBitId () const override |
| Get the id of the first classical bit assigned to the host. | |
| void | SetEntangledQubitId (size_t id) |
| Set the id of the qubit used for entanglement between hosts. | |
| void | SetEntangledQubitMeasurementBit (size_t id) |
| Set the id of the classical bit used for measurement of the qubit used for entanglement between hosts. | |
Public Member Functions inherited from Network::IHost< Time > | |
| virtual | ~IHost ()=default |
| The destructor. | |
| std::shared_ptr< IHost< Time > > | getptr () |
| Get a shared pointer to this object. | |
The simple host implementation.
A simple host, having just a single qubit for entanglement between hosts, the qubits and classical bits are contiguous.
| Time | The time type for the execution time. |
Definition at line 44 of file SimpleHost.h.
|
inline |
The constructor.
The host will have one qubit more than the specified number, for entanglement with other hosts. It will also have one classical bit more than the specified number, for the measurement of the entangled qubit.
| hostId | The id of the host. |
| startQubitId | The id of the first qubit assigned to the host. |
| numQubits | The number of qubits assigned to the host. |
| startClassicalBitId | The id of the first classical bit assigned to the host. |
| numClassicalBits | The number of classical bits assigned to the host. |
Definition at line 60 of file SimpleHost.h.
|
inlineoverridevirtual |
Check if two classical bits are in the same host.
Checks if two classical bits with the specified ids are in the same host.
Implements Network::IHost< Time >.
Definition at line 163 of file SimpleHost.h.
|
inlineoverridevirtual |
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.
Implements Network::IHost< Time >.
Definition at line 127 of file SimpleHost.h.
|
inlineoverridevirtual |
Get the ids of the classical bits in the host.
Obtain the ids of the classical bits in the host.
Implements Network::IHost< Time >.
Definition at line 203 of file SimpleHost.h.
|
inlineoverridevirtual |
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.
Implements Network::IHost< Time >.
Definition at line 220 of file SimpleHost.h.
|
inlineoverridevirtual |
Get the host id.
Obtain a host id used to identify the host in the network.
Implements Network::IHost< Time >.
Definition at line 74 of file SimpleHost.h.
|
inlineoverridevirtual |
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.
Implements Network::IHost< Time >.
Definition at line 191 of file SimpleHost.h.
|
inlineoverridevirtual |
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.
Implements Network::IHost< Time >.
Definition at line 107 of file SimpleHost.h.
|
inlineoverridevirtual |
Get the number of network entangled qubits.
Obtain the number of qubits in the host used for entanglement with other hosts. The simple hosts have only one such qubit.
Implements Network::IHost< Time >.
Definition at line 93 of file SimpleHost.h.
|
inlineoverridevirtual |
Get the number of qubits.
Obtain the number of qubits in the host, excluding the one(s) used only for entanglement with other hosts.
Implements Network::IHost< Time >.
Definition at line 83 of file SimpleHost.h.
|
inlineoverridevirtual |
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.
Implements Network::IHost< Time >.
Definition at line 174 of file SimpleHost.h.
|
inlineoverridevirtual |
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.
Implements Network::IHost< Time >.
Definition at line 278 of file SimpleHost.h.
|
inlineoverridevirtual |
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.
Implements Network::IHost< Time >.
Definition at line 268 of file SimpleHost.h.
|
inlineoverridevirtual |
Check if a classical bit is in the host.
Checks if a classical bit with the specified id is in the host.
Implements Network::IHost< Time >.
Definition at line 137 of file SimpleHost.h.
|
inlineoverridevirtual |
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.
Implements Network::IHost< Time >.
Definition at line 151 of file SimpleHost.h.
|
inlineoverridevirtual |
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.
Implements Network::IHost< Time >.
Definition at line 116 of file SimpleHost.h.
|
inlineoverridevirtual |
Receive a packet from a host.
Not used in this simple host implementation, classical packets receiving is not simulated, the classical bits are implicitely shared using the classical state for the quantum computing simulation for the network.
| hostId | The id of the host to receive the packet from. |
| packet | The packet to receive. |
Implements Network::IHost< Time >.
Definition at line 255 of file SimpleHost.h.
|
inlineoverridevirtual |
Send a packet to a host.
Send a packet to a host. Not used in this simple host implementation, classical packets sending is not simulated, the classical bits are implicitely shared using the classical state for the quantum computing simulation for the network.
| hostId | The id of the host to send the packet to. |
| packet | The packet to send. |
Implements Network::IHost< Time >.
Definition at line 239 of file SimpleHost.h.
|
inline |
Set the id of the qubit used for entanglement between hosts.
Sets the id of the qubit used for entanglement between hosts. Typically the convention is to allocate them in the simulators after all the qubits for all the hosts were allocated, so they are assigned in order, one for each host, with id number after the last qubit assigned to all hosts.
Definition at line 289 of file SimpleHost.h.
|
inline |
Set the id of the classical bit used for measurement of the qubit used for entanglement between hosts.
Sets the id of the classical bit used for measurement of the qubit used for entanglement between hosts. Typically the convention is to allocate them in the classical state of the quantum simulators after all the classical bits for all the hosts were allocated, so they are assigned in order, one for each host, with id number after the last classical bit assigned to all hosts.
Definition at line 302 of file SimpleHost.h.