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

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

References MaestroLibrary().

◆ 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 267 of file MaestroLib.hpp.

Referenced by SimpleSimulator::AddOptimizationSimulator().

◆ AllocateQubits()

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

Definition at line 372 of file MaestroLib.hpp.

Referenced by Simulator::AllocateQubits().

◆ AllProbabilities()

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

Definition at line 454 of file MaestroLib.hpp.

Referenced by Simulator::AllProbabilities().

◆ Amplitude()

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

Definition at line 445 of file MaestroLib.hpp.

Referenced by Simulator::Amplitude().

◆ ApplyCCX()

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

Definition at line 792 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCCX().

◆ ApplyCH()

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

Definition at line 736 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCH().

◆ ApplyCP()

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

Definition at line 760 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCP().

◆ ApplyCRx()

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

Definition at line 768 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCRx().

◆ ApplyCRy()

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

Definition at line 776 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCRy().

◆ ApplyCRz()

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

Definition at line 784 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCRz().

◆ ApplyCSwap()

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

Definition at line 809 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCSwap().

◆ ApplyCSX()

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

Definition at line 744 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCSX().

◆ ApplyCSXDG()

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

Definition at line 752 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCSXDG().

◆ ApplyCU()

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

Definition at line 817 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCU().

◆ ApplyCX()

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

Definition at line 712 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCX().

◆ ApplyCY()

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

Definition at line 720 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCY().

◆ ApplyCZ()

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

Definition at line 728 of file MaestroLib.hpp.

Referenced by Simulator::ApplyCZ().

◆ ApplyH()

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

Definition at line 607 of file MaestroLib.hpp.

Referenced by Simulator::ApplyH().

◆ ApplyK()

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

Definition at line 663 of file MaestroLib.hpp.

Referenced by Simulator::ApplyK().

◆ ApplyP()

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

Definition at line 671 of file MaestroLib.hpp.

Referenced by Simulator::ApplyP().

◆ ApplyReset()

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

Definition at line 410 of file MaestroLib.hpp.

Referenced by Simulator::ApplyReset().

◆ ApplyRx()

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

Definition at line 679 of file MaestroLib.hpp.

Referenced by Simulator::ApplyRx().

◆ ApplyRy()

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

Definition at line 687 of file MaestroLib.hpp.

Referenced by Simulator::ApplyRy().

◆ ApplyRz()

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

Definition at line 695 of file MaestroLib.hpp.

Referenced by Simulator::ApplyRz().

◆ ApplyS()

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

Definition at line 615 of file MaestroLib.hpp.

Referenced by Simulator::ApplyS().

◆ ApplySDG()

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

Definition at line 623 of file MaestroLib.hpp.

Referenced by Simulator::ApplySDG().

◆ ApplySwap()

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

Definition at line 801 of file MaestroLib.hpp.

Referenced by Simulator::ApplySwap().

◆ ApplySX()

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

Definition at line 647 of file MaestroLib.hpp.

Referenced by Simulator::ApplySX().

◆ ApplySXDG()

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

Definition at line 655 of file MaestroLib.hpp.

Referenced by Simulator::ApplySXDG().

◆ ApplyT()

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

Definition at line 631 of file MaestroLib.hpp.

Referenced by Simulator::ApplyT().

◆ ApplyTDG()

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

Definition at line 639 of file MaestroLib.hpp.

Referenced by Simulator::ApplyTDG().

◆ ApplyU()

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

Definition at line 703 of file MaestroLib.hpp.

Referenced by Simulator::ApplyU().

◆ ApplyX()

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

Definition at line 583 of file MaestroLib.hpp.

Referenced by Simulator::ApplyX().

◆ ApplyY()

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

Definition at line 591 of file MaestroLib.hpp.

Referenced by Simulator::ApplyY().

◆ ApplyZ()

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

Definition at line 599 of file MaestroLib.hpp.

Referenced by Simulator::ApplyZ().

◆ CheckFunction()

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

Definition at line 218 of file MaestroLib.hpp.

Referenced by Init().

◆ ClearSimulator()

int MaestroLibrary::ClearSimulator ( void * sim)
inline

Definition at line 391 of file MaestroLib.hpp.

Referenced by Simulator::ClearSimulator().

◆ ConfigureSimulator()

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

Definition at line 353 of file MaestroLib.hpp.

Referenced by Simulator::ConfigureSimulator().

◆ CreateSimpleSimulator()

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

Reimplemented in SimpleSimulator.

Definition at line 236 of file MaestroLib.hpp.

Referenced by SimpleSimulator::CreateSimpleSimulator().

◆ CreateSimulator()

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

Reimplemented in Simulator.

Definition at line 308 of file MaestroLib.hpp.

Referenced by Simulator::CreateSimulator().

◆ DestroySimpleSimulator()

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

◆ DestroySimulator()

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

Definition at line 325 of file MaestroLib.hpp.

Referenced by Simulator::~Simulator(), and Simulator::CreateSimulator().

◆ FlushSimulator()

int MaestroLibrary::FlushSimulator ( void * sim)
inline

Definition at line 503 of file MaestroLib.hpp.

Referenced by Simulator::FlushSimulator().

◆ FreeDoubleVector()

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

Reimplemented in Simulator.

Definition at line 429 of file MaestroLib.hpp.

Referenced by Simulator::FreeDoubleVector().

◆ FreeResult()

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

Reimplemented in SimpleSimulator, and Simulator.

Definition at line 301 of file MaestroLib.hpp.

Referenced by SimpleSimulator::FreeResult(), and Simulator::FreeResult().

◆ FreeULLIVector()

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

Reimplemented in Simulator.

Definition at line 437 of file MaestroLib.hpp.

Referenced by Simulator::FreeULLIVector().

◆ GetConfiguration()

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

Definition at line 363 of file MaestroLib.hpp.

Referenced by Simulator::GetConfiguration().

◆ GetFunction()

void * Utils::Library::GetFunction ( const char * funcName)
inlinenoexceptinherited

Definition at line 104 of file Library.h.

Referenced by MaestroLibrary::Init(), and Simulators::QuestLibSim::Init().

◆ GetHandle()

const void * Utils::Library::GetHandle ( ) const
inlinenoexceptinherited

Definition at line 112 of file Library.h.

◆ GetMultithreading()

int MaestroLibrary::GetMultithreading ( void * sim)
inline

Definition at line 556 of file MaestroLib.hpp.

Referenced by Simulator::GetMultithreading().

◆ GetNumberOfQubits()

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

Definition at line 381 of file MaestroLib.hpp.

Referenced by Simulator::GetNumberOfQubits().

◆ GetSimulationType()

int MaestroLibrary::GetSimulationType ( void * sim)
inline

Definition at line 494 of file MaestroLib.hpp.

Referenced by Simulator::GetSimulationType().

◆ GetSimulator()

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

Definition at line 318 of file MaestroLib.hpp.

Referenced by Simulator::CreateSimulator(), and Simulator::GetSimulator().

◆ GetSimulatorType()

int MaestroLibrary::GetSimulatorType ( void * sim)
inline

Definition at line 485 of file MaestroLib.hpp.

Referenced by Simulator::GetSimulatorType().

◆ 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.

References CheckFunction(), Utils::Library::GetFunction(), and Utils::Library::Init().

Referenced by SimpleSimulator::Init(), and Simulator::Init().

◆ InitializeSimulator()

int MaestroLibrary::InitializeSimulator ( void * sim)
inline

Definition at line 333 of file MaestroLib.hpp.

Referenced by Simulator::InitializeSimulator().

◆ IsMuted()

bool Utils::Library::IsMuted ( ) const
inlinenoexceptinherited

Definition at line 114 of file Library.h.

◆ IsQcsim()

int MaestroLibrary::IsQcsim ( void * sim)
inline

Definition at line 565 of file MaestroLib.hpp.

Referenced by Simulator::IsQcsim().

◆ IsValid()

bool MaestroLibrary::IsValid ( ) const
inline

Definition at line 234 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 400 of file MaestroLib.hpp.

Referenced by Simulator::Measure().

◆ MeasureNoCollapse()

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

Definition at line 574 of file MaestroLib.hpp.

Referenced by Simulator::MeasureNoCollapse().

◆ operator=() [1/2]

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

References MaestroLibrary().

◆ operator=() [2/2]

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

References MaestroLibrary().

◆ Probabilities()

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

Definition at line 463 of file MaestroLib.hpp.

Referenced by Simulator::Probabilities().

◆ Probability()

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

Definition at line 420 of file MaestroLib.hpp.

Referenced by Simulator::Probability().

◆ RemoveAllOptimizationSimulatorsAndAdd()

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

◆ ResetSimulator()

int MaestroLibrary::ResetSimulator ( void * sim)
inline

Definition at line 343 of file MaestroLib.hpp.

Referenced by Simulator::ResetSimulator().

◆ RestoreInternalDestructiveSavedState()

int MaestroLibrary::RestoreInternalDestructiveSavedState ( void * sim)
inline

Definition at line 522 of file MaestroLib.hpp.

Referenced by Simulator::RestoreInternalDestructiveSavedState().

◆ RestoreState()

int MaestroLibrary::RestoreState ( void * sim)
inline

Definition at line 540 of file MaestroLib.hpp.

Referenced by Simulator::RestoreState().

◆ 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 473 of file MaestroLib.hpp.

Referenced by Simulator::SampleCounts().

◆ SaveState()

int MaestroLibrary::SaveState ( void * sim)
inline

Definition at line 532 of file MaestroLib.hpp.

Referenced by Simulator::SaveState().

◆ SaveStateToInternalDestructive()

int MaestroLibrary::SaveStateToInternalDestructive ( void * sim)
inline

Definition at line 512 of file MaestroLib.hpp.

Referenced by Simulator::SaveStateToInternalDestructive().

◆ SetMultithreading()

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

Definition at line 548 of file MaestroLib.hpp.

Referenced by Simulator::SetMultithreading().

◆ SetMute()

void Utils::Library::SetMute ( bool m)
inlinenoexceptinherited

Definition at line 116 of file Library.h.

◆ SimpleEstimate()

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

Definition at line 289 of file MaestroLib.hpp.

Referenced by SimpleSimulator::SimpleEstimate().

◆ SimpleExecute()

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

Definition at line 278 of file MaestroLib.hpp.

Referenced by SimpleSimulator::SimpleExecute().


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