How to use qsimcirq - 2 common examples

To help you get started, we’ve selected a few qsimcirq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gecrooks / quantumflow-dev / quantumflow / xqsim.py View on Github external
def __init__(self, *elements: Operation,
                 translate: bool = False) -> None:
        circ = Circuit(*elements)
        if translate:
            circ = translate_circuit_to_qsim(circ)
        self._circuit = circ
        self._cirq = circuit_to_cirq(self._circuit)
        self._qsim_circuit = qsimcirq.QSimCircuit(self._cirq)
github gecrooks / quantumflow-dev / quantumflow / xqsim.py View on Github external
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)

qsimcirq

Schrödinger and Schrödinger-Feynman simulators for quantum circuits.

Apache-2.0
Latest version published 9 months ago

Package Health Score

66 / 100
Full package analysis