jaqalpaq.transpilers.cirq package

jaqalpaq.transpilers.cirq.jaqal_circuit_from_cirq_circuit(ccirc, names=None, native_gates=None)

Converts a Cirq Circuit object to a jaqalpaq.core.Circuit. The circuit will be structured as a sequence of parallel blocks, one for each Cirq Moment in the input.

Measurement are supported, but only if applied to every qubit in the circuit in the same moment. If so, they will be mapped to a measure_all gate. If the measure_all gate is not the last gate in the circuit, a prepare_all gate will be inserted after it. Additionally, a prepare_all gate will be inserted before the first moment. If the circuit does not end with a measurement, then a measure_all gate will be appended.

Circuits built on a line register will map each qubit to the qubit of the same index on the hardware. This may leave some qubits unused. Otherwise, the qubits will be mapped onto the hardware in the order given by ccirc.all_qubits().

Parameters
  • ccirc (cirq.Circuit) – The Circuit to convert.

  • names (dict or None) – A mapping from Cirq gate classes to the corresponding native Jaqal gate names. If omitted, maps cirq.XXPowGate, cirq.XPowGate, cirq.YPowGate, cirq.ZPowGate, and cirq.PhasedXPowGate to their QSCOUT counterparts. The cirq.ConvertToIonGates function will transpile a circuit into this basis.

  • native_gates (dict or None) – The native gate set to target. If None, target the QSCOUT native gates.

Returns

The same quantum circuit, converted to JaqalPaq.

Return type

Circuit

Raises

JaqalError – If the circuit includes a gate not included in names.