Maestro 0.1.0
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Host.h
Go to the documentation of this file.
1/*******************************************************
2
3Copyright (C) 2023 2639731 ONTARIO INC. <joe.diadamo.dryrock@gmail.com>
4
5The files in this repository make up the Codebase.
6
7All files in this Codebase are owned by 2639731 ONTARIO INC..
8
9Any files within this Codebase can not be copied and/or distributed without the
10express permission of 2639731 ONTARIO INC.
11
12*******************************************************/
13
24
25#pragma once
26
27#ifndef _HOST_H_
28#define _HOST_H_
29
30#include <vector>
31
32#include "../Types.h"
33
34namespace Network {
35
50template <typename Time = Types::time_type>
51class IHost : public std::enable_shared_from_this<IHost<Time>> {
52public:
58 virtual ~IHost() = default;
59
66 virtual size_t GetId() const = 0;
67
75 virtual size_t GetNumQubits() const = 0;
76
85 virtual size_t GetNumNetworkEntangledQubits() const = 0;
86
95 virtual size_t GetNumClassicalBits() const = 0;
96
104 virtual bool IsQubitOnHost(size_t qubitId) const = 0;
105
113 virtual bool AreQubitsOnSameHost(size_t qubitId1, size_t qubitId2) const = 0;
114
121 virtual bool IsClassicalBitOnHost(size_t cbitId) const = 0;
122
129 virtual bool AreCbitsOnSameHost(size_t cbitId1, size_t cbitId2) const = 0;
130
139 virtual bool IsEntangledQubitOnHost(size_t qubitId) const = 0;
140
148 virtual std::vector<size_t> GetQubitsIds() const = 0;
149
156 virtual std::vector<size_t> GetClassicalBitsIds() const = 0;
157
167 virtual std::vector<size_t> GetNetworkEntangledQubitsIds() const = 0;
168
178 virtual std::vector<size_t> GetEntangledQubitMeasurementBitIds() const = 0;
179
190 virtual bool SendPacketToHost(size_t hostId,
191 const std::vector<uint8_t> &packet) = 0;
192
202 virtual bool RecvPacketFromHost(size_t hostId,
203 const std::vector<uint8_t> &packet) = 0;
204
213 virtual size_t GetStartQubitId() const = 0;
214
223 virtual size_t GetStartClassicalBitId() const = 0;
224
232 std::shared_ptr<IHost<Time>> getptr() {
233 return std::enable_shared_from_this<IHost<Time>>::shared_from_this();
234 }
235};
236
237} // namespace Network
238
239#endif // !_HOST_H_
The host interface.
Definition Host.h:51
virtual bool IsClassicalBitOnHost(size_t cbitId) const =0
Check if a classical bit is in the host.
virtual ~IHost()=default
The destructor.
virtual size_t GetStartQubitId() const =0
Get the id of the first qubit assigned to the host.
virtual bool SendPacketToHost(size_t hostId, const std::vector< uint8_t > &packet)=0
Send a packet to a 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 ho...
virtual std::vector< size_t > GetNetworkEntangledQubitsIds() const =0
Get the ids of the qubits used for entanglement between hosts 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 RecvPacketFromHost(size_t hostId, const std::vector< uint8_t > &packet)=0
Receive a packet from a host.
std::shared_ptr< IHost< Time > > getptr()
Get a shared pointer to this object.
Definition Host.h:232
virtual std::vector< size_t > GetClassicalBitsIds() const =0
Get the ids of the classical bits in the host.
virtual size_t GetNumNetworkEntangledQubits() const =0
Get the number of network entangled qubits.
virtual size_t GetStartClassicalBitId() const =0
Get the id of the first classical bit assigned to the host.
virtual bool IsEntangledQubitOnHost(size_t qubitId) const =0
Check if a qubit used for entanglement between hosts is in the host.
virtual size_t GetNumClassicalBits() const =0
Get the number of classical bits.
virtual bool AreQubitsOnSameHost(size_t qubitId1, size_t qubitId2) const =0
Check if two qubits are in the same host.
virtual bool IsQubitOnHost(size_t qubitId) const =0
Check if a qubit is in the host.
virtual size_t GetNumQubits() const =0
Get the number of qubits.
virtual std::vector< size_t > GetQubitsIds() const =0
Get the ids of the qubits in the host.
virtual size_t GetId() const =0
Get the host id.