Skip to content

Commit

Permalink
[minor] adding imports for pulse
Browse files Browse the repository at this point in the history
  • Loading branch information
01110011011101010110010001101111 committed Nov 24, 2023
1 parent 83345b4 commit 1637680
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/optimal_control/optimal_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
dtype=torch.complex64,
)

pulse = tq.QuantumPulseDirect(n_steps=4, hamil=[[0, 1], [1, 0]])
pulse = tq.pulse.QuantumPulseDirect(n_steps=4, hamil=[[0, 1], [1, 0]])

optimizer = optim.Adam(params=pulse.parameters(), lr=5e-3)

Expand Down
2 changes: 1 addition & 1 deletion examples/optimal_control/optimal_control_gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
dtype=torch.complex64,
)

pulse = tq.QuantumPulseGaussian(hamil=[[0, 1], [1, 0]])
pulse = tq.pulse.QuantumPulseGaussian(hamil=[[0, 1], [1, 0]])

optimizer = optim.Adam(params=pulse.parameters(), lr=5e-3)

Expand Down
6 changes: 3 additions & 3 deletions examples/optimal_control/optimal_control_multi_qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
dtype=torch.complex64,
)

pulse_q0 = tq.QuantumPulseDirect(n_steps=10, hamil=[[0, 1], [1, 0]])
pulse_q1 = tq.QuantumPulseDirect(n_steps=10, hamil=[[0, 1], [1, 0]])
pulse_q01 = tq.QuantumPulseDirect(
pulse_q0 = tq.pulse.QuantumPulseDirect(n_steps=10, hamil=[[0, 1], [1, 0]])
pulse_q1 = tq.pulse.QuantumPulseDirect(n_steps=10, hamil=[[0, 1], [1, 0]])
pulse_q01 = tq.pulse.QuantumPulseDirect(
n_steps=10,
hamil=[
[1, 0, 0, 0],
Expand Down
1 change: 1 addition & 0 deletions torchquantum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from .noise_model import *
from .algorithm import *
from .dataset import *
from .pulse import *

# here we check whether the Qiskit parameterization bug is fixed, if not, a
# warning message will be printed
Expand Down
1 change: 1 addition & 0 deletions torchquantum/pulse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
from .utils import *
from .sesolve import sesolve
from .mesolve import mesolve
from .pulses import *
# from .smesolve import smesolve

0 comments on commit 1637680

Please sign in to comment.