63 static bool InitGpuLibraryWithMute();
66 return gpuLibrary && gpuLibrary->IsValid();
69 static std::shared_ptr<GpuLibrary> GetGpuLibrary() {
70 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
74 static std::unique_ptr<GpuLibStateVectorSim> CreateGpuLibStateVectorSim() {
75 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
77 return std::make_unique<GpuLibStateVectorSim>(gpuLibrary);
80 static std::unique_ptr<GpuLibMPSSim> CreateGpuLibMPSSim() {
81 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
83 return std::make_unique<GpuLibMPSSim>(gpuLibrary);
86 static std::unique_ptr<GpuLibTNSim> CreateGpuLibTensorNetSim() {
87 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
89 return std::make_unique<GpuLibTNSim>(gpuLibrary);
92 static std::shared_ptr<GpuStabilizer> CreateGpuStabilizerSimulator() {
93 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
94 return std::make_shared<GpuStabilizer>(gpuLibrary);
97 static std::shared_ptr<GpuPauliPropagator>
98 CreateGpuPauliPropagatorSimulator() {
99 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
100 return std::make_shared<GpuPauliPropagator>(gpuLibrary);
103 static std::unique_ptr<GpuPauliPropagator>
104 CreateGpuPauliPropagatorSimulatorUnique() {
105 if (!gpuLibrary || !gpuLibrary->IsValid())
return nullptr;
106 return std::make_unique<GpuPauliPropagator>(gpuLibrary);
110 static std::shared_ptr<GpuLibrary> gpuLibrary;
111 static std::atomic_bool firstTime;
121 return questLibrary && questLibrary->IsValid();
125 if (!questLibrary || !questLibrary->IsValid())
return nullptr;
130 return std::make_shared<PathIntegralSimulator>();
134 static std::shared_ptr<QuestLibSim> questLibrary;
135 static std::atomic_bool firstTimeQuest;