forked from mit-han-lab/torchquantum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbd229b
commit 17a2a85
Showing
4 changed files
with
150 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from torchquantum.plugins import qiskit2tq_op_history | ||
import torchquantum as tq | ||
from qiskit.circuit.random import random_circuit | ||
from qiskit import QuantumCircuit | ||
|
||
|
||
def test_qiskit2tp_op_history(): | ||
circ = QuantumCircuit(3, 3) | ||
circ.h(0) | ||
circ.rx(0.1, 1) | ||
circ.cx(0, 1) | ||
circ.cx(1, 2) | ||
circ.u(0.1, 0.2, 0.3, 0) | ||
print(circ) | ||
ops = qiskit2tq_op_history(circ) | ||
qmodule = tq.QuantumModule.from_op_history(ops) | ||
print(qmodule.Operator_list) | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
import pdb | ||
pdb.set_trace() | ||
test_qiskit2tp_op_history() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters