Maestro 0.1.0
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
MaestroLibrary Class Reference

#include <MaestroLib.hpp>

+ Inheritance diagram for MaestroLibrary:
+ Collaboration diagram for MaestroLibrary:

Public Member Functions

 MaestroLibrary (const MaestroLibrary &)=delete
 
MaestroLibraryoperator= (const MaestroLibrary &)=delete
 
 MaestroLibrary (MaestroLibrary &&)=default
 
MaestroLibraryoperator= (MaestroLibrary &&)=default
 
 MaestroLibrary () noexcept
 
virtual ~MaestroLibrary ()
 
bool Init (const char *libName) noexcept override
 
bool IsValid () const
 
virtual unsigned long int CreateSimpleSimulator (int nrQubits)
 
void DestroySimpleSimulator (unsigned long int simHandle)
 
int RemoveAllOptimizationSimulatorsAndAdd (unsigned long int simHandle, int simType, int simExecType)
 
int AddOptimizationSimulator (unsigned long int simHandle, int simType, int simExecType)
 
char * SimpleExecute (unsigned long int simpleSim, const char *jsonCircuit, const char *jsonConfig)
 
char * SimpleEstimate (unsigned long int simpleSim, const char *jsonCircuit, const char *observableStr, const char *jsonConfig)
 
virtual void FreeResult (char *result)
 
virtual unsigned long int CreateSimulator (int simType, int simExecType)
 
void * GetSimulator (unsigned long int simHandle)
 
void DestroySimulator (unsigned long int simHandle)
 
int InitializeSimulator (void *sim)
 
int ResetSimulator (void *sim)
 
int ConfigureSimulator (void *sim, const char *key, const char *value)
 
char * GetConfiguration (void *sim, const char *key)
 
unsigned long int AllocateQubits (void *sim, unsigned long int nrQubits)
 
unsigned long int GetNumberOfQubits (void *sim)
 
int ClearSimulator (void *sim)
 
unsigned long long int Measure (void *sim, const unsigned long int *qubits, unsigned long int nrQubits)
 
int ApplyReset (void *sim, const unsigned long int *qubits, unsigned long int nrQubits)
 
double Probability (void *sim, unsigned long long int outcome)
 
virtual void FreeDoubleVector (double *vec)
 
virtual void FreeULLIVector (unsigned long long int *vec)
 
double * Amplitude (void *sim, unsigned long long int outcome)
 
double * AllProbabilities (void *sim)
 
double * Probabilities (void *sim, const unsigned long long int *qubits, unsigned long int nrQubits)
 
unsigned long long int * SampleCounts (void *sim, const unsigned long long int *qubits, unsigned long int nrQubits, unsigned long int shots)
 
int GetSimulatorType (void *sim)
 
int GetSimulationType (void *sim)
 
int FlushSimulator (void *sim)
 
int SaveStateToInternalDestructive (void *sim)
 
int RestoreInternalDestructiveSavedState (void *sim)
 
int SaveState (void *sim)
 
int RestoreState (void *sim)
 
int SetMultithreading (void *sim, int multithreading)
 
int GetMultithreading (void *sim)
 
int IsQcsim (void *sim)
 
unsigned long long int MeasureNoCollapse (void *sim)
 
int ApplyX (void *sim, int qubit)
 
int ApplyY (void *sim, int qubit)
 
int ApplyZ (void *sim, int qubit)
 
int ApplyH (void *sim, int qubit)
 
int ApplyS (void *sim, int qubit)
 
int ApplySDG (void *sim, int qubit)
 
int ApplyT (void *sim, int qubit)
 
int ApplyTDG (void *sim, int qubit)
 
int ApplySX (void *sim, int qubit)
 
int ApplySXDG (void *sim, int qubit)
 
int ApplyK (void *sim, int qubit)
 
int ApplyP (void *sim, int qubit, double theta)
 
int ApplyRx (void *sim, int qubit, double theta)
 
int ApplyRy (void *sim, int qubit, double theta)
 
int ApplyRz (void *sim, int qubit, double theta)
 
int ApplyU (void *sim, int qubit, double theta, double phi, double lambda, double gamma)
 
int ApplyCX (void *sim, int controlQubit, int targetQubit)
 
int ApplyCY (void *sim, int controlQubit, int targetQubit)
 
int ApplyCZ (void *sim, int controlQubit, int targetQubit)
 
int ApplyCH (void *sim, int controlQubit, int targetQubit)
 
int ApplyCSX (void *sim, int controlQubit, int targetQubit)
 
int ApplyCSXDG (void *sim, int controlQubit, int targetQubit)
 
int ApplyCP (void *sim, int controlQubit, int targetQubit, double theta)
 
int ApplyCRx (void *sim, int controlQubit, int targetQubit, double theta)
 
int ApplyCRy (void *sim, int controlQubit, int targetQubit, double theta)
 
int ApplyCRz (void *sim, int controlQubit, int targetQubit, double theta)
 
int ApplyCCX (void *sim, int controlQubit1, int controlQubit2, int targetQubit)
 
int ApplySwap (void *sim, int qubit1, int qubit2)
 
int ApplyCSwap (void *sim, int controlQubit, int qubit1, int qubit2)
 
int ApplyCU (void *sim, int controlQubit, int targetQubit, double theta, double phi, double lambda, double gamma)
 
- Public Member Functions inherited from Utils::Library
 Library (const Library &)=delete
 
Libraryoperator= (const Library &)=delete
 
 Library (Library &&)=default
 
Libraryoperator= (Library &&)=default
 
 Library () noexcept
 
virtual ~Library ()
 
void * GetFunction (const char *funcName) noexcept
 
const void * GetHandle () const noexcept
 
bool IsMuted () const noexcept
 
void SetMute (bool m) noexcept
 

Static Public Member Functions

static void CheckFunction (void *func, int line) noexcept
 

Detailed Description

Definition at line 5 of file MaestroLib.hpp.

Constructor & Destructor Documentation

◆ MaestroLibrary() [1/3]

MaestroLibrary::MaestroLibrary ( const MaestroLibrary )
delete

◆ MaestroLibrary() [2/3]

MaestroLibrary::MaestroLibrary ( MaestroLibrary &&  )
default

◆ MaestroLibrary() [3/3]

MaestroLibrary::MaestroLibrary ( )
inlinenoexcept

Definition at line 13 of file MaestroLib.hpp.

◆ ~MaestroLibrary()

virtual MaestroLibrary::~MaestroLibrary ( )
inlinevirtual

Definition at line 15 of file MaestroLib.hpp.

Member Function Documentation

◆ AddOptimizationSimulator()

int MaestroLibrary::AddOptimizationSimulator ( unsigned long int  simHandle,
int  simType,
int  simExecType 
)
inline

Definition at line 266 of file MaestroLib.hpp.

◆ AllocateQubits()

unsigned long int MaestroLibrary::AllocateQubits ( void *  sim,
unsigned long int  nrQubits 
)
inline

Definition at line 371 of file MaestroLib.hpp.

◆ AllProbabilities()

double * MaestroLibrary::AllProbabilities ( void *  sim)
inline

Definition at line 453 of file MaestroLib.hpp.

◆ Amplitude()

double * MaestroLibrary::Amplitude ( void *  sim,
unsigned long long int  outcome 
)
inline

Definition at line 444 of file MaestroLib.hpp.

◆ ApplyCCX()

int MaestroLibrary::ApplyCCX ( void *  sim,
int  controlQubit1,
int  controlQubit2,
int  targetQubit 
)
inline

Definition at line 791 of file MaestroLib.hpp.

◆ ApplyCH()

int MaestroLibrary::ApplyCH ( void *  sim,
int  controlQubit,
int  targetQubit 
)
inline

Definition at line 735 of file MaestroLib.hpp.

◆ ApplyCP()

int MaestroLibrary::ApplyCP ( void *  sim,
int  controlQubit,
int  targetQubit,
double  theta 
)
inline

Definition at line 759 of file MaestroLib.hpp.

◆ ApplyCRx()

int MaestroLibrary::ApplyCRx ( void *  sim,
int  controlQubit,
int  targetQubit,
double  theta 
)
inline

Definition at line 767 of file MaestroLib.hpp.

◆ ApplyCRy()

int MaestroLibrary::ApplyCRy ( void *  sim,
int  controlQubit,
int  targetQubit,
double  theta 
)
inline

Definition at line 775 of file MaestroLib.hpp.

◆ ApplyCRz()

int MaestroLibrary::ApplyCRz ( void *  sim,
int  controlQubit,
int  targetQubit,
double  theta 
)
inline

Definition at line 783 of file MaestroLib.hpp.

◆ ApplyCSwap()

int MaestroLibrary::ApplyCSwap ( void *  sim,
int  controlQubit,
int  qubit1,
int  qubit2 
)
inline

Definition at line 808 of file MaestroLib.hpp.

◆ ApplyCSX()

int MaestroLibrary::ApplyCSX ( void *  sim,
int  controlQubit,
int  targetQubit 
)
inline

Definition at line 743 of file MaestroLib.hpp.

◆ ApplyCSXDG()

int MaestroLibrary::ApplyCSXDG ( void *  sim,
int  controlQubit,
int  targetQubit 
)
inline

Definition at line 751 of file MaestroLib.hpp.

◆ ApplyCU()

int MaestroLibrary::ApplyCU ( void *  sim,
int  controlQubit,
int  targetQubit,
double  theta,
double  phi,
double  lambda,
double  gamma 
)
inline

Definition at line 816 of file MaestroLib.hpp.

◆ ApplyCX()

int MaestroLibrary::ApplyCX ( void *  sim,
int  controlQubit,
int  targetQubit 
)
inline

Definition at line 711 of file MaestroLib.hpp.

◆ ApplyCY()

int MaestroLibrary::ApplyCY ( void *  sim,
int  controlQubit,
int  targetQubit 
)
inline

Definition at line 719 of file MaestroLib.hpp.

◆ ApplyCZ()

int MaestroLibrary::ApplyCZ ( void *  sim,
int  controlQubit,
int  targetQubit 
)
inline

Definition at line 727 of file MaestroLib.hpp.

◆ ApplyH()

int MaestroLibrary::ApplyH ( void *  sim,
int  qubit 
)
inline

Definition at line 606 of file MaestroLib.hpp.

◆ ApplyK()

int MaestroLibrary::ApplyK ( void *  sim,
int  qubit 
)
inline

Definition at line 662 of file MaestroLib.hpp.

◆ ApplyP()

int MaestroLibrary::ApplyP ( void *  sim,
int  qubit,
double  theta 
)
inline

Definition at line 670 of file MaestroLib.hpp.

◆ ApplyReset()

int MaestroLibrary::ApplyReset ( void *  sim,
const unsigned long int *  qubits,
unsigned long int  nrQubits 
)
inline

Definition at line 409 of file MaestroLib.hpp.

◆ ApplyRx()

int MaestroLibrary::ApplyRx ( void *  sim,
int  qubit,
double  theta 
)
inline

Definition at line 678 of file MaestroLib.hpp.

◆ ApplyRy()

int MaestroLibrary::ApplyRy ( void *  sim,
int  qubit,
double  theta 
)
inline

Definition at line 686 of file MaestroLib.hpp.

◆ ApplyRz()

int MaestroLibrary::ApplyRz ( void *  sim,
int  qubit,
double  theta 
)
inline

Definition at line 694 of file MaestroLib.hpp.

◆ ApplyS()

int MaestroLibrary::ApplyS ( void *  sim,
int  qubit 
)
inline

Definition at line 614 of file MaestroLib.hpp.

◆ ApplySDG()

int MaestroLibrary::ApplySDG ( void *  sim,
int  qubit 
)
inline

Definition at line 622 of file MaestroLib.hpp.

◆ ApplySwap()

int MaestroLibrary::ApplySwap ( void *  sim,
int  qubit1,
int  qubit2 
)
inline

Definition at line 800 of file MaestroLib.hpp.

◆ ApplySX()

int MaestroLibrary::ApplySX ( void *  sim,
int  qubit 
)
inline

Definition at line 646 of file MaestroLib.hpp.

◆ ApplySXDG()

int MaestroLibrary::ApplySXDG ( void *  sim,
int  qubit 
)
inline

Definition at line 654 of file MaestroLib.hpp.

◆ ApplyT()

int MaestroLibrary::ApplyT ( void *  sim,
int  qubit 
)
inline

Definition at line 630 of file MaestroLib.hpp.

◆ ApplyTDG()

int MaestroLibrary::ApplyTDG ( void *  sim,
int  qubit 
)
inline

Definition at line 638 of file MaestroLib.hpp.

◆ ApplyU()

int MaestroLibrary::ApplyU ( void *  sim,
int  qubit,
double  theta,
double  phi,
double  lambda,
double  gamma 
)
inline

Definition at line 702 of file MaestroLib.hpp.

◆ ApplyX()

int MaestroLibrary::ApplyX ( void *  sim,
int  qubit 
)
inline

Definition at line 582 of file MaestroLib.hpp.

◆ ApplyY()

int MaestroLibrary::ApplyY ( void *  sim,
int  qubit 
)
inline

Definition at line 590 of file MaestroLib.hpp.

◆ ApplyZ()

int MaestroLibrary::ApplyZ ( void *  sim,
int  qubit 
)
inline

Definition at line 598 of file MaestroLib.hpp.

◆ CheckFunction()

static void MaestroLibrary::CheckFunction ( void *  func,
int  line 
)
inlinestaticnoexcept

Definition at line 217 of file MaestroLib.hpp.

◆ ClearSimulator()

int MaestroLibrary::ClearSimulator ( void *  sim)
inline

Definition at line 390 of file MaestroLib.hpp.

◆ ConfigureSimulator()

int MaestroLibrary::ConfigureSimulator ( void *  sim,
const char *  key,
const char *  value 
)
inline

Definition at line 352 of file MaestroLib.hpp.

◆ CreateSimpleSimulator()

virtual unsigned long int MaestroLibrary::CreateSimpleSimulator ( int  nrQubits)
inlinevirtual

Reimplemented in SimpleSimulator.

Definition at line 235 of file MaestroLib.hpp.

◆ CreateSimulator()

virtual unsigned long int MaestroLibrary::CreateSimulator ( int  simType,
int  simExecType 
)
inlinevirtual

Reimplemented in Simulator.

Definition at line 307 of file MaestroLib.hpp.

◆ DestroySimpleSimulator()

void MaestroLibrary::DestroySimpleSimulator ( unsigned long int  simHandle)
inline

Definition at line 245 of file MaestroLib.hpp.

◆ DestroySimulator()

void MaestroLibrary::DestroySimulator ( unsigned long int  simHandle)
inline

Definition at line 324 of file MaestroLib.hpp.

◆ FlushSimulator()

int MaestroLibrary::FlushSimulator ( void *  sim)
inline

Definition at line 502 of file MaestroLib.hpp.

◆ FreeDoubleVector()

virtual void MaestroLibrary::FreeDoubleVector ( double *  vec)
inlinevirtual

Reimplemented in Simulator.

Definition at line 428 of file MaestroLib.hpp.

◆ FreeResult()

virtual void MaestroLibrary::FreeResult ( char *  result)
inlinevirtual

Reimplemented in Simulator, and SimpleSimulator.

Definition at line 300 of file MaestroLib.hpp.

◆ FreeULLIVector()

virtual void MaestroLibrary::FreeULLIVector ( unsigned long long int *  vec)
inlinevirtual

Reimplemented in Simulator.

Definition at line 436 of file MaestroLib.hpp.

◆ GetConfiguration()

char * MaestroLibrary::GetConfiguration ( void *  sim,
const char *  key 
)
inline

Definition at line 362 of file MaestroLib.hpp.

◆ GetMultithreading()

int MaestroLibrary::GetMultithreading ( void *  sim)
inline

Definition at line 555 of file MaestroLib.hpp.

◆ GetNumberOfQubits()

unsigned long int MaestroLibrary::GetNumberOfQubits ( void *  sim)
inline

Definition at line 380 of file MaestroLib.hpp.

◆ GetSimulationType()

int MaestroLibrary::GetSimulationType ( void *  sim)
inline

Definition at line 493 of file MaestroLib.hpp.

◆ GetSimulator()

void * MaestroLibrary::GetSimulator ( unsigned long int  simHandle)
inline

Definition at line 317 of file MaestroLib.hpp.

◆ GetSimulatorType()

int MaestroLibrary::GetSimulatorType ( void *  sim)
inline

Definition at line 484 of file MaestroLib.hpp.

◆ Init()

bool MaestroLibrary::Init ( const char *  libName)
inlineoverridevirtualnoexcept

Reimplemented from Utils::Library.

Reimplemented in SimpleSimulator, and Simulator.

Definition at line 17 of file MaestroLib.hpp.

◆ InitializeSimulator()

int MaestroLibrary::InitializeSimulator ( void *  sim)
inline

Definition at line 332 of file MaestroLib.hpp.

◆ IsQcsim()

int MaestroLibrary::IsQcsim ( void *  sim)
inline

Definition at line 564 of file MaestroLib.hpp.

◆ IsValid()

bool MaestroLibrary::IsValid ( ) const
inline

Definition at line 233 of file MaestroLib.hpp.

◆ Measure()

unsigned long long int MaestroLibrary::Measure ( void *  sim,
const unsigned long int *  qubits,
unsigned long int  nrQubits 
)
inline

Definition at line 399 of file MaestroLib.hpp.

◆ MeasureNoCollapse()

unsigned long long int MaestroLibrary::MeasureNoCollapse ( void *  sim)
inline

Definition at line 573 of file MaestroLib.hpp.

◆ operator=() [1/2]

MaestroLibrary & MaestroLibrary::operator= ( const MaestroLibrary )
delete

◆ operator=() [2/2]

MaestroLibrary & MaestroLibrary::operator= ( MaestroLibrary &&  )
default

◆ Probabilities()

double * MaestroLibrary::Probabilities ( void *  sim,
const unsigned long long int *  qubits,
unsigned long int  nrQubits 
)
inline

Definition at line 462 of file MaestroLib.hpp.

◆ Probability()

double MaestroLibrary::Probability ( void *  sim,
unsigned long long int  outcome 
)
inline

Definition at line 419 of file MaestroLib.hpp.

◆ RemoveAllOptimizationSimulatorsAndAdd()

int MaestroLibrary::RemoveAllOptimizationSimulatorsAndAdd ( unsigned long int  simHandle,
int  simType,
int  simExecType 
)
inline

Definition at line 253 of file MaestroLib.hpp.

◆ ResetSimulator()

int MaestroLibrary::ResetSimulator ( void *  sim)
inline

Definition at line 342 of file MaestroLib.hpp.

◆ RestoreInternalDestructiveSavedState()

int MaestroLibrary::RestoreInternalDestructiveSavedState ( void *  sim)
inline

Definition at line 521 of file MaestroLib.hpp.

◆ RestoreState()

int MaestroLibrary::RestoreState ( void *  sim)
inline

Definition at line 539 of file MaestroLib.hpp.

◆ SampleCounts()

unsigned long long int * MaestroLibrary::SampleCounts ( void *  sim,
const unsigned long long int *  qubits,
unsigned long int  nrQubits,
unsigned long int  shots 
)
inline

Definition at line 472 of file MaestroLib.hpp.

◆ SaveState()

int MaestroLibrary::SaveState ( void *  sim)
inline

Definition at line 531 of file MaestroLib.hpp.

◆ SaveStateToInternalDestructive()

int MaestroLibrary::SaveStateToInternalDestructive ( void *  sim)
inline

Definition at line 511 of file MaestroLib.hpp.

◆ SetMultithreading()

int MaestroLibrary::SetMultithreading ( void *  sim,
int  multithreading 
)
inline

Definition at line 547 of file MaestroLib.hpp.

◆ SimpleEstimate()

char * MaestroLibrary::SimpleEstimate ( unsigned long int  simpleSim,
const char *  jsonCircuit,
const char *  observableStr,
const char *  jsonConfig 
)
inline

Definition at line 288 of file MaestroLib.hpp.

◆ SimpleExecute()

char * MaestroLibrary::SimpleExecute ( unsigned long int  simpleSim,
const char *  jsonCircuit,
const char *  jsonConfig 
)
inline

Definition at line 277 of file MaestroLib.hpp.


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