ngnrsaa / qflex

Flexible Quantum Circuit Simulator (qFlex) implements an efficient tensor network, CPU-based simulator of large quantum circuits.
Apache License 2.0
97 stars 25 forks source link

Make fsim, rz, and w_1_2 gates work #152

Closed benjaminvillalonga closed 5 years ago

benjaminvillalonga commented 5 years ago

Correctly implement reading and loading fsim, rz, and w_1_2 gates.

benjaminvillalonga commented 5 years ago

w_1_2 being hz_1_2

alexandrupaler commented 5 years ago

Is the line fsim(0.48112498558227507, 0.15642764309600338) equivalent to the cirq fsim gate where the floats are radians theta, phi and (from documentation of Cirq)


theta: Swap angle on the span(|01⟩, |10⟩) subspace, in radians.
                Determined by the strength and duration of the XX+YY
                interaction. Note: uses opposite sign convention to the
                iSWAP gate.
phi: Controlled phase angle, in radians. Determines how much the
                |11⟩ state is phased. Note: uses opposite sign convention to
                the CZPowGate.
alexandrupaler commented 5 years ago

Another two questions:

If this and the above comment make sense, I could try and include fsim and rz

benjaminvillalonga commented 5 years ago
alexandrupaler commented 5 years ago

I see, this means W isops.PhasedXPowGate(phase_exponent=0.25, exponent=0.5) where

phase_exponent: The exponent on the Z gates conjugating the X gate.
exponent: The exponent on the X gate conjugated by Zs.

Please correct me if I am wrong.

benjaminvillalonga commented 5 years ago

See #155 for continued discussion. Implementation will happen there.

benjaminvillalonga commented 5 years ago

This PR was solved in #155