
    z	i                     H    S r SSKJr  SSKJrJr  SSKJr   " S S\\5      rg)	*Base class for functional Pauli rotations.    )Optional)ABCabstractmethod   )BlueprintCircuitc            	         ^  \ rS rSrSr SS\\   S\S\SS4U 4S jjjr\	S\4S	 j5       r
\
R                  S\SS4S
 j5       r
\	S\4S j5       r\R                  S\\   SS4S j5       r\S\\   SS4S j5       r\	S\4S j5       rSrU =r$ )FunctionalPauliRotations   r   Nnum_state_qubitsbasisnamereturnc                 T   > [         TU ]  US9  SU l        SU l        Xl        X l        g)z
Args:
    num_state_qubits: The number of qubits representing the state :math:`|x\rangle`.
    basis: The kind of Pauli rotation to use. Must be 'X', 'Y' or 'Z'.
    name: The name of the circuit object.
)r   N)super__init___num_state_qubits_basisr   r   )selfr   r   r   	__class__s       v/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/circuit/library/arithmetic/functional_pauli_rotations.pyr   !FunctionalPauliRotations.__init__   s3     	d# "& !1
    c                     U R                   $ )zThe kind of Pauli rotation to be used.

Set the basis to 'X', 'Y' or 'Z' for controlled-X, -Y, or -Z rotations respectively.

Returns:
    The kind of Pauli rotation used in controlled rotation.
)r   r   s    r   r   FunctionalPauliRotations.basis,   s     {{r   c                     UR                  5       nU R                  b  XR                  :w  a+  US;  a  [        SU 35      eU R                  5         Xl        gg)zSet the kind of Pauli rotation to be used.

Args:
    basis: The Pauli rotation to be used.

Raises:
    ValueError: The provided basis in not X, Y or Z.
N)xyzz*The provided basis must be X, Y or Z, not )lowerr   
ValueError_invalidate)r   r   s     r   r   r   7   sS     ;;%;;"6O+ #MeW!UVVK	 #7r   c                     U R                   $ )zoThe number of state qubits representing the state :math:`|x\rangle`.

Returns:
    The number of state qubits.
)r   r   s    r   r   )FunctionalPauliRotations.num_state_qubitsH   s     %%%r   c                     U R                   b  XR                   :w  a(  U R                  5         Xl         U R                  U5        gg)zSet the number of state qubits.

Note that this may change the underlying quantum register, if the number of state qubits
changes.

Args:
    num_state_qubits: The new number of qubits.
N)r   r#   _reset_registersr   r   s     r   r   r%   Q   sC     !!)-=AWAW-W%5"!!"23	 .Xr   c                     [         e)zxReset the registers according to the new number of state qubits.

Args:
    num_state_qubits: The new number of qubits.
)NotImplementedErrorr(   s     r   r'   )FunctionalPauliRotations._reset_registersa   s
     "!r   c                     g)zlThe minimum number of ancilla qubits in the circuit.

Returns:
    The minimal number of ancillas required.
r    r   s    r   num_ancilla_qubits+FunctionalPauliRotations.num_ancilla_qubitsj   s     r   )r   r   r   r   )NYF)__name__
__module____qualname____firstlineno____doc__r   intstrr   propertyr   setterr   r   r'   r.   __static_attributes____classcell__)r   s   @r   r
   r
      s   4 UX (=@NQ	 & s   \\ 3  4      &# & & 4# 44 4 4 "# "4 " " C  r   r
   N)	r6   typingr   abcr   r   blueprintcircuitr   r
   r-   r   r   <module>r@      s$    1  # /[/ [r   