Program.gate(name, params, qubits)[source]

Add a gate to the program.


The matrix elements along each axis are ordered by bitstring. For two qubits the order is 00, 01, 10, 11, where the the bits are ordered in reverse by the qubit index, i.e., for qubits 0 and 1 the bitstring 01 indicates that qubit 0 is in the state 1. See also the related docs in the WavefunctionSimulator Overview.

  • name (str) – The name of the gate.
  • params (Iterable[Union[Expression, MemoryReference, int64, int, float, complex]]) – Parameters to send to the gate.
  • qubits (Iterable[Union[Qubit, QubitPlaceholder]]) – Qubits that the gate operates on.
Return type:



The Program instance