
    z	i                     J    S r SSKJr  SSKrSSKJr  SSKJr   " S S\5      rg)a.  
==============================================================================
AQC Synthesis Plugin (in :mod:`qiskit.transpiler.passes.synthesis.aqc_plugin`)
==============================================================================

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

   AQCSynthesisPlugin
    )partialN)circuit_to_dag)UnitarySynthesisPluginc                       \ rS rSrSr\S 5       r\S 5       r\S 5       r\S 5       r	\S 5       r
\S 5       r\S	 5       r\S
 5       r\S 5       rS rSrg)AQCSynthesisPlugin   ar  
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                     g)z-Maximum number of supported qubits is ``14``.    selfs    g/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/transpiler/passes/synthesis/aqc_plugin.py
max_qubitsAQCSynthesisPlugin.max_qubits@   s         c                     g)z,Minimum number of supported qubits is ``3``.   r   r   s    r   
min_qubitsAQCSynthesisPlugin.min_qubitsE   s     r   c                     g)zXThe plugin does not support natural direction,
it assumes bidirectional two qubit gates.Fr   r   s    r   supports_natural_direction-AQCSynthesisPlugin.supports_natural_directionJ        r   c                     g)z3The plugin does not support optimization of pulses.Fr   r   s    r   supports_pulse_optimize*AQCSynthesisPlugin.supports_pulse_optimizeP        r   c                     g)z)The plugin does not support gate lengths.Fr   r   s    r   supports_gate_lengths(AQCSynthesisPlugin.supports_gate_lengthsU   r   r   c                     g)z(The plugin does not support gate errors.Fr   r   s    r   supports_gate_errors'AQCSynthesisPlugin.supports_gate_errorsZ   r   r   c                     g)z0The plugin does not support bases for synthesis.Nr   r   s    r   supported_bases"AQCSynthesisPlugin.supported_bases_   s     r   c                     g)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_gates'AQCSynthesisPlugin.supports_basis_gatesd   r   r   c                     g)z*The plugin does not support coupling maps.Fr   r   s    r   supports_coupling_map(AQCSynthesisPlugin.supports_coupling_mapj   r   r   c                 4   SSK Jn  SSKJn  SSKJn  SSKJn  SSKJ	n  [        [        R                  " UR                  S   5      5      nUR                  S5      =(       d    0 n	U	R                  SS	5      n
U	R                  S
S5      nU	R                  SS5      nU" UU
UUS9n[        USSSS0S9nU	R                  SU5      nU	R                  S5      nU" UU5      nU" XS9nU" XS9nU	R                  S5      nUR!                  UUUUS9  [#        U5      nU$ )Nr   )minimize)AQC)make_cnot_network)CNOTUnitCircuit)FastCNOTUnitObjectiveconfignetwork_layoutspinconnectivity_typefulldepth)
num_qubitsr4   r6   r8   r   zL-BFGS-Bmaxiteri  )argsmethodoptions	optimizerseed)r9   cnotsinitial_point)target_matrixapproximate_circuitapproximating_objectiverA   )scipy.optimizer.   qiskit.synthesis.unitary.aqcr/   ,qiskit.synthesis.unitary.aqc.cnot_structuresr0   .qiskit.synthesis.unitary.aqc.cnot_unit_circuitr1   8qiskit.synthesis.unitary.aqc.fast_gradient.fast_gradientr2   roundmathlog2shapegetr   compile_unitaryr   )r   unitaryr=   r.   r/   r0   r1   r2   r9   r3   r4   r6   r8   r@   default_optimizerr>   r?   aqcrC   rD   rA   dag_circuits                         r   runAQCSynthesisPlugin.runo   s&    	,4RRb499W]]1%567
X&,"$4f="JJ':FC

7A&!!)/	
 $H2jS\^bRcdJJ{,=>	zz&!)T"-Q"7:"[

?3! 3$;'	 	 	
 %%89r   r   N)__name__
__module____qualname____firstlineno____doc__propertyr   r   r   r   r   r"   r%   r(   r+   rT   __static_attributes__r   r   r   r   r      s     D      
          
  *r   r   )	rZ   	functoolsr   rK   qiskit.convertersr   )qiskit.transpiler.passes.synthesis.pluginr   r   r   r   r   <module>r`      s'   	   , L|/ |r   