Maestro 0.3.11
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
25
26#pragma once
27
28#ifndef _HOST_H_
29#define _HOST_H_
30
31#include <vector>
32
33#include "../Types.h"
34
35namespace Network
36{
37
52template <typename Time = Types::time_type> class IHost : public std::enable_shared_from_this<IHost<Time>>
53{
54 public:
60 virtual ~IHost() = default;
61
68 virtual size_t GetId() const = 0;
69
77 virtual size_t GetNumQubits() const = 0;
78
87 virtual size_t GetNumNetworkEntangledQubits() const = 0;
88
97 virtual size_t GetNumClassicalBits() const = 0;
98
106 virtual bool IsQubitOnHost(size_t qubitId) const = 0;
107
115 virtual bool AreQubitsOnSameHost(size_t qubitId1, size_t qubitId2) const = 0;
116
123 virtual bool IsClassicalBitOnHost(size_t cbitId) const = 0;
124
131 virtual bool AreCbitsOnSameHost(size_t cbitId1, size_t cbitId2) const = 0;
132
141 virtual bool IsEntangledQubitOnHost(size_t qubitId) const = 0;
142
150 virtual std::vector<size_t> GetQubitsIds() const = 0;
151
158 virtual std::vector<size_t> GetClassicalBitsIds() const = 0;
159
169 virtual std::vector<size_t> GetNetworkEntangledQubitsIds() const = 0;
170
180 virtual std::vector<size_t> GetEntangledQubitMeasurementBitIds() const = 0;
181
192 virtual bool SendPacketToHost(size_t hostId, const std::vector<uint8_t> &packet) = 0;
193
203 virtual bool RecvPacketFromHost(size_t hostId, 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 {
234 return std::enable_shared_from_this<IHost<Time>>::shared_from_this();
235 }
236};
237
238} // namespace Network
239
240#endif // !_HOST_H_
The host interface.
Definition Host.h:53
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.