ó
    Óz	iR  ã                  óv   • S r SSKJr  SSKJrJr  SSKJrJr  SSK	r
SSKJr   " S S\\5      r " S	 S
\5      rg)z3Base classes for an approximate circuit definition.é    )Úannotations)ÚABCÚabstractmethod)ÚOptionalÚSupportsFloatN)ÚQuantumCircuitc                  óf   ^ • \ rS rSrSrSSU 4S jjjr\\S	S j5       5       r\S
S j5       r	Sr
U =r$ )ÚApproximateCircuité   z4A base class that represents an approximate circuit.c                ó    >• [         TU ]  XS9  g)z`
Args:
    num_qubits: number of qubit this circuit will span.
    name: a name of the circuit.
)ÚnameN)ÚsuperÚ__init__)ÚselfÚ
num_qubitsr   Ú	__class__s      €Úb/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/synthesis/unitary/aqc/approximate.pyr   ÚApproximateCircuit.__init__   s   ø€ ô 	‰Ñ˜ÐÒ/ó    c                ó   • [         e)z‹
The property is not implemented and raises a ``NotImplementedException`` exception.

Returns:
    a vector of parameters of this circuit.
©ÚNotImplementedError©r   s    r   ÚthetasÚApproximateCircuit.thetas    ó
   € ô "Ð!r   c                ó   • [         e)z¿
Constructs this circuit out of the parameters(thetas). Parameter values must be set before
    constructing the circuit.

Args:
    thetas: a vector of parameters to be set in this circuit.
r   )r   r   s     r   ÚbuildÚApproximateCircuit.build+   r   r   © ©N)r   Úintr   zOptional[str]ÚreturnÚNone©r#   ú
np.ndarray)r   r&   r#   r$   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Úpropertyr   r   r   Ú__static_attributes__Ú__classcell__)r   s   @r   r
   r
      s@   ø† Ù>÷0ñ 0ð Øó"ó ó ð"ð ó"ó ö"r   r
   c                  ó¤   • \ rS rSrSrSS jr\SS j5       r\SS j5       r\	SS j5       r
\
R                  SS j5       r
\	\SS j5       5       rS	rg
)ÚApproximatingObjectiveé7   a  
A base class for an optimization problem definition. An implementing class must provide at least
an implementation of the ``objective`` method. In such case only gradient free optimizers can
be used. Both method, ``objective`` and ``gradient``, preferable to have in an implementation.
c                ó   • S U l         g r!   ©Ú_target_matrixr   s    r   r   ÚApproximatingObjective.__init__>   s
   € à15ˆÕr   c                ó   • [         e)zÛ
Computes a value of the objective function given a vector of parameter values.

Args:
    param_values: a vector of parameter values for the optimization problem.

Returns:
    a float value of the objective function.
r   ©r   Úparam_valuess     r   Ú	objectiveÚ ApproximatingObjective.objectiveB   ó
   € ô "Ð!r   c                ó   • [         e)zÓ
Computes a gradient with respect to parameters given a vector of parameter values.

Args:
    param_values: a vector of parameter values for the optimization problem.

Returns:
    an array of gradient values.
r   r7   s     r   ÚgradientÚApproximatingObjective.gradientO   r;   r   c                ó   • U R                   $ )z*
Returns:
    a matrix being approximated
r3   r   s    r   Útarget_matrixÚ$ApproximatingObjective.target_matrix\   s   € ð ×"Ñ"Ð"r   c                ó   • Xl         g)zQ
Args:
    target_matrix: a matrix to approximate in the optimization procedure.
Nr3   )r   r@   s     r   r@   rA   d   s
   € ð ,Õr   c                ó   • [         e)zF

Returns:
    the number of parameters in this optimization problem.
r   r   s    r   Ú
num_thetasÚ!ApproximatingObjective.num_thetasl   s
   € ô "Ð!r   r3   N)r#   r$   )r8   r&   r#   r   )r8   r&   r#   r&   r%   )r@   r&   r#   r$   )r#   r"   )r'   r(   r)   r*   r+   r   r   r9   r=   r,   r@   ÚsetterrD   r-   r    r   r   r0   r0   7   s~   † ñô6ð ó
"ó ð
"ð ó
"ó ð
"ð ó#ó ð#ð ×Ñó,ó ð,ð Øó"ó ó ó"r   r0   )r+   Ú
__future__r   Úabcr   r   Útypingr   r   ÚnumpyÚnpÚqiskit.circuit.quantumcircuitr   r
   r0   r    r   r   Ú<module>rM      s4   ðñ :Ý "ß #ß *Û å 8ô"˜¨ô "ôD="˜Sõ ="r   