Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run(self, ket: State = None) -> State:
if ket is None:
qubits = self.qubits
ket = zero_state(qubits=qubits)
else:
raise NotImplementedError("Not yet implemented in qsim")
sim = qsimcirq.QSimSimulator()
res = sim.simulate(self._qsim_circuit)
res = cast(cirq.WaveFunctionTrialResult, res)
tensor = res.state_vector()
return State(tensor, ket.qubits, ket.memory)