0

I am implementing an Ising chain over 8 qubits. It involves pair-wise CNOT between all the qubits. In the first time step, I am doing CNOTs between qubits 0 and 1, 2 and 3, 4 and 5, and 6 and 7. In the second time step, I would do CNOTs between qubits 1 and 2, 3 and 4, and 5 and 6. I have written the code as follows:

# Block A for the first time step
qp.cx(q0,q1)
qp.cx(q2,q3)
qp.cx(q4,q5)
qp.cx(q6,q7)

Block B for the second time step

qp.cx(q1,q2) qp.cx(q3,q4) qp.cx(q5,q6)

I would like the gates in Block A to be applied simultaneously. Then, in the next step, gates in Block B should be applied simultaneously. How to convey to the compiler that I do not want the above written code to be compiled sequentially, rather I want it to be applied block-wise.

glS
  • 24,708
  • 5
  • 34
  • 108

1 Answers1

1

Did you try to put a barrier between your two blocks? You can do this by writing this qp.barrier() right after your first block, then Qiskit will transpile separately the two blocks. Is this what you were searching for?

Lena
  • 2,597
  • 5
  • 24