|
Maestro 0.1.0
Unified interface for quantum circuit simulation
|
#include "Interface.h"#include "../Simulators/Factory.h"#include "Maestro.h"#include "Json.h"#include <boost/json/src.hpp>#include <atomic>#include <memory>#include "../Utils/LogFile.h"#include "../qasm/QasmCirc.h"
Include dependency graph for Interface.cpp:Go to the source code of this file.
Functions | |
| void * | GetMaestroObject () |
| void * | GetMaestroObjectWithMute () |
| 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 *circuitStr, const char *jsonConfig) |
| char * | SimpleEstimate (unsigned long int simpleSim, const char *circuitStr, const char *observableStr, const char *jsonConfig) |
| void | FreeResult (char *result) |
| unsigned long int | CreateSimulator (int simType, int simExecType) |
| void * | GetSimulator (unsigned long int simHandle) |
| void | DestroySimulator (unsigned long int simHandle) |
| 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) |
| 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) |
| void | FreeDoubleVector (double *vec) |
| 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) |
Variables | |
| static std::atomic_bool | isInitialized {false} |
| static std::unique_ptr< Maestro > | maestroInstance |
| int AddOptimizationSimulator | ( | unsigned long int | simHandle, |
| int | simType, | ||
| int | simExecType | ||
| ) |
Definition at line 104 of file Interface.cpp.
| unsigned long int AllocateQubits | ( | void * | sim, |
| unsigned long int | nrQubits | ||
| ) |
Definition at line 861 of file Interface.cpp.
| double * AllProbabilities | ( | void * | sim | ) |
Definition at line 954 of file Interface.cpp.
| double * Amplitude | ( | void * | sim, |
| unsigned long long int | outcome | ||
| ) |
Definition at line 940 of file Interface.cpp.
| int ApplyCCX | ( | void * | sim, |
| int | controlQubit1, | ||
| int | controlQubit2, | ||
| int | targetQubit | ||
| ) |
Definition at line 768 of file Interface.cpp.
| int ApplyCH | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit | ||
| ) |
Definition at line 691 of file Interface.cpp.
| int ApplyCP | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit, | ||
| double | theta | ||
| ) |
Definition at line 724 of file Interface.cpp.
| int ApplyCRx | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit, | ||
| double | theta | ||
| ) |
Definition at line 735 of file Interface.cpp.
| int ApplyCRy | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit, | ||
| double | theta | ||
| ) |
Definition at line 746 of file Interface.cpp.
| int ApplyCRz | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit, | ||
| double | theta | ||
| ) |
Definition at line 757 of file Interface.cpp.
| int ApplyCSwap | ( | void * | sim, |
| int | controlQubit, | ||
| int | qubit1, | ||
| int | qubit2 | ||
| ) |
Definition at line 791 of file Interface.cpp.
| int ApplyCSX | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit | ||
| ) |
Definition at line 702 of file Interface.cpp.
| int ApplyCSXDG | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit | ||
| ) |
Definition at line 713 of file Interface.cpp.
| int ApplyCU | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit, | ||
| double | theta, | ||
| double | phi, | ||
| double | lambda, | ||
| double | gamma | ||
| ) |
Definition at line 802 of file Interface.cpp.
| int ApplyCX | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit | ||
| ) |
Definition at line 658 of file Interface.cpp.
| int ApplyCY | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit | ||
| ) |
Definition at line 669 of file Interface.cpp.
| int ApplyCZ | ( | void * | sim, |
| int | controlQubit, | ||
| int | targetQubit | ||
| ) |
Definition at line 680 of file Interface.cpp.
| int ApplyH | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 514 of file Interface.cpp.
| int ApplyK | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 591 of file Interface.cpp.
| int ApplyP | ( | void * | sim, |
| int | qubit, | ||
| double | theta | ||
| ) |
Definition at line 602 of file Interface.cpp.
| int ApplyReset | ( | void * | sim, |
| const unsigned long int * | qubits, | ||
| unsigned long int | nrQubits | ||
| ) |
Definition at line 904 of file Interface.cpp.
| int ApplyRx | ( | void * | sim, |
| int | qubit, | ||
| double | theta | ||
| ) |
Definition at line 613 of file Interface.cpp.
| int ApplyRy | ( | void * | sim, |
| int | qubit, | ||
| double | theta | ||
| ) |
Definition at line 624 of file Interface.cpp.
| int ApplyRz | ( | void * | sim, |
| int | qubit, | ||
| double | theta | ||
| ) |
Definition at line 635 of file Interface.cpp.
| int ApplyS | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 525 of file Interface.cpp.
| int ApplySDG | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 536 of file Interface.cpp.
| int ApplySwap | ( | void * | sim, |
| int | qubit1, | ||
| int | qubit2 | ||
| ) |
Definition at line 780 of file Interface.cpp.
| int ApplySX | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 569 of file Interface.cpp.
| int ApplySXDG | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 580 of file Interface.cpp.
| int ApplyT | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 547 of file Interface.cpp.
| int ApplyTDG | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 558 of file Interface.cpp.
| int ApplyU | ( | void * | sim, |
| int | qubit, | ||
| double | theta, | ||
| double | phi, | ||
| double | lambda, | ||
| double | gamma | ||
| ) |
Definition at line 646 of file Interface.cpp.
| int ApplyX | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 480 of file Interface.cpp.
| int ApplyY | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 492 of file Interface.cpp.
| int ApplyZ | ( | void * | sim, |
| int | qubit | ||
| ) |
Definition at line 503 of file Interface.cpp.
| int ClearSimulator | ( | void * | sim | ) |
Definition at line 882 of file Interface.cpp.
| int ConfigureSimulator | ( | void * | sim, |
| const char * | key, | ||
| const char * | value | ||
| ) |
Definition at line 834 of file Interface.cpp.
| unsigned long int CreateSimpleSimulator | ( | int | nrQubits | ) |
Definition at line 74 of file Interface.cpp.
| unsigned long int CreateSimulator | ( | int | simType, |
| int | simExecType | ||
| ) |
Definition at line 453 of file Interface.cpp.
| void DestroySimpleSimulator | ( | unsigned long int | simHandle | ) |
Definition at line 83 of file Interface.cpp.
| void DestroySimulator | ( | unsigned long int | simHandle | ) |
Definition at line 472 of file Interface.cpp.
| int FlushSimulator | ( | void * | sim | ) |
Definition at line 1025 of file Interface.cpp.
| void FreeDoubleVector | ( | double * | vec | ) |
Definition at line 926 of file Interface.cpp.
| void FreeResult | ( | char * | result | ) |
Definition at line 446 of file Interface.cpp.
| void FreeULLIVector | ( | unsigned long long int * | vec | ) |
Definition at line 933 of file Interface.cpp.
| char * GetConfiguration | ( | void * | sim, |
| const char * | key | ||
| ) |
Definition at line 844 of file Interface.cpp.
| void * GetMaestroObject | ( | ) |
Definition at line 36 of file Interface.cpp.
| void * GetMaestroObjectWithMute | ( | ) |
Definition at line 55 of file Interface.cpp.
| int GetMultithreading | ( | void * | sim | ) |
Definition at line 1085 of file Interface.cpp.
| unsigned long int GetNumberOfQubits | ( | void * | sim | ) |
Definition at line 872 of file Interface.cpp.
| int GetSimulationType | ( | void * | sim | ) |
Definition at line 1016 of file Interface.cpp.
| void * GetSimulator | ( | unsigned long int | simHandle | ) |
Definition at line 464 of file Interface.cpp.
| int GetSimulatorType | ( | void * | sim | ) |
Definition at line 1007 of file Interface.cpp.
| int InitializeSimulator | ( | void * | sim | ) |
Definition at line 814 of file Interface.cpp.
| int IsQcsim | ( | void * | sim | ) |
Definition at line 1094 of file Interface.cpp.
| unsigned long long int Measure | ( | void * | sim, |
| const unsigned long int * | qubits, | ||
| unsigned long int | nrQubits | ||
| ) |
Definition at line 892 of file Interface.cpp.
| unsigned long long int MeasureNoCollapse | ( | void * | sim | ) |
Definition at line 1103 of file Interface.cpp.
| double * Probabilities | ( | void * | sim, |
| const unsigned long long int * | qubits, | ||
| unsigned long int | nrQubits | ||
| ) |
Definition at line 967 of file Interface.cpp.
| double Probability | ( | void * | sim, |
| unsigned long long int | outcome | ||
| ) |
Definition at line 916 of file Interface.cpp.
| int RemoveAllOptimizationSimulatorsAndAdd | ( | unsigned long int | simHandle, |
| int | simType, | ||
| int | simExecType | ||
| ) |
Definition at line 92 of file Interface.cpp.
| int ResetSimulator | ( | void * | sim | ) |
Definition at line 824 of file Interface.cpp.
| int RestoreInternalDestructiveSavedState | ( | void * | sim | ) |
Definition at line 1045 of file Interface.cpp.
| int RestoreState | ( | void * | sim | ) |
Definition at line 1065 of file Interface.cpp.
| unsigned long long int * SampleCounts | ( | void * | sim, |
| const unsigned long long int * | qubits, | ||
| unsigned long int | nrQubits, | ||
| unsigned long int | shots | ||
| ) |
Definition at line 982 of file Interface.cpp.
| int SaveState | ( | void * | sim | ) |
Definition at line 1055 of file Interface.cpp.
| int SaveStateToInternalDestructive | ( | void * | sim | ) |
Definition at line 1035 of file Interface.cpp.
| int SetMultithreading | ( | void * | sim, |
| int | multithreading | ||
| ) |
Definition at line 1075 of file Interface.cpp.
| char * SimpleEstimate | ( | unsigned long int | simpleSim, |
| const char * | circuitStr, | ||
| const char * | observableStr, | ||
| const char * | jsonConfig | ||
| ) |
Definition at line 301 of file Interface.cpp.
| char * SimpleExecute | ( | unsigned long int | simpleSim, |
| const char * | circuitStr, | ||
| const char * | jsonConfig | ||
| ) |
Definition at line 116 of file Interface.cpp.
|
static |
Definition at line 29 of file Interface.cpp.
|
static |
Definition at line 30 of file Interface.cpp.