qib.operator.ising_hamiltonian.IsingHamiltonian

class qib.operator.ising_hamiltonian.IsingHamiltonian(field: Field, J: float, h: float, g: float, convention: IsingConvention = IsingConvention.ISING_ZZ)[source]

Bases: AbstractOperator

Ising Hamiltonian “J Z Z + h Z + g X” or “J X X + h X + g Z” with
  • interaction parameter J

  • longitudinal field strength h

  • transverse field strength g

on a lattice.

Methods

as_matrix

Generate the (sparse) matrix representation of the Hamiltonian.

as_pauli_operator

Represent the Hamiltonian as Pauli operator.

fields

List of fields the Hamiltonian acts on.

is_hermitian

Whether the Hamiltonian is Hermitian.

is_unitary

Whether the Hamiltonian is unitary.

Attributes

nsites

Number of underlying lattice sites.

as_matrix()[source]

Generate the (sparse) matrix representation of the Hamiltonian.

as_pauli_operator()[source]

Represent the Hamiltonian as Pauli operator.

fields()[source]

List of fields the Hamiltonian acts on.

is_hermitian()[source]

Whether the Hamiltonian is Hermitian.

is_unitary()[source]

Whether the Hamiltonian is unitary.

property nsites: int

Number of underlying lattice sites.