2

I want to reset a single qubit that is part of a larger register. Is this possible in pytket?

Resetting the single qubit

qc.add_gate(OpType.Reset,q_register[0])

throws

TypeError: add_gate(): incompatible function arguments. The following argument types are supported:

Resetting the whole register

qc.add_gate(OpType.Reset,q_register)

results in

RuntimeError: 30 args provided, but Reset requires 1

Maybe I just have the syntax wrong.

Egretta.Thula
  • 11,986
  • 1
  • 13
  • 34
Qnerd
  • 23
  • 2

1 Answers1

1

Great question, it turns out that add_gate takes a list of unit ids

pytket add_gate

Hence try:

qc.add_gate(OpType.Reset,[q_register[0]])
KSp
  • 106
  • 3