Source code for tequila_code.simulators.simulator_qulacs_gpu

import qulacs
from tequila import TequilaException
from tequila.simulators.simulator_qulacs import BackendCircuitQulacs, BackendExpectationValueQulacs

[docs] class TequilaQulacsGpuException(TequilaException): def __str__(self): return "Error in qulacs gpu backend:" + self.message
[docs] class BackendCircuitQulacsGpu(BackendCircuitQulacs):
[docs] def initialize_state(self, n_qubits:int=None) -> qulacs.QuantumState: if n_qubits is None: n_qubits = self.n_qubits return qulacs.QuantumStateGpu(n_qubits)
[docs] class BackendExpectationValueQulacsGpu(BackendExpectationValueQulacs): BackendCircuitType = BackendCircuitQulacsGpu pass