|
Maestro 0.3.11
Unified interface for quantum circuit simulation
|
The simple host implementation. More...
#include <SimpleHost.h>
Public Member Functions | |
| SimpleHost (size_t hostId, size_t startQubitId, size_t numQubits, size_t startClassicalBitId, size_t numClassicalBits) | |
| The constructor. | |
| bool | AreCbitsOnSameHost (size_t cbitId1, size_t cbitId2) const override |
| Check if two classical bits are in the same host. | |
| bool | AreQubitsOnSameHost (size_t qubitId1, size_t qubitId2) const override |
| Check if two qubits are in the same 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. | |
| size_t | GetId () const override |
| Get the host id. | |
| std::vector< size_t > | GetNetworkEntangledQubitsIds () const override |
| Get the ids of the qubits used for entanglement between hosts in the host. | |
| size_t | GetNumClassicalBits () const override |
| Get the number of classical bits. | |
| size_t | GetNumNetworkEntangledQubits () const override |
| Get the number of network entangled qubits. | |
| size_t | GetNumQubits () const override |
| Get the number of qubits. | |
| std::shared_ptr< IHost< Types::time_type > > | getptr () |
| Get a shared pointer to this object. | |
| std::vector< size_t > | GetQubitsIds () const override |
| Get the ids of the qubits in the host. | |
| size_t | GetStartClassicalBitId () const override |
| Get the id of the first classical bit assigned to the host. | |
| size_t | GetStartQubitId () const override |
| Get the id of the first qubit assigned to the 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 | IsQubitOnHost (size_t qubitId) const override |
| Check if a qubit is in the host. | |
| bool | RecvPacketFromHost (size_t hostId, const std::vector< uint8_t > &packet) override |
| Receive a packet from a host. | |
| bool | SendPacketToHost (size_t hostId, const std::vector< uint8_t > &packet) override |
| Send a packet to a 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. | |
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 61 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< Types::time_type >.
Definition at line 175 of file SimpleHost.h.
References IsClassicalBitOnHost().
|
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< Types::time_type >.
Definition at line 137 of file SimpleHost.h.
References IsQubitOnHost().
|
inlineoverridevirtual |
Get the ids of the classical bits in the host.
Obtain the ids of the classical bits in the host.
Implements Network::IHost< Types::time_type >.
Definition at line 219 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< Types::time_type >.
Definition at line 237 of file SimpleHost.h.
|
inlineoverridevirtual |
Get the host id.
Obtain a host id used to identify the host in the network.
Implements Network::IHost< Types::time_type >.
Definition at line 72 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< Types::time_type >.
Definition at line 205 of file SimpleHost.h.
References GetNumNetworkEntangledQubits().
|
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< Types::time_type >.
Definition at line 113 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< Types::time_type >.
Definition at line 97 of file SimpleHost.h.
Referenced by GetNetworkEntangledQubitsIds(), and IsEntangledQubitOnHost().
|
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< Types::time_type >.
Definition at line 84 of file SimpleHost.h.
|
inlineinherited |
|
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< Types::time_type >.
Definition at line 187 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< Types::time_type >.
Definition at line 299 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< Types::time_type >.
Definition at line 286 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< Types::time_type >.
Definition at line 148 of file SimpleHost.h.
Referenced by AreCbitsOnSameHost().
|
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< Types::time_type >.
Definition at line 161 of file SimpleHost.h.
References GetNumNetworkEntangledQubits().
|
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< Types::time_type >.
Definition at line 125 of file SimpleHost.h.
Referenced by AreQubitsOnSameHost().
|
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< Types::time_type >.
Definition at line 273 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< Types::time_type >.
Definition at line 257 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 313 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 329 of file SimpleHost.h.