@@ -1094,7 +1094,7 @@ def test_qiskit2tc():
10941094 import qiskit .quantum_info as qi
10951095 from qiskit import QuantumCircuit
10961096 from qiskit .circuit .library import HamiltonianGate
1097- from qiskit .circuit .library .standard_gates import MCXGate , SwapGate
1097+ from qiskit .circuit .library .standard_gates import MCXGate , SwapGate , CXGate
10981098
10991099 from tensorcircuit .translation import perm_matrix
11001100 except ImportError :
@@ -1150,12 +1150,13 @@ def test_qiskit2tc():
11501150 mcx_g = MCXGate (3 , ctrl_state = "010" )
11511151 qisc .append (mcx_g , [0 , 1 , 2 , 3 ])
11521152 qisc .ccx (0 , 1 , 2 , ctrl_state = "01" )
1153- CCCRX = SwapGate ().control (2 , ctrl_state = "01" )
1154- qisc .append (CCCRX , [0 , 1 , 2 , 3 ])
1153+ CCswap = SwapGate ().control (2 , ctrl_state = "01" )
1154+ qisc .append (CCswap , [0 , 1 , 2 , 3 ])
1155+ CCCX = CXGate ().control (2 , ctrl_state = "01" )
1156+ qisc .append (CCCX , [1 , 2 , 3 , 4 ])
11551157
1156- c = tc .Circuit .from_qiskit (qisc , n , np .eye (2 ** n ))
1157- tc_unitary = c .wavefunction ()
1158- tc_unitary = np .reshape (tc_unitary , [2 ** n , 2 ** n ])
1158+ c = tc .Circuit .from_qiskit (qisc , n )
1159+ tc_unitary = c .matrix ()
11591160 qis_unitary = qi .Operator (qisc )
11601161 qis_unitary = np .reshape (qis_unitary , [2 ** n , 2 ** n ])
11611162 p_mat = perm_matrix (n )
0 commit comments