Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support exp gate for circuit drawer #106

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Conversation

Jacomichi
Copy link
Collaborator

Change

Support ParametricExpGate by plot_quantum_circuit.

Description

I have fixed plot_quantum_circuit since ParametricExpGate could not be displayed.

Sample

import qamomile.core.operator as qm_o
import qamomile.core.circuit as qm_c
from qamomile.core.circuit.drawer import plot_quantum_circuit

hamiltonian = qm_o.Hamiltonian()
hamiltonian += 5.0 * qm_o.X(0) * qm_o.Z(3) -4 * qm_o.Y(0) * qm_o.Y(1)
qc = qm_c.QuantumCircuit(5)
theta = qm_c.Parameter(r"\theta")
qc.exp_evolution(theta,hamiltonian)
hamiltonian = qm_o.Hamiltonian()
hamiltonian += -qm_o.X(2) * qm_o.Z(4) -  qm_o.Y(2) * qm_o.Y(4)
qc.exp_evolution(theta,hamiltonian)

plot_quantum_circuit(qc)

cd859128-cddb-4d09-900b-c9445067eb41

@yuyamashiro yuyamashiro merged commit 5cb575a into main Dec 2, 2024
6 checks passed
@yuyamashiro yuyamashiro deleted the feature/plot_exp_op branch December 2, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants