
    z	ix                        S r SSKJr  SSKJr  SSKJr  SSKrSSK	J
r
  SSKJr  SSKJr  SS	KJrJrJrJr  SS
KJr  SSKJr  SSKJrJr  \(       a  SSKJr   " S S\5      rg)z
Stabilizer state class.
    )annotations)
Collection)TYPE_CHECKINGNQiskitError)OpShape)Operator)CliffordPauli	PauliListSparsePauliOp)	_append_x)QuantumState)QuantumCircuitInstruction)circuitc                    ^  \ rS rSrSr S#   S$U 4S jjjr\  S%       S&S jj5       rS rS r	\
S 5       rS'S jrS	 rS
 rS(S jrS(S jrS)S jrS rS*S jrS*S jr S+     S,S jjrS+S-S jjrS+S.S jjrS/S jrS'S0S jjr  S'       S1S jjr S'     S2S jjrS+S3S jjrS+S4S jjrS+S5S jjrS r\ S 5       r!\ S 5       r"\ S 5       r#\ S 5       r$ S+         S6S  jjr%   S7       S8S! jjr&S"r'U =r($ )9StabilizerState$   a>  StabilizerState class.
Stabilizer simulator using the convention from reference [1].
Based on the internal class :class:`~qiskit.quantum_info.Clifford`.

.. plot::
   :include-source:
   :nofigs:

    from qiskit import QuantumCircuit
    from qiskit.quantum_info import StabilizerState, Pauli

    # Bell state generation circuit
    qc = QuantumCircuit(2)
    qc.h(0)
    qc.cx(0, 1)
    stab = StabilizerState(qc)

    # Print the StabilizerState
    print(stab)

    # Calculate the StabilizerState measurement probabilities dictionary
    print (stab.probabilities_dict())

    # Calculate expectation value of the StabilizerState
    print (stab.expectation_value(Pauli('ZZ')))

.. code-block:: text

    StabilizerState(StabilizerTable: ['+XX', '+ZZ'])
    {'00': 0.5, '11': 0.5}
    1

Given a list of stabilizers, :meth:`qiskit.quantum_info.StabilizerState.from_stabilizer_list`
returns a state stabilized by the list

.. plot::
   :include-source:
   :nofigs:

    from qiskit.quantum_info import StabilizerState

    stabilizer_list = ["ZXX", "-XYX", "+ZYY"]
    stab = StabilizerState.from_stabilizer_list(stabilizer_list)


References:
    1. S. Aaronson, D. Gottesman, *Improved Simulation of Stabilizer Circuits*,
       Phys. Rev. A 70, 052328 (2004).
       `arXiv:quant-ph/0406196 <https://arxiv.org/abs/quant-ph/0406196>`_
c                D  > [        U[        5      (       a  UR                  U l        OD[        U[        5      (       a  [	        UR                  5       5      U l        O[	        X5      U l        [        TU ]  [        R                  " U R                  R                  SS9S9  g)zInitialize a StabilizerState object.

Args:
    data: Data from which the stabilizer state can be constructed.
    validate: validate that the stabilizer state data is a valid Clifford.
r   )num_qubits_rnum_qubits_l)op_shapeN)
isinstancer   _datar   r
   to_instructionsuper__init__r   auto
num_qubits)selfdatavalidate	__class__s      d/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/quantum_info/states/stabilizerstate.pyr   StabilizerState.__init__X   su     dO,,DJe$$!$"5"5"78DJ "$1DJ 	',,DJJ<Q<Q`a"bc    c                .    SSK Jn  U" UUUS9nU " U5      $ )a  Create a stabilizer state from the collection of stabilizers.

Args:
    stabilizers (Collection[str]): list of stabilizer strings
    allow_redundant (bool): allow redundant stabilizers (i.e., some stabilizers
        can be products of the others)
    allow_underconstrained (bool): allow underconstrained set of stabilizers (i.e.,
        the stabilizers do not specify a unique state)

Return:
    StabilizerState: a state stabilized by stabilizers.
r   )synth_circuit_from_stabilizers)allow_redundantallow_underconstrained)qiskit.synthesis.stabilizerr)   )clsstabilizersr*   r+   r)   r   s         r%   from_stabilizer_list$StabilizerState.from_stabilizer_listq   s'    * 	O0+#9

 7|r'   c                x    U R                   R                  UR                   R                  :H  R                  5       $ N)r   staballr!   others     r%   __eq__StabilizerState.__eq__   s(    

5;;#3#3388::r'   c                <    SU R                   R                  SS9 S3$ )NzStabilizerState(S)mode))r   	to_labelsr!   s    r%   __repr__StabilizerState.__repr__   s$    !$**"6"6C"6"@!ACCr'   c                    U R                   $ )z$Return StabilizerState Clifford datar   r>   s    r%   cliffordStabilizerState.clifford   s     zzr'   c                6    U R                   R                  5       $ )z'Return True if a valid StabilizerState.)r   
is_unitary)r!   atolrtols      r%   is_validStabilizerState.is_valid   s    zz$$&&r'   c                0    [        [        U 5       S35      e)Nz does not support additionNotImplementedErrortyper5   s     r%   _addStabilizerState._add   s    !T$ZL0J"KLLr'   c                0    [        [        U 5       S35      e)Nz' does not support scalar multiplicationrL   r5   s     r%   	_multiplyStabilizerState._multiply   s    !T$ZL0W"XYYr'   c                D    U R                  5       (       d  [        S5      eg)zReturn the trace of the stabilizer state as a density matrix,
which equals to 1, since it is always a pure state.

Returns:
    float: the trace (should equal 1).

Raises:
    QiskitError: if input is not a StabilizerState.
-StabilizerState is not a valid quantum state.      ?rI   r   r>   s    r%   traceStabilizerState.trace        }}MNNr'   c                D    U R                  5       (       d  [        S5      eg)zReturn the purity of the quantum state,
which equals to 1, since it is always a pure state.

Returns:
    float: the purity (should equal 1).

Raises:
    QiskitError: if input is not a StabilizerState.
rU   rV   rW   r>   s    r%   purityStabilizerState.purity   rZ   r'   c                H    [        U R                  5      R                  5       $ )z&Convert state to matrix operator class)r
   rC   to_operatorr>   s    r%   r_   StabilizerState.to_operator   s    &2244r'   c                d    U R                  5       nUR                  R                  5       Ul        U$ )z%Return the conjugate of the operator.)copyr   	conjugate)r!   rets     r%   rc   StabilizerState.conjugate   s&    iikII'')	
r'   c                    [        U[        5      (       d  [        U5      nU R                  5       nU R                  R	                  UR                  5      Ul        U$ )u  Return the tensor product stabilizer state self ⊗ other.

Args:
    other (StabilizerState): a stabilizer state object.

Returns:
    StabilizerState: the tensor product operator self ⊗ other.

Raises:
    QiskitError: if other is not a StabilizerState.
)r   r   rb   rC   tensorr   r!   r6   rd   s      r%   rg   StabilizerState.tensor   E     %11#E*EiikMM((8	
r'   c                    [        U[        5      (       d  [        U5      nU R                  5       nU R                  R	                  UR                  5      Ul        U$ )u  Return the tensor product stabilizer state other ⊗ self.

Args:
    other (StabilizerState): a stabilizer state object.

Returns:
    StabilizerState: the tensor product operator other ⊗ self.

Raises:
    QiskitError: if other is not a StabilizerState.
)r   r   rb   rC   expandr   rh   s      r%   rl   StabilizerState.expand   rj   r'   c                    [        U[        5      (       d  [        U5      nU R                  5       nU R                  R	                  UR                  US9Ul        U$ )a  Evolve a stabilizer state by a Clifford operator.

Args:
    other (Clifford or QuantumCircuit or qiskit.circuit.Instruction):
        The Clifford operator to evolve by.
    qargs (list): a list of stabilizer subsystem positions to apply the operator on.

Returns:
    StabilizerState: the output stabilizer state.

Raises:
    QiskitError: if other is not a StabilizerState.
    QiskitError: if the operator dimension does not match the
                 specified StabilizerState subsystem dimensions.
)qargs)r   r   rb   rC   composer   )r!   r6   ro   rd   s       r%   evolveStabilizerState.evolve   sJ    $ %11#E*EiikMM))%..)F	
r'   c                T  ^ ^ [        U[        5      (       a  T R                  UT5      $ [        U[        5      (       aS  [	        UU 4S j[        UR                  R                  UR                  R                  UR                  5       5       5      $ [        S[        U5       S35      e)a;  Compute the expectation value of a Pauli or SparsePauliOp operator.

Args:
    oper: A Pauli or SparsePauliOp operator to evaluate the expectation value.
    qargs: Subsystems to apply the operator on.

Returns:
    The expectation value.

Raises:
    QiskitError: if oper is not a Pauli or SparsePauliOp operator.
c              3  h   >#    U  H'  u  pnUTR                  [        X45      T5      -  v   M)     g 7fr2   )_expectation_value_paulir   ).0zxcoeffro   r!   s       r%   	<genexpr>4StabilizerState.expectation_value.<locals>.<genexpr>  s4      #QKA% 55eQFmUKK#Qs   /2zMOperator for expectation value is not a Pauli or SparsePauliOp operator, but .)r   r   ru   r   sumzippaulisrw   rx   coeffsr   rN   )r!   operro   s   ` `r%   expectation_value!StabilizerState.expectation_value  s     dE""00u==dM** #&t{{}}dkkmmT[[#Q  
 :,a!
 	
r'   c                   [        U[        5      (       d  [        S5      eU R                  R                  nUc  [        U5      nOUn[        US-  5      nSnUR                  (       a  SUR                  -  OSn[        U5       H^  u  pUR                  U   UR                  U	'   UR                  U   UR                  U	'   XeR                  U	   UR                  U	   -  -  nM`     [        U5       H  n
SnU[        R                  " UR                  U R                  R                  U
   -  5      -  nU[        R                  " UR                  U R                  R                  U
   -  5      -  nUS-  S:X  d  M    g   UR                  R                  5       n[        U5       GHD  n
SnU[        R                  " UR                  U R                  R                  U
   -  5      -  nU[        R                  " UR                  U R                  R                   U
   -  5      -  nUS-  S:X  a  M  USU R                  R"                  U
   -  -  nU[        R                  " U R                  R                  U
   U R                  R                  U
   -  5      -  nUS[        R                  " XR                  R                  U
   -  5      -  -  nXR                  R                  U
   -  nGMG     US-  S:w  a  U* $ U$ )a8  Compute the expectation value of a Pauli operator.

Args:
    oper (Pauli): a Pauli operator to evaluate expval.
    qargs (None or list): subsystems to apply the operator on.

Returns:
    complex: the expectation value (only 0 or 1 or -1 or i or -i).

Raises:
    QiskitError: if oper is not a Pauli operator.
z7Operator for expectation value is not a Pauli operator.Ir   y                      )r   r   r   rC   r    rangephase	enumeraterx   rw   npcount_nonzerostab_xstab_zrb   destab_xdestab_z
stab_phase)r!   r   ro   r    qubitspaulir   pauli_phaseposqubitpnum_antipauli_zs                r%   ru   (StabilizerState._expectation_value_pauli!  s    $&&WXX]]--
=:&FF j3&'-1ZZstzz)Q#F+JC!VVC[EGGEN!VVC[EGGENWWU^eggen44E , z"AH((4==3G3G3J)JKKH((4==3G3G3J)JKKH!|q  # 77.."z"AH((4==3I3I!3L)LMMH((4==3I3I!3L)LMMH!|q  Q11!444ER%%dmm&:&:1&=@T@TUV@W&WXXEQ))'MM4H4H4K*KLLLE 4 4Q 77G # 19><r'   c                   [        U[        5      (       d   [        U5      nU R                  nUR                  U:w  a  g[        R
                  " U R                  R                  U R                  R                  SU R                  R                  -  5      n[        R
                  " UR                  R                  UR                  R                  SUR                  R                  -  5      n[        R                  " U Vs/ s H  oUR                  U5      PM     sn5      (       d  g[        U5       H  nU R                  XF   5      nUS:w  d  M    g   g! [         a     gf = fs  snf )zReturn True if the two generating sets generate the same stabilizer group.

Args:
    other (StabilizerState): another StabilizerState.

Returns:
    bool: True if other has a generating set that generates the same StabilizerState.
Fr   r   T)r   r   r   r    r   from_symplecticr   r   r   r   r   r4   commutesr   r   )r!   r6   r    
pauli_origpauli_otherr   iexp_vals           r%   equivStabilizerState.equivb  s'    %11'. __
z)..JJtzz00!djj6K6K2K

  //KK 2 2A8N8N4N
 vv
K
u~~k2
KLL
 z"A,,[^<G!| #
 7    Ls   E E&
E#"E#c                   U R                  X5      nUc  [        U R                  R                  5      n[        R
                  " S[        U5      -  5      nUR                  5        H  u  pV[        US5      nXdU'   M     U$ )a  Return the subsystem measurement probability vector.

Measurement probabilities are with respect to measurement in the
computation (diagonal) basis.

Args:
    qargs (None or list): subsystems to return probabilities for,
        if None return for all subsystems (Default: None).
    decimals (None or int): the number of decimal places to round
        values. If None no rounding is done (Default: None).

Returns:
    np.array: The Numpy vector array of probabilities.
r   )	probabilities_dictr   rC   r    r   zeroslenitemsint)r!   ro   decimals
probs_dictprobskeyvalueplaces           r%   probabilitiesStabilizerState.probabilities  sq     ,,U=
=$--223Ec%j)$**,JCQKE %L - r'   c                "    U R                  XUS9$ )a  Return the subsystem measurement probability dictionary utilizing
a targeted outcome_bitstring to perform the measurement for. This
will calculate a probability for only a single targeted
outcome_bitstring value, giving a performance boost over calculating
all possible outcomes.

Measurement probabilities are with respect to measurement in the
computation (diagonal) basis.

This dictionary representation uses a Ket-like notation where the
dictionary keys are qudit strings for the subsystem basis vectors.
If any subsystem has a dimension greater than 10 comma delimiters are
inserted between integers so that subsystems can be distinguished.

Args:
    outcome_bitstring (None or str): targeted outcome bitstring
        to perform a measurement calculation for, this will significantly
        reduce the number of calculation performed (Default: None)
    qargs (None or list): subsystems to return probabilities for,
            if None return for all subsystems (Default: None).
    decimals (None or int): the number of decimal places to round
            values. If None no rounding is done (Default: None)

Returns:
    dict[str, float]: The measurement probabilities in dict (ket) form.
outcome_bitstringro   r   _get_probabilities_dict)r!   r   ro   r   s       r%   !probabilities_dict_from_bitstring1StabilizerState.probabilities_dict_from_bitstring  s"    @ ++/x , 
 	
r'   c                "    U R                  SXS9$ )a  Return the subsystem measurement probability dictionary.

Measurement probabilities are with respect to measurement in the
computation (diagonal) basis.

This dictionary representation uses a Ket-like notation where the
dictionary keys are qudit strings for the subsystem basis vectors.
If any subsystem has a dimension greater than 10 comma delimiters are
inserted between integers so that subsystems can be distinguished.

Args:
    qargs (None or list): subsystems to return probabilities for,
        if None return for all subsystems (Default: None).
    decimals (None or int): the number of decimal places to round
        values. If None no rounding is done (Default: None).

Returns:
    dict: The measurement probabilities in dict (key) form.
Nr   r   )r!   ro   r   s      r%   r   "StabilizerState.probabilities_dict  s    , ++d%+ccr'   c                |   Uc?  [        [        [        R                  " SU R                  R
                  -  5      5      5      $ U R                  R                  S[        U5      S9nU R                  5       n[        U5       H7  u  pEUR                  XRU   5      nUS:X  d  M!  [        UR                  U5        M9     U$ )a  Reset state or subsystems to the 0-state.

Args:
    qargs (list or None): subsystems to reset, if None all
                          subsystems will be reset to their 0-state
                          (Default: None).

Returns:
    StabilizerState: the reset state.

Additional Information:
    If all subsystems are reset this will return the ground state
    on all subsystems. If only some subsystems are reset this
    function will perform a measurement on those subsystems and
    evolve the subsystems so that the collapsed post-measurement
    states are rotated to the 0-state. The RNG seed for this
    sampling can be set using the :meth:`seed` method.
r   sizer   )r   r
   r   eyerC   r    _rngintegersr   rb   r   _measure_and_updater   )r!   ro   randbitsrd   bitr   outcomes          r%   resetStabilizerState.reset  s    ( ="8BFF1t}}7O7O3O,P#QRR99%%ac%j%9iik#E*JC--ec]CG !|#,,. + 
r'   c                   Uc  [        U R                  R                  5      nU R                  R	                  S[        U5      S9nU R                  5       nSn[        U5       H%  u  pV[        UR                  XbU   5      5      U-   nM'     XC4$ )a  Measure subsystems and return outcome and post-measure state.

Note that this function uses the QuantumStates internal random
number generator for sampling the measurement outcome. The RNG
seed can be set using the :meth:`seed` method.

Args:
    qargs (list or None): subsystems to sample measurements for,
                          if None sample measurement of all
                          subsystems (Default: None).

Returns:
    tuple: the pair ``(outcome, state)`` where ``outcome`` is the
           measurement outcome string label, and ``state`` is the
           collapsed post-measurement stabilizer state for the
           corresponding outcome.
r   r    )
r   rC   r    r   r   r   rb   r   strr   )r!   ro   r   rd   r   r   r   s          r%   measureStabilizerState.measure  s    $ =$--223E99%%ac%j%9iik#E*JC#11%#GH7RG + |r'   c                    / n[        U5       H6  nU R                  5       nUR                  UR                  U5      S   5        M8     U$ )aV  Sample a list of qubit measurement outcomes in the computational basis.

Args:
    shots (int): number of samples to generate.
    qargs (None or list): subsystems to sample measurements for,
                        if None sample measurement of all
                        subsystems (Default: None).

Returns:
    np.array: list of sampled counts if the order sampled.

Additional Information:

    This function implements the measurement :meth:`measure` method.

    The seed for random number generator used for sampling can be
    set to a fixed value by using the stats :meth:`seed` method.
r   )r   rb   appendr   )r!   shotsro   memory_r3   s         r%   sample_memoryStabilizerState.sample_memory$  sC    & uA99;DMM$,,u-a01  r'   c                   U R                   R                  nU R                   nU R                   R                  n[        R                  " USS2U4   5      nUS:X  a[  [        US-  5      n[        U5       H0  nUR                  U   U   (       d  M  U R                  XGX-   5      nM2     UR                  n	U	$ Un	[        R                  " [        R                  " USS2U4   5      5      n
X-  n
[        SU-  5       H?  nUR                  U   U   (       d  M  X:w  d  M#  XU-
  :w  d  M-  U R                  XHU
5        MA     UR                  X-
     R                  5       UR                  X-
  '   [        R                   " U5      UR                  U
'   [        R                   " U5      UR"                  U
'   SUR"                  U
   U'   XR                  U
'   U	$ )a  Measure a single qubit and return outcome and post-measure state.

Note that this function uses the QuantumStates internal random
number generator for sampling the measurement outcome. The RNG
seed can be set using the :meth:`seed` method.

Note that stabilizer state measurements only have three probabilities:
(p0, p1) = (0.5, 0.5), (1, 0), or (0, 1)
The random case happens if there is a row anti-commuting with Z[qubit]
Nr   r   r   T)rC   r    r   r   anyr   r   rx   _rowsum_deterministicr   minnonzero_rowsum_nondeterministicr3   rb   destabr   rw   )r!   r   randbitr    rC   r   z_anticommuting	aux_paulir   r   p_qubits              r%   r   #StabilizerState._measure_and_updateA  s    ]]--
==%% &&5!12aj3./I:&::a='' $ : :8PQP^ _I '  ooGN GffRZZq%x(89:G!G 1z>*JJqM%((q|!R\H\B]11(wG +
 5=MM'BV4W4\4\4^HOOG01"$((:"6HJJw"$((:"6HJJw)-HJJw&&-NN7#Nr'   c                    X!-  SSU-  -   SU -  -   -  X-  SSU-  -   SU-  -   -  -
  S-  nUS:  a  US-  nUS:X  a  [        S5      eU$ )zNExponent g of i such that Pauli(x1,z1) * Pauli(x2,z2) = i^g Pauli(x1+x2,z1+z2)r   r   r   r   z9Invalid rowsum phase exponent in measurement calculation.r   )x1z1x2z2r   s        r%   _phase_exponentStabilizerState._phase_exponentq  sl    
 ABJR/027a!b&j1r6>Q3RRVWW19QJEA:YZZr'   c           	        SU-  SU-  -   n[        UR                  5       HR  nU[        R                  UR                  U   UR
                  U   U R                  U   U R
                  U   5      -  nMT     US-  nUS:g  US:g  -  (       a  [        S5      e[        US:H  5      nU =R                  UR                  -  sl        U =R
                  UR
                  -  sl        X4$ )z)Aaronson-Gottesman rowsum helper functionr   r   r   z*Invalid rowsum in measurement calculation.)r   r    r   r   rx   rw   r   r   )accum_pauliaccum_phase	row_pauli	row_phasenewrr   s         r%   _rowsumStabilizerState._rowsum~  s     9}q;.9//0EO33E"IKK$6e8Lkmm\aNb D 1 		AI$!)$JKK$!)n$$''r'   c                8   U R                   U   nU R                   U   nU R                  nU R                  n[        XR   Xb   45      n[        XQ   Xa   45      n[        R                  XXs5      u  pX@R                   U'   UR                  Xa'   UR                  XQ'   g)zUpdating StabilizerState Clifford in the
non-deterministic rowsum calculation.
row and accum are rows in the StabilizerState Clifford.N)r   rw   rx   r   r   r   )	rC   accumrowr   r   rw   rx   r   r   s	            r%   r   (StabilizerState._rowsum_nondeterministic  s     NN3'	nnU+JJJJ1616*+	QXqx01#2#:#:i$
  !,u====r'   c                    U R                   U   nUR                   nUn[        U R                  U   U R                  U   45      n[        R                  XTXc5      u  pTUnXAl         U$ )zyUpdating an auxiliary Pauli aux_pauli in the
deterministic rowsum calculation.
The StabilizerState itself is not updated.)r   r   rw   rx   r   r   )rC   r   r   r   r   r   r   s          r%   r   %StabilizerState._rowsum_deterministic  si     NN3'	oo8::c?HJJsO<=	#2#:#:i$
   	%r'   c                   SnU R                  5       n[        [        U5      5       H  nX(   S:X  d  M  U[        U5      U-
  S-
     n	[        UR                  R
                  SS2U	4   5      (       dH  UR                  U	S5      n
Ub  [        XX   5      U
:X  a  [        U
5      X('   M  [        XX   5      X('   SnM  UnM     US:X  a  SR                  U5      nX4U'   gUc  [        SS5      O[        XV   5      / Hj  n
UR                  5       n[        U
5      X'   UR                  5       nUR                  U[        U5      U-
  S-
     U
5        UR                  XSU-  XE5        Ml     g)	a  Recursive helper function for calculating the probabilities

Args:
    qubits (range): range of qubits
    outcome (list[str]): outcome being built
    outcome_prob (float): probability of the outcome
    probs (dict[str, float]): holds the outcomes and probability results
    outcome_bitstring (str): target outcome to measure which reduces measurements, None
        if not targeting a specific target
Xr   Nr   r   r   g      ?)rb   r   r   r   rC   r   r   r   r   join_get_probabilities)r!   r   r   outcome_probr   r   qubit_for_branchingrd   r   r   single_qubit_outcomestr_outcomenew_outcomestab_cpys                 r%   r   "StabilizerState._get_probabilities  s   $ $&#yy{ s6{#AzS Fa! 353<<..q%x899585L5LUTU5V((0-015II
 &))=%>
 &)):)=%>
'(*+') $, "$'''*K!-+ ") !QK'<=>? !
 ",,.K/23G/HK,xxzH((F&99A=?AU ''cL&85?r'   c                    Uc   [        U R                  R                  5      nOUnS/[        U5      -  nSn0 nU R	                  XEXgU5        Ub&  UR                  5        H  u  p[        X5      Xx'   M     U$ )a  Helper Function for calculating the subsystem measurement probability dictionary.
When the targeted outcome_bitstring value is set, then only the single outcome_bitstring
probability will be calculated.

Args:
    outcome_bitstring (None or str): targeted outcome bitstring
        to perform a measurement calculation for, this will significantly
        reduce the number of calculation performed (Default: None)
    qargs (None or list): subsystems to return probabilities for,
        if None return for all subsystems (Default: None).
    decimals (None or int): the number of decimal places to round
        values. If None no rounding is done (Default: None).

Returns:
    dict: The measurement probabilities in dict (key) form.
r   rV   )r   rC   r    r   r   r   round)
r!   r   ro   r   r   r   r   r   r   r   s
             r%   r   'StabilizerState._get_probabilities_dict   sz    , =4==334FF%#f+%"$FWX#kkm
"53
 , r'   rB   )T)r"   zUStabilizerState | Clifford | Pauli | QuantumCircuit | circuit.instruction.Instructionr#   bool)FF)r.   zCollection[str]r*   r  r+   r  returnr   )NN)r  float)r  r	   )r6   r   r  r   r2   )r6   z'Clifford | QuantumCircuit | Instructionro   list | Noner  r   )r   zPauli | SparsePauliOpro   None | listr  complex)r   r   ro   r  r  r	  )r6   r   r  r  )ro   r  r   
None | intr  
np.ndarray)r   r   ro   r  r   r
  r  dict[str, float])ro   r  r   r
  r  r  )ro   r  r  r   )ro   r  r  tuple)r   r   ro   r  r  r  )
r   r   r   z	list[str]r   r  r   r  r   r   )NNN)r   z
None | strro   r  r   r
  r  r  ))__name__
__module____qualname____firstlineno____doc__r   classmethodr/   r7   r?   propertyrC   rI   rO   rR   rX   r\   r_   rc   rg   rl   rq   r   ru   r   r   r   r   r   r   r   r   staticmethodr   r   r   r   r   r   __static_attributes____classcell__)r$   s   @r%   r   r   $   s6   1l dcd d d2  !&',	$  !%	
 
 :;D  'MZ5$& TX<EP	0
6?B'R: "#	"
"
 "
 	"

 
"
J AEd d3=d	d0#J<:.` 
 
 ( ($ ! !*  8 "&@@ @ 	@
  @ @H )-!#	%%% % 	%
 
% %r'   r   )r  
__future__r   collections.abcr   typingr   numpyr   qiskit.exceptionsr   &qiskit.quantum_info.operators.op_shaper   &qiskit.quantum_info.operators.operatorr	   (qiskit.quantum_info.operators.symplecticr
   r   r   r   :qiskit.quantum_info.operators.symplectic.clifford_circuitsr   (qiskit.quantum_info.states.quantum_stater   qiskit.circuitr   r   qiskitr   r    r'   r%   <module>r%     sD    # &    ) : ; ^ ^ P A 6Al Ar'   