SpinGate

class SpinGate(name, num_modes, params=None, label=None, generator=None)[source]

Unitary gates for spin circuits.

Create a new spin gate.

Parameters:
  • name (str) – The Qobj name of the gate.

  • num_modes (int) – The number of fermionic modes the gate acts on.

  • params (Optional[List]) – A list of parameters.

  • label (Optional[str]) – An optional label for the gate.

  • generator (Optional[SpinOp]) – The generating Hamiltonian of the gate unitary given as a SpinOp

Attributes

SpinGate.condition_bits

Get Clbits in condition.

SpinGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

SpinGate.definition

Return definition in terms of other basic gates.

SpinGate.duration

Get the duration.

SpinGate.generator

The Hamiltonian that generates the unitary of the gate, given as a SpinOp.

SpinGate.label

Return instruction label

SpinGate.name

Return the name.

SpinGate.num_clbits

Return the number of clbits.

SpinGate.num_qubits

Return the number of qubits.

SpinGate.params

return instruction params.

SpinGate.unit

Get the time unit of duration.

Methods

SpinGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

SpinGate.assemble()

Assemble a QasmQobjInstruction

SpinGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

SpinGate.c_if(classical, val)

Set a classical equality condition on this instruction between the register or cbit classical and value val.

SpinGate.control([num_ctrl_qubits, label, ...])

Overwrite control method which is supposed to return a controlled version of the gate.

SpinGate.copy([name])

Copy of the instruction.

SpinGate.inverse()

Invert this instruction.

SpinGate.is_parameterized()

Return True .IFF.

SpinGate.power(exponent)

Creates a spin gate as gate^exponent.

SpinGate.qasm()

Return a default OpenQASM string for the instruction.

SpinGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

SpinGate.reverse_ops()

For a composite instruction, reverse the order of sub-instructions.

SpinGate.soft_compare(other)

Soft comparison between gates.

SpinGate.to_matrix([spin])

Return a Numpy.array for the gate unitary matrix.

SpinGate.validate_parameter(parameter)

Gate parameters should be int, float, or ParameterExpression