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

Update module path to qiskit_unitary_gate #188

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions torchquantum/plugin/qiskit/qiskit_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def append_fixed_gate(circ, func, params, wires, inverse):
circ.swap(*wires)
elif func == "sswap":
# square root of swap
from torchquantum.plugin.qiskit_unitary_gate import UnitaryGate
from torchquantum.plugin.qiskit.qiskit_unitary_gate import UnitaryGate

mat = mat_dict["sswap"].detach().cpu().numpy()
mat = switch_little_big_endian_matrix(mat)
Expand Down Expand Up @@ -308,7 +308,7 @@ def append_fixed_gate(circ, func, params, wires, inverse):
or func == "qubitunitaryfast"
or func == "qubitunitarystrict"
):
from torchquantum.plugin.qiskit_unitary_gate import UnitaryGate
from torchquantum.plugin.qiskit.qiskit_unitary_gate import UnitaryGate

mat = np.array(params)
mat = switch_little_big_endian_matrix(mat)
Expand Down Expand Up @@ -512,7 +512,7 @@ def tq2qiskit(
circ.swap(*module.wires)
elif module.name == "SSWAP":
# square root of swap
from torchquantum.plugin.qiskit_unitary_gate import UnitaryGate
from torchquantum.plugin.qiskit.qiskit_unitary_gate import UnitaryGate

mat = module.matrix.data.cpu().numpy()
mat = switch_little_big_endian_matrix(mat)
Expand Down Expand Up @@ -547,7 +547,7 @@ def tq2qiskit(
or module.name == "TrainableUnitary"
or module.name == "TrainableUnitaryStrict"
):
from torchquantum.plugin.qiskit_unitary_gate import UnitaryGate
from torchquantum.plugin.qiskit.qiskit_unitary_gate import UnitaryGate

mat = module.params[0].data.cpu().numpy()
mat = switch_little_big_endian_matrix(mat)
Expand Down
Loading