Maestro 0.1.0
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Distribution::IRemapper< Time > Class Template Referenceabstract

Remapper abstract class. More...

#include <Remapper.h>

Inheritance diagram for Distribution::IRemapper< Time >:

Public Member Functions

virtual ~IRemapper ()=default
 Default virtual destructor.
virtual std::shared_ptr< Circuits::Circuit< Time > > Remap (const std::shared_ptr< Network::INetwork< Time > > &network, const std::shared_ptr< Circuits::Circuit< Time > > &circuit)=0
 Remap the circuit.
virtual unsigned int GetNumberOfOperationsForDistribution () const =0
 Get the number of operations for distribution.
virtual unsigned int GetNumberOfDistributions () const =0
 Get the number of distribution circuits for the last remapped circuit.
std::shared_ptr< IRemapper< Time > > getptr ()
 Get a shared pointer to this object.
virtual RemapperType GetType () const =0
 Returns the type of the remapper.
virtual std::shared_ptr< Circuits::Circuit< Time > > SplitCompositeOperations (const std::shared_ptr< Network::INetwork< Time > > &network, const std::shared_ptr< Circuits::Circuit< Time > > &distCirc) const
 Split composite operations.

Static Public Member Functions

static bool IsNonLocalOperation (const std::shared_ptr< Circuits::IOperation< Time > > &op, const std::shared_ptr< Network::INetwork< Time > > &network)
 Checks if an operation is non local.

Detailed Description

template<typename Time = Types::time_type>
class Distribution::IRemapper< Time >

Remapper abstract class.

Remapper abstract class. Derived classes must implement the Remap function.

Template Parameters
TimeThe type of the time. Typically either double or unsigned long long int. Default is double.

Definition at line 47 of file Remapper.h.

Constructor & Destructor Documentation

◆ ~IRemapper()

template<typename Time = Types::time_type>
virtual Distribution::IRemapper< Time >::~IRemapper ( )
virtualdefault

Default virtual destructor.

Default destructor, virtual because it's an abstract class that must be derived from.

Member Function Documentation

◆ GetNumberOfDistributions()

template<typename Time = Types::time_type>
virtual unsigned int Distribution::IRemapper< Time >::GetNumberOfDistributions ( ) const
pure virtual

Get the number of distribution circuits for the last remapped circuit.

Returns the number of distribution circuits for the last remapped circuit.

Returns
The number of distribution circuits.

◆ GetNumberOfOperationsForDistribution()

template<typename Time = Types::time_type>
virtual unsigned int Distribution::IRemapper< Time >::GetNumberOfOperationsForDistribution ( ) const
pure virtual

Get the number of operations for distribution.

Returns the number of operations for distribution. This is the total number of operations that are added to distribute a gate (or a group of gates that share the control qubit and have the target on the same host) using the qubits for entanglement between the hosts.

Returns
The number of operations for distribution.

◆ getptr()

template<typename Time = Types::time_type>
std::shared_ptr< IRemapper< Time > > Distribution::IRemapper< Time >::getptr ( )
inline

Get a shared pointer to this object.

Returns a shared pointer to this object. The object needs to be already wrapped in a shared pointer.

Returns
A shared pointer to this object.

Definition at line 98 of file Remapper.h.

◆ GetType()

template<typename Time = Types::time_type>
virtual RemapperType Distribution::IRemapper< Time >::GetType ( ) const
pure virtual

Returns the type of the remapper.

Returns the type of the remapper.

Returns
The type of the remapper
See also
RemapperType

◆ IsNonLocalOperation()

template<typename Time = Types::time_type>
bool Distribution::IRemapper< Time >::IsNonLocalOperation ( const std::shared_ptr< Circuits::IOperation< Time > > & op,
const std::shared_ptr< Network::INetwork< Time > > & network )
inlinestatic

Checks if an operation is non local.

An operation is non local if it needs entanglement for distribution, affecting qubits on different hosts.

Parameters
opThe operation to check.
networkThe network to use for the check.
Returns
True if the operation is non local, false otherwise.
See also
Network::INetwork
Circuits::IOperation

Definition at line 124 of file Remapper.h.

◆ Remap()

template<typename Time = Types::time_type>
virtual std::shared_ptr< Circuits::Circuit< Time > > Distribution::IRemapper< Time >::Remap ( const std::shared_ptr< Network::INetwork< Time > > & network,
const std::shared_ptr< Circuits::Circuit< Time > > & circuit )
pure virtual

Remap the circuit.

Remaps the circuit to a distributed one.

Parameters
networkThe network to use for remapping.
circuitThe circuit to remap.
Returns
A shared pointer to the remapped circuit.
See also
Network::INetwork
Circuits::Circuit

◆ SplitCompositeOperations()

template<typename Time = Types::time_type>
virtual std::shared_ptr< Circuits::Circuit< Time > > Distribution::IRemapper< Time >::SplitCompositeOperations ( const std::shared_ptr< Network::INetwork< Time > > & network,
const std::shared_ptr< Circuits::Circuit< Time > > & distCirc ) const
inlinevirtual

Split composite operations.

Splits some composite operations. There are composite operations - other than multiple qubits quantum gates - that act on multiple qubits/classical bits that might act on qubits that are not local. This function splits those operations into ones that act on a single qubit/classical bit. Operations that are split are: Measurement, RandomGen, ConditionalMeasurement, ConditionalRandomGen, Reset. For example measurements on several qubits are split into several measurements on a single qubit.

Parameters
networkThe network to use for remapping.
distCircThe circuit to have its operations split if needed.
Returns
A shared pointer to the new circuit with converted operations.
See also
Network::INetwork
Circuits::Circuit

Definition at line 160 of file Remapper.h.


The documentation for this class was generated from the following file: