§
    º³Ùg  ã                   ó>   — d Z ddlmZ ddlmZ  G d„ de¦  «        ZdS )zZExact synthesis of operator evolution via (exponentially expensive) matrix exponentiation.é    )ÚQuantumCircuité   )ÚEvolutionSynthesisc                   ó   — e Zd ZdZd„ ZdS )ÚMatrixExponentiala  Exact operator evolution via matrix exponentiation and unitary synthesis.

    This class synthesis the exponential of operators by calculating their exponentially-sized
    matrix representation and using exact matrix exponentiation followed by unitary synthesis
    to obtain a circuit. This process is not scalable and serves as comparison or benchmark
    for small systems.
    c                 ó6  — ddl m} |j        }|j        }t	          |t
          ¦  «        s|                     ¦   «         }nt          d„ |D ¦   «         ¦  «        }t          |d         j	        ¦  «        } |||¦  «        }| 
                    ||j        ¦  «         |S )Nr   )ÚHamiltonianGatec              3   ó>   K  — | ]}|                      ¦   «         V — Œd S )N)Ú	to_matrix)Ú.0Úops     úa/granary/edev/quantum/lib/python3.11/site-packages/qiskit/synthesis/evolution/matrix_synthesis.pyú	<genexpr>z/MatrixExponential.synthesize.<locals>.<genexpr>(   s*   è è € Ð<Ð<¨B˜Ÿš™œÐ<Ð<Ð<Ð<Ð<Ð<ó    )Ú'qiskit.circuit.library.hamiltonian_gater	   ÚoperatorÚtimeÚ
isinstanceÚlistr   Úsumr   Ú
num_qubitsÚappendÚqubits)ÚselfÚ	evolutionr	   Ú	operatorsr   ÚmatrixÚevolution_circuitÚgates           r   Ú
synthesizezMatrixExponential.synthesize   s®   € àKÐKÐKÐKÐKÐKð Ô&ˆ	ØŒ~ˆå˜)¥TÑ*Ô*ð 	=Ø×(Ò(Ñ*Ô*ˆFˆFåÐ<Ð<°)Ð<Ñ<Ô<Ñ<Ô<ˆFõ +¨9°Q¬<Ô+BÑCÔCÐØˆ˜v tÑ,Ô,ˆØ× Ò  Ð'8Ô'?Ñ@Ô@Ð@à Ð r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r    © r   r   r   r      s-   € € € € € ðð ð!ð !ð !ð !ð !r   r   N)r$   Úqiskit.circuit.quantumcircuitr   Úevolution_synthesisr   r   r%   r   r   ú<module>r(      sg   ðð aÐ `à 8Ð 8Ð 8Ð 8Ð 8Ð 8à 3Ð 3Ð 3Ð 3Ð 3Ð 3ð!ð !ð !ð !ð !Ð*ñ !ô !ð !ð !ð !r   