§
    º³Ùgß  ã                   óR   — d Z ddlmZ ddlZddlmZ ddlmZ  G d„ de¦  «        ZdS )a.  
==============================================================================
AQC Synthesis Plugin (in :mod:`qiskit.transpiler.passes.synthesis.aqc_plugin`)
==============================================================================

.. autosummary::
   :toctree: ../stubs/

   AQCSynthesisPlugin
é    )ÚpartialN)Úcircuit_to_dag)ÚUnitarySynthesisPluginc                   óÞ   — e Zd ZdZed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Z	ed„ ¦   «         Z
ed„ ¦   «         Zed	„ ¦   «         Zed
„ ¦   «         Zd„ ZdS )ÚAQCSynthesisPluginaÎ  
    An AQC-based Qiskit unitary synthesis plugin.

    This plugin is invoked by :func:`~.compiler.transpile` when the ``unitary_synthesis_method``
    parameter is set to ``"aqc"``.

    This plugin supports customization and additional parameters can be passed to the plugin
    by passing a dictionary as the ``unitary_synthesis_plugin_config`` parameter of
    the :func:`~qiskit.compiler.transpile` function.

    Supported parameters in the dictionary:

    network_layout (str)
        Type of network geometry, one of {``"sequ"``, ``"spin"``, ``"cart"``, ``"cyclic_spin"``,
        ``"cyclic_line"``}. Default value is ``"spin"``.

    connectivity_type (str)
        type of inter-qubit connectivity, {``"full"``, ``"line"``, ``"star"``}.  Default value
        is ``"full"``.

    depth (int)
        depth of the CNOT-network, i.e. the number of layers, where each layer consists of a
        single CNOT-block.

    optimizer (:class:`~.Minimizer`)
        An implementation of the ``Minimizer`` protocol to be used in the optimization process.

    seed (int)
        A random seed.

    initial_point (:class:`~numpy.ndarray`)
        Initial values of angles/parameters to start the optimization process from.
    c                 ó   — dS )z-Maximum number of supported qubits is ``14``.é   © ©Úselfs    úc/granary/edev/quantum/lib/python3.11/site-packages/qiskit/transpiler/passes/synthesis/aqc_plugin.pyÚ
max_qubitszAQCSynthesisPlugin.max_qubits@   s	   € ð ˆró    c                 ó   — dS )z,Minimum number of supported qubits is ``3``.é   r
   r   s    r   Ú
min_qubitszAQCSynthesisPlugin.min_qubitsE   s	   € ð ˆqr   c                 ó   — dS )z`The plugin does not support natural direction,
        it assumes bidirectional two qubit gates.Fr
   r   s    r   Úsupports_natural_directionz-AQCSynthesisPlugin.supports_natural_directionJ   ó	   € ð ˆur   c                 ó   — dS )z3The plugin does not support optimization of pulses.Fr
   r   s    r   Úsupports_pulse_optimizez*AQCSynthesisPlugin.supports_pulse_optimizeP   ó	   € ð ˆur   c                 ó   — dS )z)The plugin does not support gate lengths.Fr
   r   s    r   Úsupports_gate_lengthsz(AQCSynthesisPlugin.supports_gate_lengthsU   r   r   c                 ó   — dS )z(The plugin does not support gate errors.Fr
   r   s    r   Úsupports_gate_errorsz'AQCSynthesisPlugin.supports_gate_errorsZ   r   r   c                 ó   — dS )z0The plugin does not support bases for synthesis.Nr
   r   s    r   Úsupported_basesz"AQCSynthesisPlugin.supported_bases_   s	   € ð ˆtr   c                 ó   — dS )z†The plugin does not support basis gates and by default it synthesizes a circuit using
        ``["rx", "ry", "rz", "cx"]`` gate basis.Fr
   r   s    r   Úsupports_basis_gatesz'AQCSynthesisPlugin.supports_basis_gatesd   r   r   c                 ó   — dS )z*The plugin does not support coupling maps.Fr
   r   s    r   Úsupports_coupling_mapz(AQCSynthesisPlugin.supports_coupling_mapj   r   r   c                 ó°  — ddl m} ddlm} ddlm} ddlm} ddlm	} t          t          j        |j        d         ¦  «        ¦  «        }|                     d¦  «        pi }	|	                     dd	¦  «        }
|	                     d
d¦  «        }|	                     dd¦  «        } |||
||¬¦  «        }t          |ddddi¬¦  «        }|	                     d|¦  «        }|	                     d¦  «        } |||¦  «        } |||¬¦  «        } |||¬¦  «        }|	                     d¦  «        }|                     ||||¬¦  «         t#          |¦  «        }|S )Nr   )Úminimize)ÚAQC)Úmake_cnot_network)ÚCNOTUnitCircuit)ÚFastCNOTUnitObjectiveÚconfigÚnetwork_layoutÚspinÚconnectivity_typeÚfullÚdepth)Ú
num_qubitsr*   r,   r.   r
   zL-BFGS-BÚmaxiteriè  )ÚargsÚmethodÚoptionsÚ	optimizerÚseed)r/   ÚcnotsÚinitial_point)Útarget_matrixÚapproximate_circuitÚapproximating_objectiver7   )Úscipy.optimizer$   Úqiskit.synthesis.unitary.aqcr%   Ú,qiskit.synthesis.unitary.aqc.cnot_structuresr&   Ú.qiskit.synthesis.unitary.aqc.cnot_unit_circuitr'   Ú8qiskit.synthesis.unitary.aqc.fast_gradient.fast_gradientr(   ÚroundÚmathÚlog2ÚshapeÚgetr   Úcompile_unitaryr   )r   Úunitaryr3   r$   r%   r&   r'   r(   r/   r)   r*   r,   r.   r6   Údefault_optimizerr4   r5   Úaqcr9   r:   r7   Údag_circuits                         r   ÚrunzAQCSynthesisPlugin.runo   sÃ  € ð 	,Ð+Ð+Ð+Ð+Ð+Ø4Ð4Ð4Ð4Ð4Ð4ØRÐRÐRÐRÐRÐRØRÐRÐRÐRÐRÐRØbÐbÐbÐbÐbÐbå�4œ9 W¤]°1Ô%5Ñ6Ô6Ñ7Ô7ˆ
à—’˜XÑ&Ô&Ð,¨"ˆàŸšÐ$4°fÑ=Ô=ˆØ"ŸJšJÐ':¸FÑCÔCÐØ—
’
˜7 AÑ&Ô&ˆà!Ð!Ø!Ø)Ø/Øð	
ñ 
ô 
ˆõ $ H°2¸jÐS\Ð^bÐRcÐdÑdÔdÐØ—J’J˜{Ð,=Ñ>Ô>ˆ	Ø�zŠz˜&Ñ!Ô!ˆØˆc�)˜TÑ"Ô"ˆà-˜o¸È5ÐQÑQÔQÐØ"7Ð"7À:ÐUZÐ"[Ñ"[Ô"[ÐàŸ
š
 ?Ñ3Ô3ˆØ×ÒØ!Ø 3Ø$;Ø'ð	 	ñ 	
ô 	
ð 	
õ %Ð%8Ñ9Ô9ˆØÐr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr   r   r   r   r   r   r   r    r"   rJ   r
   r   r   r   r      s!  € € € € € ð ð  ðD ðð ñ „Xðð ðð ñ „Xðð ðð ñ „Xðð
 ðð ñ „Xðð ðð ñ „Xðð ðð ñ „Xðð ðð ñ „Xðð ðð ñ „Xðð
 ðð ñ „Xðð*ð *ð *ð *ð *r   r   )	rN   Ú	functoolsr   rA   Úqiskit.convertersr   Ú)qiskit.transpiler.passes.synthesis.pluginr   r   r
   r   r   ú<module>rS      s�   ðð	ð 	ð Ð Ð Ð Ð Ð Ø €€€à ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø LÐ LÐ LÐ LÐ LÐ Lð|ð |ð |ð |ð |Ð/ñ |ô |ð |ð |ð |r   