tqec.circuit.operations.operation.ShiftCoords
- class ShiftCoords(*shifts: int)[source]
- __init__(*shifts: int) None [source]
Annotates that the qubit/detector coordinate origin is being moved.
This is a replication of the [stimcirq.ShiftCoordsAnnotation](https://github.com/quantumlib/Stim/blob/main/glue/cirq/stimcirq/_shift_coords_annotation.py) class. We can directly use stimcirq.ShiftCoordsAnnotation here, however, replication brings the class into the tqec namespace and is useful for the potential future iteration.
Since the operation is not a real quantum operation, it does not have qubits and is not applied to any qubits. This might cause surprising behavior if you try to append or insert it into a circuit. It is always recommended to containerize this operation in a cirq.Moment before appending it to a circuit.
In tqec, this kind of annotation operation should be tagged with the cirq.VirtualTag and the STIM_TAG to work correctly with the circuit transformation and the noise model. You can use the make_shift_coords helper function to create an instance of this class with the correct tags. Otherwise, you might need to manually tag the operation with the cirq.VirtualTag and the STIM_TAG.
Warning
you should use make_shift_coords to create instances of this class. To understand how to use this class directly, please refer to the documentation above.
- Parameters:
*shifts – How much to shift each coordinate.
Methods
__init__
(*shifts)Annotates that the qubit/detector coordinate origin is being moved.
controlled_by
(*control_qubits[, control_values])Returns a controlled version of this operation. If no control_qubits
transform_qubits
(qubit_map)Returns the same operation, but with different qubits.
validate_args
(qubits)Raises an exception if the qubits don't match this operation's qid shape.
with_classical_controls
(*conditions)Returns a classically controlled version of this operation.
with_probability
(probability)Creates a probabilistic channel with this operation.
with_qubits
(*new_qubits)Returns the same operation, but applied to different qubits.
with_tags
(*new_tags)Creates a new TaggedOperation, with this op and the specified tags.
without_classical_controls
()Removes all classical controls from the operation.
Attributes
classical_controls
The classical controls gating this operation.
gate
qubits
shifts
The shifts the operation represents.
tags
Returns a tuple of the operation's tags.
untagged
Returns the underlying operation without any tags.