Maestro 0.2.5
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
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
51template <typename Time = Types::time_type>
52class IHost : public std::enable_shared_from_this<IHost<Time>> {
53 public:
59 virtual ~IHost() = default;
60
67 virtual size_t GetId() const = 0;
68
76 virtual size_t GetNumQubits() const = 0;
77
86 virtual size_t GetNumNetworkEntangledQubits() const = 0;
87
96 virtual size_t GetNumClassicalBits() const = 0;
97
105 virtual bool IsQubitOnHost(size_t qubitId) const = 0;
106
114 virtual bool AreQubitsOnSameHost(size_t qubitId1, size_t qubitId2) const = 0;
115
122 virtual bool IsClassicalBitOnHost(size_t cbitId) const = 0;
123
130 virtual bool AreCbitsOnSameHost(size_t cbitId1, size_t cbitId2) const = 0;
131
140 virtual bool IsEntangledQubitOnHost(size_t qubitId) const = 0;
141
149 virtual std::vector<size_t> GetQubitsIds() const = 0;
150
157 virtual std::vector<size_t> GetClassicalBitsIds() const = 0;
158
168 virtual std::vector<size_t> GetNetworkEntangledQubitsIds() const = 0;
169
179 virtual std::vector<size_t> GetEntangledQubitMeasurementBitIds() const = 0;
180
191 virtual bool SendPacketToHost(size_t hostId,
192 const std::vector<uint8_t> &packet) = 0;
193
203 virtual bool RecvPacketFromHost(size_t hostId,
204 const std::vector<uint8_t> &packet) = 0;
205
214 virtual size_t GetStartQubitId() const = 0;
215
224 virtual size_t GetStartClassicalBitId() const = 0;
225
233 std::shared_ptr<IHost<Time>> getptr() {
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:52
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:233
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.