Maestro 0.3.11
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
QCSimState.h
Go to the documentation of this file.
1#pragma once
2#if defined(INCLUDED_BY_FACTORY)
4
6{
7class QCSimState : public FusionState
8{
9 public:
10 explicit QCSimState(std::shared_ptr<ISimulator> immediate) : FusionState(std::move(immediate))
11 {
12 }
13
14 unsigned GetGateFusionMaxQubits() const override
15 {
16 switch (GetSimulationType())
17 {
18 case SimulationType::kStatevector:
19 case SimulationType::kDensityMatrix:
20 return 3;
21 case SimulationType::kMatrixProductState:
22 case SimulationType::kMatrixProductOperator:
23 case SimulationType::kTensorNetwork:
24 return 2;
25 default:
26 return 0;
27 }
28 }
29
30 protected:
31 // Measured break-even of fused against native execution (geometric mean
32 // over random, QAOA, QFT, quantum-volume and GHZ circuits). Below it the
33 // state fits in cache, so fusing saves no memory passes and the dense
34 // kernels cost more than the native gates they replace.
35 size_t DefaultGateFusionMinQubits() const override
36 {
37 switch (GetSimulationType())
38 {
39 case SimulationType::kStatevector:
40 return 11;
41 case SimulationType::kDensityMatrix:
42 return 5;
43 default:
44 return 0;
45 }
46 }
47};
48} // namespace Simulators::Private
49#endif
int GetSimulationType(void *sim)
unsigned GetGateFusionMaxQubits(void *sim)