
    z	i-
                     B    S r SSKJr  SSKJr  SSKJr   " S S\5      rg)z`Move clifford gates to the end of the circuit, changing rotation gates to multi-qubit rotations.    )TransformationPass)
DAGCircuit)run_litinski_transformationc                   J   ^  \ rS rSrSrS	S\4U 4S jjjrS\S\4S jrSr	U =r
$ )
LitinskiTransformation   a  
Applies Litinski transform to a circuit.

The transform applies to a circuit containing Clifford + RZ-rotation gates (including T and Tdg),
and moves Clifford gates to the end of the circuit, while changing rotation gates to multi-qubit
rotations (represented using PauliEvolution gates).

The pass supports all of the Clifford gates in the list returned by
:func:`.get_clifford_gate_names`:

``["id", "x", "y", "z", "h", "s", "sdg", "sx", "sxdg", "cx", "cz", "cy",
"swap","iswap", "ecr", "dcx"]``

The list of supported RZ-rotations is:

``["t", "tdg", "rz"]``

References:

    [1]: Litinski. A Game of Surface Codes.
         `Quantum 3, 128 (2019) <https://quantum-journal.org/papers/q-2019-03-05-128>`_

fix_cliffordc                 .   > [         TU ]  5         Xl        g)a  

Args:
    fix_clifford: if ``False`` (non-default), the returned circuit contains
        only PauliEvolution gates, with the final Clifford gates omitted.
        Note that in this case the operators of the original and synthesized
        circuits will generally not be equivalent.
N)super__init__r	   )selfr	   	__class__s     w/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/transpiler/passes/optimization/litinski_transformation.pyr   LitinskiTransformation.__init__.   s     	(    dagreturnc                 :    [        XR                  5      nUc  U$ U$ )zRun the LitiskiTransformation pass on ``dag``.

Args:
    dag: the input DAG.

Returns:
    The output DAG.

Raises:
    TranspilerError: if the circuit contains gates
        not supported by the pass.
)r   r	   )r   r   new_dags      r   runLitinskiTransformation.run:   s%     .c3D3DE ?Jr   )r	   )T)__name__
__module____qualname____firstlineno____doc__boolr   r   r   __static_attributes____classcell__)r   s   @r   r   r      s1    0
)T 
) 
)z j  r   r   N)r   qiskit.transpiler.basepassesr   qiskit.dagcircuitr   *qiskit._accelerate.litinski_transformationr   r    r   r   <module>r$      s!    g ; ( R8/ 8r   