ó
    Óz	i
  ã            	       ó<   • S r SSKrSSKJr   S	S\S\S\S\4S jjrg)
zLInteger comparator based on an exponential number of multi-controlled gates.é    N)ÚQuantumCircuitÚnum_state_qubitsÚvalueÚgeqÚreturnc                 ó¸  • [        U S-   5      nUS::  a  U(       a  UR                  U 5        U$ [        [        R                  " U5      5      nUSU S-
  -  :  a  U(       d  USU S-
  -  :”  a  U(       d  U(       + nUR                  U 5        U(       a  [        USU -  5      nO[        SU5      nU H%  nUR                  [        [        U 5      5      XS9  M'     U$ )am  Implement an integer comparison based on value-by-value comparison.

For ``value`` smaller than ``2 ** (num_state_qubits - 1)`` this circuit implements
``value`` multi-controlled gates with control states 0, 1, ..., ``value - 1``, such that
the target qubit is flipped if the qubit state represents any of the allowed values.
For ``value`` larger than that, ``geq`` is flipped. This implementation can
require an exponential number of gates. If auxiliary qubits are available, the implementation
provided by :func:`.synth_integer_comparator_2s` is more efficient.

Args:
    num_state_qubits: The number of qubits encoding the value to compare to.
    value: The value to compare to.
    geq: If ``True`` flip the target bit if the qubit state is :math:`\geq` than the value,
        otherwise implement :math:`<`.

Returns:
    A circuit implementing the integer comparator.

é   r   é   )Ú
ctrl_state)r   ÚxÚintÚnpÚceilÚrangeÚmcxÚlist)r   r   r   ÚcircuitÚaccepted_valuesÚaccepted_values         Úp/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/synthesis/arithmetic/comparators/compare_greedy.pyÚsynth_integer_comparator_greedyr      sÏ   € ô, Ð-°Ñ1Ó2€GàƒzÞØI‰IÐ&Ô'àˆô ”—’˜“Ó€EØÐ&¨Ñ*Ñ+Ó+¶ØÐ&¨Ñ*Ñ+Ó+¶CàŒgˆØ	‰	Ð"Ô#æ
Ü  qÐ*:Ñ':Ó;‰ä  5›/ˆã)ˆØ‰”DœÐ/Ó0Ó1Ð3CˆÓ_ñ *ð €Nó    )T)Ú__doc__Únumpyr   Úqiskit.circuit.quantumcircuitr   r   Úboolr   © r   r   Ú<module>r      s;   ðñ Sã Ý 8ð 48ñ/Øð/Ø"%ð/Ø,0ð/àö/r   