Circuit.append_gate

Circuit.append_gate(gate, location, params=[])[source]

Append the gate object to the circuit on the qudits in location.

Parameters:
  • gate (Gate) – The gate to append.

  • location (CircuitLocationLike) – Apply the gate to these qudits.

  • params (RealVector) – The gate’s parameters. (Default: all zeros)

Returns:

The cycle index of the appended gate.

Return type:

int

Examples

>>> from bqskit.ir.gates import HGate
>>> circ = Circuit(1)
>>> # Append a Hadamard gate to qudit 0.
>>> circ.append_gate(HGate(), 0)

See also

append()