FermionicGate

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

Unitary gates for fermionic circuits.

Create a new fermionic 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[FermionicOp]) – The generating Hamiltonian of the gate unitary given as a FermionicOp

Attributes

FermionicGate.condition_bits

Get Clbits in condition.

FermionicGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

FermionicGate.definition

Return definition in terms of other basic gates.

FermionicGate.duration

Get the duration.

FermionicGate.generator

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

FermionicGate.label

Return instruction label

FermionicGate.name

Return the name.

FermionicGate.num_clbits

Return the number of clbits.

FermionicGate.num_qubits

Return the number of qubits.

FermionicGate.params

return instruction params.

FermionicGate.unit

Get the time unit of duration.

Methods

FermionicGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

FermionicGate.assemble()

Assemble a QasmQobjInstruction

FermionicGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

FermionicGate.c_if(classical, val)

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

FermionicGate.control([num_ctrl_qubits, ...])

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

FermionicGate.copy([name])

Copy of the instruction.

FermionicGate.inverse()

Invert this instruction.

FermionicGate.is_parameterized()

Return True .IFF.

FermionicGate.operator_to_mat(generator, ...)

Compute the matrix representation of the fermion operator.

FermionicGate.power(exponent)

Creates a fermionic gate as gate^exponent

FermionicGate.qasm()

Return a default OpenQASM string for the instruction.

FermionicGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

FermionicGate.reverse_ops()

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

FermionicGate.soft_compare(other)

Soft comparison between gates.

FermionicGate.to_matrix([num_species, basis])

Return a Numpy.array for the gate unitary matrix.

FermionicGate.validate_parameter(parameter)

Gate parameters should be int, float, or ParameterExpression