§
    º³Ùgð�  ã                  ó  — d Z ddlmZ ddlZddlZddlZddlmZ ddl	m
Z
 ddlZddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZmZ ddlmZmZ ddlm Z  ddl!m"Z" ddl#m$Z$m%Z% e
rddlm&Z&  G d„ dee¦  «        Z'dS )z"
Statevector quantum state class.
é    )ÚannotationsN)ÚNumber)ÚTYPE_CHECKING)Ú_numpy_compat)ÚQuantumCircuit)ÚInstruction)ÚQiskitError)ÚQuantumState)ÚTolerancesMixin)ÚOperatorÚBaseOperator)ÚPauliÚSparsePauliOp)ÚOpShape)Úmatrix_equal)Úexpval_pauli_no_xÚexpval_pauli_with_x)Úcircuitc                  ó¼  ‡ — e Zd ZdZ	 dHdIˆ fd„Zdej        fd„Zˆ fd	„Zd
„ Z	e
dJd„¦   «         ZdHdKd„Zd„ ZdLd„Zd„ Zd„ Ze
dMd„¦   «         ZdNdOd„ZdPd „ZdQd!„ZdRd#„ZdRd$„ZdSd&„ZdTd'„ZdSd(„Zd)„ Zd*„ Z	 dHdUd.„Z	 dNdVd/„ZdQd0„ZdHd1„Z	 dHdWd6„Z 	 dNdXd9„Z!dHdYd:„Z"e#dZd=„¦   «         Z$e%d[dA„¦   «         Z&e#d\dD„¦   «         Z'dHd]dE„Z(e%dHdF„¦   «         Z)e%dHdG„¦   «         Z*ˆ xZ+S )^ÚStatevectorzStatevector classNÚdataú]np.ndarray | list | Statevector | Operator | QuantumCircuit | circuit.instruction.InstructionÚdimsúint | tuple | list | Nonec                ó¦  •— t          |t          t          j        f¦  «        r!t          j        |t
          ¬¦  «        | _        nÓt          |t          ¦  «        r|j        | _        |€|j        j	        }n£t          |t          ¦  «        r>|j        \  }}|dk    rt          d¦  «        ‚t          j        |j        ¦  «        | _        nPt          |t          t           f¦  «        r%t                               |¦  «        j        | _        nt          d¦  «        ‚| j        j        }| j        j        }|dk    re|dk    r>|d         dk    r2t          j        | j        |d         ¦  «        | _        | j        j        }n!|dk    s|d         dk    rt          d¦  «        ‚t+          ¦   «                              t/          j        ||d¬	¦  «        ¬
¦  «         dS )aá  Initialize a statevector object.

        Args:
            data: Data from which the statevector can be constructed. This can be either a complex
                vector, another statevector, a ``Operator`` with only one column or a
                ``QuantumCircuit`` or ``Instruction``.  If the data is a circuit or instruction,
                the statevector is constructed by assuming that all qubits are initialized to the
                zero state.
            dims: The subsystem dimension of the state (See additional information).

        Raises:
            QiskitError: if input data is not valid.

        Additional Information:
            The ``dims`` kwarg can be None, an integer, or an iterable of
            integers.

            * ``Iterable`` -- the subsystem dimensions are the values in the list
              with the total number of subsystems given by the length of the list.

            * ``Int`` or ``None`` -- the length of the input vector
              specifies the total dimension of the density matrix. If it is a
              power of two the state will be initialized as an N-qubit state.
              If it is not a power of two the state will have a single
              d-dimensional subsystem.
        ©ÚdtypeNé   z&Input Operator is not a column-vector.z)Invalid input data format for Statevectoré   r   z-Invalid input: not a vector or column-vector.)ÚshapeÚdims_lÚnum_qubits_r)Úop_shape)Ú
isinstanceÚlistÚnpÚndarrayÚasarrayÚcomplexÚ_datar   Ú	_op_shapeÚ_dims_lr   Údimr	   Úravelr   r   r   Úfrom_instructionÚndimr    ÚreshapeÚsuperÚ__init__r   Úauto)Úselfr   r   Ú	input_dimÚ_r0   r    Ú	__class__s          €ú\/granary/edev/quantum/lib/python3.11/site-packages/qiskit/quantum_info/states/statevector.pyr3   zStatevector.__init__0   s¡  ø€ õL �d�T¥2¤:Ð.Ñ/Ô/ð 	Kõ œ DµÐ8Ñ8Ô8ˆDŒJˆJÝ˜�kÑ*Ô*ð 	KØœˆDŒJØˆ|Ø”~Ô-�øÝ˜�hÑ'Ô'ð 		Kàœ8‰LˆI�qØ˜AŠ~ˆ~Ý!Ð"JÑKÔKÐKÝœ $¤)Ñ,Ô,ˆDŒJˆJÝ˜�~­{Ð;Ñ<Ô<ð 	KÝ$×5Ò5°dÑ;Ô;Ô@ˆDŒJˆJåÐIÑJÔJÐJð ŒzŒˆØ”
Ô ˆØ�1Š9ˆ9Ø�qŠyˆy˜U 1œX¨š]˜]ÝœZ¨¬
°E¸!´HÑ=Ô=�”
Øœ
Ô(��Ø˜’�˜e Aœh¨!šm˜mÝ!Ð"QÑRÔRÐRÝ‰Œ×Ò¥'¤,°UÀ4ÐVWÐ"XÑ"XÔ"XÐÑYÔYÐYÐYÐYó    c                óZ   — |€| j         j        n|}t          j        | j         ||¬¦  «        S )N)r   Úcopy)r   r   r&   Úarray)r5   r   r<   s      r9   Ú	__array__zStatevector.__array__t   s,   € Ø#( =�”	”�°eˆÝŒx˜œ	¨°TÐ:Ñ:Ô:Ð:r:   c                óž   •— t          ¦   «                              |¦  «        o+t          j        | j        |j        | j        | j        ¬¦  «        S )N©ÚrtolÚatol)r2   Ú__eq__r&   Úallcloser*   rA   rB   )r5   Úotherr8   s     €r9   rC   zStatevector.__eq__x   sD   ø€ Ý‰wŒw�~Š~˜eÑ$Ô$ð 
­¬ØŒJ˜œ¨$¬)¸$¼)ð*
ñ *
ô *
ð 	
r:   c                ó¦   — d}t          |¦  «        dz  }|› t          j        | j        d|¬¦  «        › d|› d| j                             ¦   «         › d�S )NzStatevector(ú z, )Ú	separatorÚprefixz,
zdims=ú))Úlenr&   Úarray2stringr*   r+   r!   )r5   rI   Úpads      r9   Ú__repr__zStatevector.__repr__}   sp   € ØˆÝ�&‰kŒk˜CÑˆàð /•r” t¤z¸TÈ&ÐQÑQÔQð /ð /ÐVYð /ð /Ø”N×)Ò)Ñ+Ô+ð/ð /ð /ð	
r:   ÚreturnÚdictc                óD   — | j         | j                             ¦   «         dœS )zReturn settings.)r   r   )r*   r+   r!   ©r5   s    r9   ÚsettingszStatevector.settings…   s"   € ð œ
¨D¬N×,AÒ,AÑ,CÔ,CÐDÐDÐDr:   Úoutputú
str | Nonec                ó$   — ddl m}  || fd|i|¤ŽS )aÒ  Return a visualization of the Statevector.

        **repr**: ASCII TextMatrix of the state's ``__repr__``.

        **text**: ASCII TextMatrix that can be printed in the console.

        **latex**: An IPython Latex object for displaying in Jupyter Notebooks.

        **latex_source**: Raw, uncompiled ASCII source to generate array using LaTeX.

        **qsphere**: Matplotlib figure, rendering of statevector using `plot_state_qsphere()`.

        **hinton**: Matplotlib figure, rendering of statevector using `plot_state_hinton()`.

        **bloch**: Matplotlib figure, rendering of statevector using `plot_bloch_multivector()`.

        **city**: Matplotlib figure, rendering of statevector using `plot_state_city()`.

        **paulivec**: Matplotlib figure, rendering of statevector using `plot_state_paulivec()`.

        Args:
            output (str): Select the output method to use for drawing the
                state. Valid choices are `repr`, `text`, `latex`, `latex_source`,
                `qsphere`, `hinton`, `bloch`, `city`, or `paulivec`. Default is `repr`.
                Default can be changed by adding the line ``state_drawer = <default>`` to
                ``~/.qiskit/settings.conf`` under ``[default]``.
            drawer_args: Arguments to be passed directly to the relevant drawing
                function or constructor (`TextMatrix()`, `array_to_latex()`,
                `plot_state_qsphere()`, `plot_state_hinton()` or `plot_bloch_multivector()`).
                See the relevant function under `qiskit.visualization` for that function's
                documentation.

        Returns:
            :class:`matplotlib.Figure` or :class:`str` or
            :class:`TextMatrix` or :class:`IPython.display.Latex`:
            Drawing of the Statevector.

        Raises:
            ValueError: when an invalid output method is selected.

        Examples:

            Plot one of the Bell states

            .. plot::
               :alt: Output from the previous code.
               :include-source:

                from numpy import sqrt
                from qiskit.quantum_info import Statevector
                sv=Statevector([1/sqrt(2), 0, 0, -1/sqrt(2)])
                sv.draw(output='hinton')

        r   )Ústate_drawerrT   )Ú(qiskit.visualization.state_visualizationrW   )r5   rT   Údrawer_argsrW   s       r9   ÚdrawzStatevector.drawŠ   s5   € ðp 	JÐIÐIÐIÐIÐIàˆ|˜DÐ?Ð?¨Ð?°;Ð?Ð?Ð?r:   c                óœ   — |                       ¦   «         }t          |t          ¦  «        rt          |¦  «         d S ddlm}  ||¦  «         d S )Nr   )Údisplay)rZ   r$   ÚstrÚprintÚIPython.displayr\   )r5   Úoutr\   s      r9   Ú_ipython_display_zStatevector._ipython_display_Æ   sS   € Ø�iŠi‰kŒkˆÝ�c�3ÑÔð 	Ý�#‰JŒJˆJˆJˆJà/Ð/Ð/Ð/Ð/Ð/àˆG�C‰LŒLˆLˆLˆLr:   Úkeyú	int | strúnp.complex128c                ót  — t          |t          ¦  «        r4	 t          |d¦  «        }n"# t          $ r t	          d|› d�¦  «        d‚w xY wt          |t          ¦  «        rL|| j        k    rt	          d|› d| j        › d�¦  «        ‚|dk     rt	          d|› d	�¦  «        ‚| j        |         S t	          d
¦  «        ‚)a!  Return Statevector item either by index or binary label
        Args:
            key (int or str): index or corresponding binary label, e.g. '01' = 1.

        Returns:
            numpy.complex128: Statevector item.

        Raises:
            QiskitError: if key is not valid.
        r   zKey 'z' is not a valid binary string.NzKey z' is greater than Statevector dimension ú.r   z is not a valid positive value.z)Key must be int or a valid binary string.)r$   r]   ÚintÚ
ValueErrorr	   r-   r*   )r5   rb   s     r9   Ú__getitem__zStatevector.__getitem__Ï   sê   € õ �c�3ÑÔð 	ZðZÝ˜#˜q‘k”k��øÝð Zð Zð ZÝ!Ð"N¨#Ð"NÐ"NÐ"NÑOÔOÐUYÐYðZøøøå�c�3ÑÔð 	KØ�d”hŠˆÝ!Ð"`¨Ð"`Ð"`ÐUYÔU]Ð"`Ð"`Ð"`ÑaÔaÐaØ�QŠwˆwÝ!Ð"M¨Ð"MÐ"MÐ"MÑNÔNÐNØ”:˜c”?Ð"åÐIÑJÔJÐJs	   —( ¨Ac              #  ó$   K  — | j         E d {V —† d S ©N©r*   rR   s    r9   Ú__iter__zStatevector.__iter__è   s&   è è € Ø”:ÐÐÐÐÐÐÐÐÐr:   c                ó*   — t          | j        ¦  «        S rk   )rK   r*   rR   s    r9   Ú__len__zStatevector.__len__ë   s   € Ý�4”:‰ŒÐr:   ú
np.ndarrayc                ó   — | j         S )zReturn data.rl   rR   s    r9   r   zStatevector.dataî   s   € ð ŒzÐr:   rB   úfloat | NonerA   Úboolc                óž   — |€| j         }|€| j        }t          j                             | j        ¦  «        }t          j        |d||¬¦  «        S )z(Return True if a Statevector has norm 1.Nr   r@   )rB   rA   r&   ÚlinalgÚnormr   rD   )r5   rB   rA   rv   s       r9   Úis_validzStatevector.is_validó   sH   € àˆ<Ø”9ˆDØˆ<Ø”9ˆDÝŒy�~Š~˜dœiÑ(Ô(ˆÝŒ{˜4 ¨°DÐ9Ñ9Ô9Ð9r:   r   c                óÐ   — t          j        | j        t          j        | j        ¦  «        ¦  «        }t	          ||                      ¦   «         |                      ¦   «         ¬¦  «        S )z,Convert state to a rank-1 projector operator©Ú
input_dimsÚoutput_dims)r&   Úouterr   Úconjr   r   )r5   Úmats     r9   Úto_operatorzStatevector.to_operatorü   sF   € åŒh�t”y¥"¤'¨$¬)Ñ"4Ô"4Ñ5Ô5ˆÝ˜¨¯	ª	©¬ÀÇÂÁÄÐMÑMÔMÐMr:   c                óv   — t          t          j        | j        ¦  «        |                      ¦   «         ¬¦  «        S )z%Return the conjugate of the operator.©r   )r   r&   r}   r   r   rR   s    r9   Ú	conjugatezStatevector.conjugate  s)   € å�2œ7 4¤9Ñ-Ô-°D·I²I±K´KÐ@Ñ@Ô@Ð@r:   ú
np.float64c                ó^   — t          j        t          j        | j        ¦  «        dz  ¦  «        S )z:Return the trace of the quantum state as a density matrix.r   )r&   ÚsumÚabsr   rR   s    r9   ÚtracezStatevector.trace  s#   € åŒv•b”f˜TœYÑ'Ô'¨1Ñ,Ñ-Ô-Ð-r:   c                ó0   — |                       ¦   «         dz  S )z'Return the purity of the quantum state.r   )r‡   rR   s    r9   ÚpurityzStatevector.purity	  s   € ð �zŠz‰|Œ|˜qÑ Ð r:   rE   c                ó  — t          |t          ¦  «        st          |¦  «        }t          j        | ¦  «        }| j                             |j        ¦  «        |_        t          j        | j        |j        ¦  «        |_        |S )u"  Return the tensor product state self âŠ— other.

        Args:
            other (Statevector): a quantum state object.

        Returns:
            Statevector: the tensor product operator self âŠ— other.

        Raises:
            QiskitError: if other is not a quantum state.
        )	r$   r   Ú_copyr<   r+   Útensorr&   Úkronr*   ©r5   rE   Úrets      r9   rŒ   zStatevector.tensor  sg   € õ ˜%¥Ñ-Ô-ð 	'Ý Ñ&Ô&ˆEÝŒj˜ÑÔˆØœ×-Ò-¨e¬oÑ>Ô>ˆŒÝ”G˜DœJ¨¬Ñ4Ô4ˆŒ	Øˆ
r:   c                óT  — t          |t          ¦  «        st          |¦  «        }|                      ¦   «         |                     ¦   «         k    r:t          d|                      ¦   «         › d|                     ¦   «         › d�¦  «        ‚t	          j        | j        |j        ¦  «        }|S )aˆ  Return the inner product of self and other as
        :math:`\langle self| other \rangle`.

        Args:
            other (Statevector): a quantum state object.

        Returns:
            np.complex128: the inner product of self and other, :math:`\langle self| other \rangle`.

        Raises:
            QiskitError: if other is not a quantum state or has different dimension.
        z%Statevector dimensions do not match: z and rf   )r$   r   r   r	   r&   Úvdotr   )r5   rE   Úinners      r9   r’   zStatevector.inner$  s’   € õ ˜%¥Ñ-Ô-ð 	'Ý Ñ&Ô&ˆEØ�9Š9‰;Œ;˜%Ÿ*š*™,œ,Ò&Ð&ÝØY¸¿	º	¹¼ÐYÐYÈ%Ï*Ê*É,Ì,ÐYÐYÐYñô ð õ ”˜œ	 5¤:Ñ.Ô.ˆØˆr:   c                ó  — t          |t          ¦  «        st          |¦  «        }t          j        | ¦  «        }| j                             |j        ¦  «        |_        t          j        |j        | j        ¦  «        |_        |S )u  Return the tensor product state other âŠ— self.

        Args:
            other (Statevector): a quantum state object.

        Returns:
            Statevector: the tensor product state other âŠ— self.

        Raises:
            QiskitError: if other is not a quantum state.
        )	r$   r   r‹   r<   r+   Úexpandr&   r�   r*   rŽ   s      r9   r”   zStatevector.expand:  sg   € õ ˜%¥Ñ-Ô-ð 	'Ý Ñ&Ô&ˆEÝŒj˜ÑÔˆØœ×-Ò-¨e¬oÑ>Ô>ˆŒÝ”G˜EœK¨¬Ñ4Ô4ˆŒ	Øˆ
r:   c                óÜ   — t          |t          ¦  «        st          |¦  «        }| j                             |j        ¦  «         t	          j        | ¦  «        }| j        |j        z   |_        |S )aP  Return the linear combination self + other.

        Args:
            other (Statevector): a quantum state object.

        Returns:
            Statevector: the linear combination self + other.

        Raises:
            QiskitError: if other is not a quantum state, or has
                         incompatible dimensions.
        )r$   r   r+   Ú_validate_addr‹   r<   r   r*   rŽ   s      r9   Ú_addzStatevector._addM  s_   € õ ˜%¥Ñ-Ô-ð 	'Ý Ñ&Ô&ˆEØŒ×$Ò$ U¤_Ñ5Ô5Ð5ÝŒj˜ÑÔˆØ”I ¤
Ñ*ˆŒ	Øˆ
r:   c                ó”   — t          |t          ¦  «        st          d¦  «        ‚t          j        | ¦  «        }|| j        z  |_        |S )a  Return the scalar multiplied state self * other.

        Args:
            other (complex): a complex number.

        Returns:
            Statevector: the scalar multiplied state other * self.

        Raises:
            QiskitError: if other is not a valid complex number.
        zother is not a number)r$   r   r	   r‹   r<   r   r*   rŽ   s      r9   Ú	_multiplyzStatevector._multiplya  sG   € õ ˜%¥Ñ(Ô(ð 	7ÝÐ5Ñ6Ô6Ð6ÝŒj˜ÑÔˆØ˜DœIÑ%ˆŒ	Øˆ
r:   ú'Operator | QuantumCircuit | InstructionÚqargsúlist[int] | Nonec                óP  — |€t          |dd¦  «        }t          j        | ¦  «        }t          |t          ¦  «        r|                     ¦   «         }t          |t          ¦  «        r.| j        €t          d¦  «        ‚|  	                    |||¬¦  «        S t          |t          ¦  «        s(|                      |¬¦  «        }t          |||¬¦  «        }|                      |¦  «        |                     ¦   «         k    rt          d¦  «        ‚t                               |||¬¦  «        S )aù  Evolve a quantum state by the operator.

        Args:
            other (Operator | QuantumCircuit | circuit.Instruction): The operator to evolve by.
            qargs (list): a list of Statevector subsystem positions to apply
                           the operator on.

        Returns:
            Statevector: the output quantum state.

        Raises:
            QiskitError: if the operator dimension does not match the
                         specified Statevector subsystem dimensions.
        Nr›   z5Cannot apply QuantumCircuit to non-qubit Statevector.©r›   ry   zLOperator input dimensions are not equal to statevector subsystem dimensions.)Úgetattrr‹   r<   r$   r   Úto_instructionr   Ú
num_qubitsr	   Ú_evolve_instructionr   r   rz   r   Ú_evolve_operator)r5   rE   r›   r�   r   s        r9   ÚevolvezStatevector.evolves  s(  € ð" ˆ=Ý˜E 7¨DÑ1Ô1ˆEõ Œj˜ÑÔˆõ �e�^Ñ,Ô,ð 	+Ø×(Ò(Ñ*Ô*ˆEÝ�e�[Ñ)Ô)ð 	EØŒÐ&Ý!Ð"YÑZÔZÐZØ×+Ò+¨C°¸eÐ+ÑDÔDÐDõ ˜%¥Ñ*Ô*ð 	GØ—9’9 5�9Ñ)Ô)ˆDÝ˜U¨tÀÐFÑFÔFˆEð �9Š9�UÑÔ˜u×/Ò/Ñ1Ô1Ò1Ð1ÝØ^ñô ð õ ×+Ò+¨C°¸eÐ+ÑDÔDÐDr:   c                óô   — t          |t          ¦  «        s"	 t          |¦  «        }n# t          $ r Y dS w xY w| j        |j        k    rdS |€| j        }|€| j        }t          | j        |j        d||¬¦  «        S )a�  Return True if other is equivalent as a statevector up to global phase.

        .. note::

            If other is not a Statevector, but can be used to initialize a statevector object,
            this will check that Statevector(other) is equivalent to the current statevector up
            to global phase.

        Args:
            other (Statevector): an object from which a ``Statevector`` can be constructed.
            rtol (float): relative tolerance value for comparison.
            atol (float): absolute tolerance value for comparison.

        Returns:
            bool: True if statevectors are equivalent up to global phase.
        FNT)Úignore_phaserA   rB   )r$   r   r	   r-   rB   rA   r   r   )r5   rE   rA   rB   s       r9   ÚequivzStatevector.equivž  s–   € õ& ˜%¥Ñ-Ô-ð 	ðÝ# EÑ*Ô*��øÝð ð ð Ø�u�uðøøøàŒ8�u”yÒ Ð Ø�5Øˆ<Ø”9ˆDØˆ<Ø”9ˆDÝ˜DœI u¤zÀÈ4ÐVZÐ[Ñ[Ô[Ð[s   —' §
5´5c                ór  — t          j        | ¦  «        }t          t          | j        j        dz
  dd¦  «        ¦  «        }t          j        t          j        t          j        | j	        | j        j
        ¦  «        |¦  «        | j        j        ¦  «        |_        | j                             ¦   «         |_        |S )aë  Return a Statevector with reversed subsystem ordering.

        For a tensor product state this is equivalent to reversing the order
        of tensor product subsystems. For a statevector
        :math:`|\psi \rangle = |\psi_{n-1} \rangle \otimes ... \otimes |\psi_0 \rangle`
        the returned statevector will be
        :math:`|\psi_{0} \rangle \otimes ... \otimes |\psi_{n-1} \rangle`.

        Returns:
            Statevector: the Statevector with reversed subsystem order.
        r   éÿÿÿÿ)r‹   r<   ÚtupleÚranger+   Ú_num_qargs_lr&   r1   Ú	transposer   Útensor_shaper    r*   Úreverse)r5   r�   Úaxess      r9   Úreverse_qargszStatevector.reverse_qargs¾  s�   € õ Œj˜ÑÔˆÝ•U˜4œ>Ô6¸Ñ:¸BÀÑCÔCÑDÔDˆÝ”JÝŒL�œ D¤I¨t¬~Ô/JÑKÔKÈTÑRÔRØŒNÔ ñ
ô 
ˆŒ	ð œ×.Ò.Ñ0Ô0ˆŒØˆ
r:   c           	     ód  — t          |¦  «        }|€t          j        |¦  «        }nt          j        |¦  «        }t          j        d|z  |j        ¦  «        }t          j        d|z  |j        ¦  «        }|j        r
d|j        z  nd}||z   dk    r*|t          j         	                    | j
        ¦  «        dz  z  S |dk    r|t          | j
        | j        |¦  «        z  S ||j                 d         }d|                     ¦   «         z  }	|	d         }	|t          | j
        | j        |||	|¦  «        z  S )a  Compute the expectation value of a Pauli.

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

        Returns:
            complex: the expectation value.
        Nr   y       €      ð¿r   r   r©   )rK   r&   Úaranger=   ÚdotÚxÚzÚphaseru   rv   r   r   r¡   Ú_count_yr   )
r5   Úpaulir›   Ún_pauliÚqubitsÚx_maskÚz_maskÚpauli_phaseÚx_maxÚy_phases
             r9   Ú_expectation_value_pauliz$Statevector._expectation_value_pauliÓ  s$  € õ �e‘*”*ˆØˆ=Ý”Y˜wÑ'Ô'ˆFˆFå”X˜e‘_”_ˆFå”˜˜V™ U¤WÑ-Ô-ˆÝ”˜˜V™ U¤WÑ-Ô-ˆØ.3¬kÐ@�s˜uœ{Ñ*Ð*¸qˆà�F‰?˜aÒÐØ¥¤§¢°´	Ñ!:Ô!:¸aÑ!?Ñ?Ð?à�QŠ;ˆ;ØÕ!2°4´9¸d¼oÈvÑ!VÔ!VÑVÐVà�u”w” Ô#ˆØ˜5Ÿ>š>Ñ+Ô+Ñ+ˆØ˜!”*ˆàÕ0ØŒI�t”¨°¸Àñ
ô 
ñ 
ð 	
r:   Úoperú+BaseOperator | QuantumCircuit | InstructionúNone | list[int]r)   c                ó¢  ‡ ‡— t          |t          ¦  «        r‰                      |‰¦  «        S t          |t          ¦  «        rDt	          ˆˆ fd„t          |j        j        |j        j        |j	        ¦  «        D ¦   «         ¦  «        S ‰  
                    |‰¬¦  «        }‰                      ¦   «         }t          j        |j        |j        ¦  «        S )a  Compute the expectation value of an operator.

        Args:
            oper (Operator): an operator to evaluate expval of.
            qargs (None or list): subsystems to apply operator on.

        Returns:
            complex: the expectation value.
        c              3  óp   •K  — | ]0\  }}}|‰                      t          ||f¦  «        ‰¦  «        z  V — Œ1d S rk   )rÁ   r   )Ú.0r¶   rµ   Úcoeffr›   r5   s       €€r9   ú	<genexpr>z0Statevector.expectation_value.<locals>.<genexpr>  s\   øè è € ð ð á�A�q˜%ð ˜×5Ò5µe¸QÀ¸F±m´mÀUÑKÔKÑKðð ð ð ð ð r:   rž   )r$   r   rÁ   r   r…   ÚzipÚpaulisr¶   rµ   Úcoeffsr¤   r‚   r&   r´   r   )r5   rÂ   r›   Úvalr}   s   ` `  r9   Úexpectation_valuezStatevector.expectation_valueõ  sÏ   øø€ õ �d�EÑ"Ô"ð 	>Ø×0Ò0°°uÑ=Ô=Ð=å�d�MÑ*Ô*ð 	Ýð ð ð ð ð å#& t¤{¤}°d´k´mÀTÄ[Ñ#QÔ#Qðñ ô ñ ô ð ð
 �kŠk˜$ eˆkÑ,Ô,ˆØ�~Š~ÑÔˆÝŒv�d”i ¤Ñ*Ô*Ð*r:   Údecimalsú
None | intc                óö   — |                       t          j        | j        ¦  «        dz  | j                             ¦   «         |¬¦  «        }t          j        |dd¬¦  «        }|�|                     |¬¦  «        }|S )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.

        Examples:

            Consider a 2-qubit product state
            :math:`|\psi\rangle=|+\rangle\otimes|0\rangle`.

            .. code-block::

                from qiskit.quantum_info import Statevector

                psi = Statevector.from_label('+0')

                # Probabilities for measuring both qubits
                probs = psi.probabilities()
                print('probs: {}'.format(probs))

                # Probabilities for measuring only qubit-0
                probs_qubit_0 = psi.probabilities([0])
                print('Qubit-0 probs: {}'.format(probs_qubit_0))

                # Probabilities for measuring only qubit-1
                probs_qubit_1 = psi.probabilities([1])
                print('Qubit-1 probs: {}'.format(probs_qubit_1))

            .. code-block:: text

                probs: [0.5 0.  0.5 0. ]
                Qubit-0 probs: [1. 0.]
                Qubit-1 probs: [0.5 0.5]

            We can also permute the order of qubits in the ``qargs`` list
            to change the qubit position in the probabilities output

            .. code-block::

                from qiskit.quantum_info import Statevector

                psi = Statevector.from_label('+0')

                # Probabilities for measuring both qubits
                probs = psi.probabilities([0, 1])
                print('probs: {}'.format(probs))

                # Probabilities for measuring both qubits
                # but swapping qubits 0 and 1 in output
                probs_swapped = psi.probabilities([1, 0])
                print('Swapped probs: {}'.format(probs_swapped))

            .. code-block:: text

                probs: [0.5 0.  0.5 0. ]
                Swapped probs: [0.5 0.5 0.  0. ]

        r   rž   r   r   )Úa_minÚa_maxN)rÏ   )Ú_subsystem_probabilitiesr&   r†   r   r+   r!   ÚclipÚround)r5   r›   rÏ   Úprobss       r9   ÚprobabilitieszStatevector.probabilities  s{   € ðL ×-Ò-ÝŒF�4”9ÑÔ Ñ" D¤N×$9Ò$9Ñ$;Ô$;À5ð .ñ 
ô 
ˆõ
 ”˜ Q¨aÐ0Ñ0Ô0ˆàÐØ—K’K¨�KÑ2Ô2ˆEàˆr:   c                óÐ  — |€Gt          j        | ¦  «        }t          j        | j        j        t          ¬¦  «        }d|d<   ||_        |S |                      |¦  «        }|  	                    |¦  «        }| j
                             t          |¦  «        |d¬¦  «        }t          j        t          |¦  «        t          ¬¦  «        }dt          j        ||         ¦  «        z  ||<   t          j        t          |¦  «        ¦  «        }d|d<   d|||f<   d|d|f<   t          j        |t          j        |¦  «        ¦  «        }|                      t%          |||¬¦  «        |¬¦  «        S )	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:
            Statevector: the reset state.

        Additional Information:
            If all subsystems are reset this will return the ground state
            on all subsystems. If only a 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.
        Nr   r   r   )ÚpÚsize)r   r   ry   rž   )r‹   r<   r&   Úzerosr+   r    r)   r*   r   rØ   Ú_rngÚchoicerK   ÚsqrtÚeyer´   Údiagr¤   r   )	r5   r›   r�   Ústater   r×   ÚsampleÚprojÚresets	            r9   rå   zStatevector.reset`  sC  € ð& ˆ=å”*˜TÑ"Ô"ˆCÝ”H˜Tœ^Ô1½ÐAÑAÔAˆEØˆE�!‰HØˆCŒIØˆJð �yŠy˜ÑÔˆØ×"Ò" 5Ñ)Ô)ˆØ”×!Ò!¥# e¡*¤*°¸AÐ!Ñ>Ô>ˆõ Œx�˜E™
œ
­'Ð2Ñ2Ô2ˆØ�2œ7 5¨¤=Ñ1Ô1Ñ1ˆˆV‰õ ”•s˜5‘z”zÑ"Ô"ˆØˆˆd‰Ø !ˆˆf�fˆnÑØˆˆa�ˆiÑõ ”�u�bœg d™mœmÑ,Ô,ˆØ�{Š{�8 E°dÈÐMÑMÔMÐUZˆ{Ñ[Ô[Ð[r:   Úlabelr]   c                óN  — t          j        d|¦  «        €t          d¦  «        ‚|}d}t          j        d|¦  «        €Zd}|                     dd¦  «        }|                     d	d¦  «        }|                     d
d¦  «        }|                     dd¦  «        }t	          |¦  «        }t          j        d|z  t          ¬¦  «        }t          |d¦  «        }d||<   t          |¦  «        }|rºt          j
        ddgddggt          ¬¦  «        t          j        d¦  «        z  }t          j        t          j        ddg¦  «        |¦  «        }	t          t!          |¦  «        ¦  «        D ]>\  }
}|dv r|                     ||
g¬¦  «        }Œ"|dv r|                     |	|
g¬¦  «        }Œ?|S )a  Return a tensor product of Pauli X,Y,Z eigenstates.

        .. list-table:: Single-qubit state labels
           :header-rows: 1

           * - Label
             - Statevector
           * - ``"0"``
             - :math:`[1, 0]`
           * - ``"1"``
             - :math:`[0, 1]`
           * - ``"+"``
             - :math:`[1 / \sqrt{2},  1 / \sqrt{2}]`
           * - ``"-"``
             - :math:`[1 / \sqrt{2},  -1 / \sqrt{2}]`
           * - ``"r"``
             - :math:`[1 / \sqrt{2},  i / \sqrt{2}]`
           * - ``"l"``
             - :math:`[1 / \sqrt{2},  -i / \sqrt{2}]`

        Args:
            label (string): a eigenstate string ket label (see table for
                            allowed values).

        Returns:
            Statevector: The N-qubit basis state density matrix.

        Raises:
            QiskitError: if the label contains invalid characters, or the
                         length of the label is larger than an explicitly
                         specified num_qubits.
        z^[01rl\-+]+$Nz"Label contains invalid characters.Fz^[01]+$Tú+Ú0Úrú-Ú1Úlr   r   r   r©   ù              ð?)rè   rë   rž   )rê   rí   )ÚreÚmatchr	   ÚreplacerK   r&   rÜ   r)   rg   r   r=   Úmathrß   r´   rá   Ú	enumerateÚreversedr¤   )Úclsræ   Úz_labelÚ	xy_statesr¡   r   Úposrâ   Úx_matÚy_matÚqubitÚchars               r9   Ú
from_labelzStatevector.from_labelŽ  sŸ  € õF Œ8�O UÑ+Ô+Ð3ÝÐBÑCÔCÐCð
 ˆØˆ	ÝŒ8�I˜uÑ%Ô%Ð-ð ˆIØ—o’o c¨3Ñ/Ô/ˆGØ—o’o c¨3Ñ/Ô/ˆGØ—o’o c¨3Ñ/Ô/ˆGØ—o’o c¨3Ñ/Ô/ˆGå˜‘Z”Zˆ
ÝŒx˜˜Z™­wÐ7Ñ7Ô7ˆÝ�'˜1‰oŒoˆØˆˆS‰	Ý˜DÑ!Ô!ˆØð 		?å”H˜q !˜f q¨" gÐ.µgÐ>Ñ>Ô>ÅÄÈ1ÁÄÑMˆEå”F�2œ7 A r 7Ñ+Ô+¨UÑ3Ô3ˆEÝ(­°%©¬Ñ9Ô9ð ?ð ?‘��tØ˜:Ð%Ð%Ø!ŸLšL¨°u°g˜LÑ>Ô>�E�EØ˜ZÐ'Ð'Ø!ŸLšL¨°u°g˜LÑ>Ô>�EøØˆr:   Úirg   úint | tuple | listc                óŒ   — t          j        |¦  «        }t          j        |t          ¬¦  «        }d|| <   t	          ||¬¦  «        S )a•  Return a computational basis statevector.

        Args:
            i (int): the basis state element.
            dims (int or tuple or list): The subsystem dimensions of the statevector
                                         (See additional information).

        Returns:
            Statevector: The computational basis state :math:`|i\rangle`.

        Additional Information:
            The ``dims`` kwarg can be an integer or an iterable of integers.

            * ``Iterable`` -- the subsystem dimensions are the values in the list
              with the total number of subsystems given by the length of the list.

            * ``Int`` -- the integer specifies the total dimension of the
              state. If it is a power of two the state will be initialized
              as an N-qubit state. If it is not a power of  two the state
              will have a single d-dimensional subsystem.
        r   ç      ð?r�   )r&   ÚprodrÜ   r)   r   )rþ   r   rÛ   râ   s       r9   Úfrom_intzStatevector.from_intÓ  sA   € õ. Œw�t‰}Œ}ˆÝ”˜¥WÐ-Ñ-Ô-ˆØˆˆa‰Ý˜5 tÐ,Ñ,Ô,Ð,r:   ÚinstructionúInstruction | QuantumCircuitc                ó  — t          |t          ¦  «        r|                     ¦   «         }t          j        d|j        z  t          ¬¦  «        }d|d<   t          ||j        dz  ¬¦  «        }t                               ||¦  «        S )ah  Return the output statevector of an instruction.

        The statevector is initialized in the state :math:`|{0,\ldots,0}\rangle` of the
        same number of qubits as the input instruction or circuit, evolved
        by the input instruction, and the output statevector returned.

        Args:
            instruction (qiskit.circuit.Instruction or QuantumCircuit): instruction or circuit

        Returns:
            Statevector: The final statevector.

        Raises:
            QiskitError: if the instruction contains invalid instructions for
                         the statevector simulation.
        r   r   r  r   ©r   r�   )	r$   r   r    r&   rÜ   r¡   r)   r   r¢   )rõ   r  ÚinitÚvecs       r9   r/   zStatevector.from_instructionï  s|   € õ& �k¥>Ñ2Ô2ð 	7Ø%×4Ò4Ñ6Ô6ˆKåŒx˜˜;Ô1Ñ1½ÐAÑAÔAˆØˆˆQ‰Ý˜$ [Ô%;¸dÑ%BÐCÑCÔCˆÝ×.Ò.¨s°KÑ@Ô@Ð@r:   c                ól   — |                       | j        | j                             ¦   «         |d¬¦  «        S )aæ  Convert the statevector to dictionary form.

        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:
            decimals (None or int): the number of decimal places to round
                                    values. If None no rounding is done
                                    (Default: None).

        Returns:
            dict: the dictionary form of the Statevector.

        Example:

            The ket-form of a 2-qubit statevector
            :math:`|\psi\rangle = |-\rangle\otimes |0\rangle`

            .. code-block::

                from qiskit.quantum_info import Statevector

                psi = Statevector.from_label('-0')
                print(psi.to_dict())

            .. code-block:: text

                {'00': (0.7071067811865475+0j), '10': (-0.7071067811865475+0j)}

            For non-qubit subsystems the integer range can go from 0 to 9. For
            example in a qutrit system

            .. code-block::

                import numpy as np
                from qiskit.quantum_info import Statevector

                vec = np.zeros(9)
                vec[0] = 1 / np.sqrt(2)
                vec[-1] = 1 / np.sqrt(2)
                psi = Statevector(vec, dims=(3, 3))
                print(psi.to_dict())

            .. code-block:: text

                {'00': (0.7071067811865475+0j), '22': (0.7071067811865475+0j)}

            For large subsystem dimensions delimiters are required. The
            following example is for a 20-dimensional system consisting of
            a qubit and 10-dimensional qudit.

            .. code-block::

                import numpy as np
                from qiskit.quantum_info import Statevector

                vec = np.zeros(2 * 10)
                vec[0] = 1 / np.sqrt(2)
                vec[-1] = 1 / np.sqrt(2)
                psi = Statevector(vec, dims=(2, 10))
                print(psi.to_dict())

            .. code-block:: text

                {'00': (0.7071067811865475+0j), '91': (0.7071067811865475+0j)}

        T)rÏ   Ústring_labels)Ú_vector_to_dictr   r+   r!   )r5   rÏ   s     r9   Úto_dictzStatevector.to_dict
  s<   € ðL ×#Ò#ØŒI�t”~×,Ò,Ñ.Ô.¸ÐQUð $ñ 
ô 
ð 	
r:   c           	     óX  ‡
‡— | j                              |j         |¬¦  «        }|€-t          j        |j        | j        ¦  «        | _        || _         | S | j         j        d         Šˆfd„t          |¦  «        D ¦   «         Š
‰
ˆ
fd„t          ‰¦  «        D ¦   «         z   }t          j        |¦  «         	                    ¦   «         }|j         j
        d         }|| j         j
        d         |z  f}t          j        t          j        | j        | j         j        ¦  «        |¦  «        }|j
        }	t          j        t          j        |j        t          j        ||¦  «        ¦  «        |	¦  «        }t          j        t          j        ||¦  «        |j
        d         ¦  «        | _        || _         | S )zEvolve a qudit statevectorrž   Nr   c                ó    •— g | ]
}‰d z
  |z
  ‘ŒS )r   © )rÇ   rþ   Ú	num_qargss     €r9   ú
<listcomp>z0Statevector._evolve_operator.<locals>.<listcomp>`  s"   ø€ Ð>Ð>Ð>¨�9˜q‘= 1Ñ$Ð>Ð>Ð>r:   c                ó   •— g | ]}|‰v¯|‘Œ	S r  r  )rÇ   rþ   Úindicess     €r9   r  z0Statevector._evolve_operator.<locals>.<listcomp>a  s#   ø€ ÐJÐJÐJ ¸À'Ð9IÐ9I˜!Ð9IÐ9IÐ9Ir:   r   )r+   Úcomposer&   r´   r*   r  rô   r«   ÚargsortÚtolistr    r­   r1   r   r®   )ÚstatevecrÂ   r›   Ú	new_shaper°   Úaxes_invÚcontract_dimÚcontract_shaperŒ   r®   r  r  s             @@r9   r£   zStatevector._evolve_operatorT  s‹  øø€ ð Ô&×.Ò.¨t¬~ÀUÐ.ÑKÔKˆ	Øˆ=åœV D¤J°´Ñ?Ô?ˆHŒNØ!*ˆHÔØˆOð Ô&Ô0°Ô3ˆ	Ø>Ð>Ð>Ð>­h°u©o¬oÐ>Ñ>Ô>ˆØÐJÐJÐJÐJ¥U¨9Ñ%5Ô%5ÐJÑJÔJÑJˆÝ”:˜dÑ#Ô#×*Ò*Ñ,Ô,ˆð ”~Ô+¨AÔ.ˆØ&¨Ô(:Ô(@ÀÔ(CÀ|Ñ(SÐTˆõ ”ÝŒJ�x”} hÔ&8Ô&EÑFÔFØñ
ô 
ˆð ”|ˆõ ”ÝŒF�4”9�bœj¨°Ñ@Ô@ÑAÔAØñ
ô 
ˆõ œ¥B¤L°¸Ñ$BÔ$BÀIÄOÐTUÔDVÑWÔWˆŒð 'ˆÔØˆr:   c                óâ  ‡‡— ddl m} ddlm} ddlm} t          j        |¦  «        }|�*t           	                    | t          |¦  «        ‰¬¦  «        S t          ||¦  «        r!|                      ‰¦  «        j        | _        | S t          ||¦  «        r| S t          ||¦  «        �r~t          d„ |j        D ¦   «         ¦  «        r8t                               d                     |j        ¦  «        ¦  «        j        }n�t#          |j        ¦  «        d	k    rUt%          t'          j        |j        d         ¦  «        ¦  «        }t                               |d
|j        z  ¦  «        j        }n t'          j        |j        t0          ¬¦  «        }‰€|| _        n�|                      ‰¦  «        j        | _        t'          j        dt#          ‰¦  «        z  dt#          ‰¦  «        z  ft0          ¬¦  «        }||dd…df<   t           	                    | t          |¦  «        ‰¬¦  «        } | S |j        €t7          d|j        › �¦  «        ‚t          |j        t:          ¦  «        s,t7          |j        › dt=          |j        ¦  «        › d�¦  «        ‚|j        j        r<| xj        t'          j         dtC          |j        j        ¦  «        z  ¦  «        z  c_        d„ tE          |j        j#        ¦  «        D ¦   «         Š|j        D ]q}	|	j$        rt7          d|	j%        j        › �¦  «        ‚‰€ˆfd„|	j#        D ¦   «         }
nˆˆfd„|	j#        D ¦   «         }
t           &                    | |	j%        |
¬¦  «         Œr| S )z:Update the current Statevector by applying an instruction.r   )ÚReset)ÚBarrier)Ú
InitializeNrž   c              3  ó@   K  — | ]}t          |t          ¦  «        V — Œd S rk   )r$   r]   )rÇ   Úparams     r9   rÉ   z2Statevector._evolve_instruction.<locals>.<genexpr>–  s,   è è € ÐBÐB¨e•:˜e¥SÑ)Ô)ÐBÐBÐBÐBÐBÐBr:   Ú r   r  r   r   zCannot apply Instruction: z instruction definition is z; expected QuantumCircuitrî   c                ó   — i | ]\  }}||“Œ	S r  r  )rÇ   rþ   rû   s      r9   ú
<dictcomp>z3Statevector._evolve_instruction.<locals>.<dictcomp>»  s   € ÐLÐLÐL™x˜q %�%˜ÐLÐLÐLr:   z.Cannot apply instruction with classical bits: c                ó    •— g | ]
}‰|         ‘ŒS r  r  )rÇ   Útupr»   s     €r9   r  z3Statevector._evolve_instruction.<locals>.<listcomp>Ã  s   ø€ ÐGÐGÐG¨S˜V Cœ[ÐGÐGÐGr:   c                ó,   •— g | ]}‰‰|                  ‘ŒS r  r  )rÇ   r'  r›   r»   s     €€r9   r  z3Statevector._evolve_instruction.<locals>.<listcomp>Å  s"   ø€ ÐNÐNÐN°C˜U 6¨#¤;Ô/ÐNÐNÐNr:   )'Úqiskit.circuit.resetr  Úqiskit.circuit.barrierr  Ú3qiskit.circuit.library.data_preparation.initializerr   r   Ú_instruction_to_matrixr   r£   r$   rå   r*   ÚallÚparamsrý   ÚjoinrK   rg   r&   Úrealr  r¡   r(   r)   rÜ   Ú
definitionr	   Únamer   ÚtypeÚglobal_phaseÚexpÚfloatró   r»   ÚclbitsÚ	operationr¢   )r  Úobjr›   r  r  r   r~   Úinitializationrâ   r  Ú	new_qargsr»   s     `        @r9   r¢   zStatevector._evolve_instruction|  s}  øø€ ð 	/Ð.Ð.Ð.Ð.Ð.Ø2Ð2Ð2Ð2Ð2Ð2ð 	SÐRÐRÐRÐRÐRåÔ-¨cÑ2Ô2ˆØˆ?õ ×/Ò/°½(À3¹-¼-ÈuÐ/ÑUÔUÐUõ �c˜5Ñ!Ô!ð 	Ø%Ÿ^š^¨EÑ2Ô2Ô8ˆHŒNØˆOÝ�c˜7Ñ#Ô#ð 	ØˆOÝ�c˜:Ñ&Ô&ñ 	åÐBÐB°s´zÐBÑBÔBÑBÔBð GÝ!,×!7Ò!7¸¿ºÀÄ
Ñ8KÔ8KÑ!LÔ!LÔ!R��õ
 �S”Z‘” AÒ%Ð%Ý�BœG C¤J¨q¤MÑ2Ô2Ñ3Ô3�Ý!,×!5Ò!5°e¸TÀCÄNÑ=RÑ!SÔ!SÔ!Y��õ "$¤¨C¬J½gÐ!FÑ!FÔ!F�àˆ}Ø!/�”�ð "*§¢°Ñ!6Ô!6Ô!<�”Ý”h ¥S¨¡Z¤Z¡°µc¸%±j´j±ÐAÍÐQÑQÔQ�Ø*��A�A�A�q�D‘	Ý&×7Ò7¸Å(È3Á-Ä-ÐW\Ð7Ñ]Ô]�àˆOð
 Œ>Ð!ÝÐE¸3¼8ÐEÐEÑFÔFÐFÝ˜#œ.­.Ñ9Ô9ð 	ÝØ”8ÐgÐg½¸S¼^Ñ8LÔ8LÐgÐgÐgñô ð ð Œ>Ô&ð 	NØˆNŒN�bœf R­%°´Ô0KÑ*LÔ*LÑ%LÑMÔMÑMˆNŒNØLÐL­9°S´^Ô5JÑ+KÔ+KÐLÑLÔLˆØœ>ð 
	^ð 
	^ˆKØÔ!ð Ý!ØaÀ[ÔEZÔE_ÐaÐañô ð ð ˆ}ØGÐGÐGÐG°KÔ4FÐGÑGÔG�	�	àNÐNÐNÐNÐN¸;Ô;MÐNÑNÔN�	Ý×+Ò+¨H°kÔ6KÐS\Ð+Ñ]Ô]Ð]Ð]Øˆr:   rk   )r   r   r   r   )rO   rP   )rT   rU   )rb   rc   rO   rd   )rO   rp   )NN)rB   rr   rA   rr   rO   rs   )rO   r   )rO   r   )rO   rƒ   )rE   r   rO   r   )rE   r   rO   rd   )rE   rš   r›   rœ   rO   r   )rE   r   rA   rr   rB   rr   rO   rs   )rÂ   rÃ   r›   rÄ   rO   r)   )r›   rÄ   rÏ   rÐ   rO   rp   )r›   rœ   rO   r   )ræ   r]   rO   r   )rþ   rg   r   rÿ   rO   r   )r  r  rO   r   )rÏ   rÐ   rO   rP   ),Ú__name__Ú
__module__Ú__qualname__Ú__doc__r3   r   ÚCOPY_ONLY_IF_NEEDEDr>   rC   rN   ÚpropertyrS   rZ   ra   ri   rm   ro   r   rw   r   r‚   r‡   r‰   rŒ   r’   r”   r—   r™   r¤   r§   r±   rÁ   rÎ   rØ   rå   Úclassmethodrý   Ústaticmethodr  r/   r  r£   r¢   Ú__classcell__)r8   s   @r9   r   r   -   sÀ  ø€ € € € € ØÐð +/ðBZð BZð BZð BZð BZð BZð BZðH #¨Ô)Jð ;ð ;ð ;ð ;ð
ð 
ð 
ð 
ð 
ð

ð 
ð 
ð ðEð Eð Eñ „XðEð:@ð :@ð :@ð :@ð :@ðxð ð ðKð Kð Kð Kð2ð ð ðð ð ð ðð ð ñ „Xðð:ð :ð :ð :ð :ðNð Nð Nð Nð
Að Að Að Að.ð .ð .ð .ð!ð !ð !ð !ðð ð ð ð&ð ð ð ð,ð ð ð ð&ð ð ð(ð ð ð& Y]ð)Eð )Eð )Eð )Eð )EðX SWð\ð \ð \ð \ð \ð@ð ð ð ð* 
ð  
ð  
ð  
ðF \`ð+ð +ð +ð +ð +ð4 FJðPð Pð Pð Pð Pðd,\ð ,\ð ,\ð ,\ð ,\ð\ ðBð Bð Bñ „[ðBðH ð-ð -ð -ñ „\ð-ð6 ðAð Að Añ „[ðAð4H
ð H
ð H
ð H
ð H
ðT ð%ð %ð %ñ „\ð%ðN ðJð Jð Jñ „\ðJð Jð Jð Jð Jr:   r   )(r?  Ú
__future__r   r<   r‹   rò   rï   Únumbersr   Útypingr   Únumpyr&   Úqiskitr   Úqiskit.circuit.quantumcircuitr   Úqiskit.circuit.instructionr   Úqiskit.exceptionsr	   Ú(qiskit.quantum_info.states.quantum_stater
   Ú/qiskit.quantum_info.operators.mixins.tolerancesr   Ú&qiskit.quantum_info.operators.operatorr   r   Ú(qiskit.quantum_info.operators.symplecticr   r   Ú&qiskit.quantum_info.operators.op_shaper   Ú(qiskit.quantum_info.operators.predicatesr   Úqiskit._accelerate.pauli_expvalr   r   r   r   r  r:   r9   ú<module>rT     sµ  ððð ð #Ð "Ð "Ð "Ð "Ð "Ø Ð Ð Ð Ø €€€Ø 	€	€	€	Ø Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  à Ð Ð Ð à  Ð  Ð  Ð  Ð  Ð  Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø )Ð )Ð )Ð )Ð )Ð )Ø AÐ AÐ AÐ AÐ AÐ AØ KÐ KÐ KÐ KÐ KÐ KØ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IØ IÐ IÐ IÐ IÐ IÐ IÐ IÐ IØ :Ð :Ð :Ð :Ð :Ð :Ø AÐ AÐ AÐ AÐ AÐ Aðð ð ð ð ð ð ð ð
 ð ØÐÐÐÐÐðZð Zð Zð Zð Z�, ñ Zô Zð Zð Zð Zr:   