
    {	i	                     ^    S r SSKJrJr  SSKJrJr  SSKJr   " S S\5      rS r	\	\l	        g	)
z?
Instruction to set the simulator state to a stabilizer state.
    )QuantumCircuitInstruction)StabilizerStateClifford   )default_qubitsc                   0   ^  \ rS rSrSrSrU 4S jrSrU =r$ )SetStabilizer   z2Set the Clifford stabilizer state of the simulatorTc                    > [        U[        5      (       a  UR                  nO [        U[        5      (       d  [        U5      n[        TU ]  SUR                  SUR                  5       /5        g)a<  Create new instruction to set the Clifford stabilizer state of the simulator.

Args:
    state (StabilizerState or Clifford): A clifford operator.

.. note::

    This set instruction must always be performed on the full width of
    qubits in a circuit, otherwise an exception will be raised during
    simulation.
set_stabilizerr   N)
isinstancer   cliffordr   super__init__
num_qubitsto_dict)selfstate	__class__s     l/home/james-whalen/.local/lib/python3.13/site-packages/qiskit_aer/library/set_instructions/set_stabilizer.pyr   SetStabilizer.__init__   sT     e_--NNEE8,,UOE)5+;+;Q@QR     )	__name__
__module____qualname____firstlineno____doc__
_directiver   __static_attributes____classcell__)r   s   @r   r
   r
      s    <JS Sr   r
   c                 N   [        U 5      n[        U[        5      (       a  UR                  n[        U[        5      (       d  [	        U5      nUR
                  [        U5      :w  a&  [        SUR
                   SU R
                   S35      eU R                  [        U5      U5      $ )aN  Set the Clifford stabilizer state of the simulator.

Args:
    state (Clifford): A clifford operator.

Returns:
    QuantumCircuit: with attached instruction.

Raises:
    ValueError: If the state is the incorrect size for the
        current circuit.

.. note:

    This instruction is always defined across all qubits in a circuit.
zThe size of the Clifford for the set_stabilizer instruction must be equal to the number of qubits in the circuit (state.num_qubits (z ) != QuantumCircuit.num_qubits (z)).)
r   r   r   r   r   r   len
ValueErrorappendr
   )r   r   qubitss      r   r   r   -   s    " D!F%))eX&&3v;&2272B2B1C D..2oo->cC
 	
 ;;}U+V44r   N)
r   qiskit.circuitr   r   qiskit.quantum_infor   r   r   r
   r   r   r   r   <module>r*      s3    7 9 +SK S05@ !/ r   