quairkit.database.hamiltonian

The library of common Hamiltonians.

quairkit.database.hamiltonian.ising_hamiltonian(edges, vertices)

Compute the Ising Hamiltonian

\[\begin{align} H_{Ising}= \sum_{(u,v) \in E(u>v)}\gamma_{uv}Z_u Z_v + \sum_{k \in V}\beta_k X_k \end{align}\]
Parameters:
edges : Tensor

A tensor E shape=[V, V], where E[u][v] is gamma_{uv}.

vertices : Tensor

A tensor E shape=[V], where V[k] is beta_{k}.

Returns:

H_{Ising}

Return type:

Hamiltonian

quairkit.database.hamiltonian.xy_hamiltonian(edges)

Compute the Ising Hamiltonian

\[\begin{align} H_{XY}= \sum_{(u,v) \in E(u>v)}(\alpha_{uv}X_u X_v + \beta_{uv}Y_u Y_v) \end{align}\]
Parameters:
edges : Tensor

A tensor E shape=[2, V, V], where E[0][u][v] is alpha_{uv} and E[1][u][v] is beta_{uv}.

Returns:

H_{XY}

Return type:

Hamiltonian

quairkit.database.hamiltonian.heisenberg_hamiltonian(edges)

Compute the Heisenberg Hamiltonian

\[\begin{align} H_{Heisenberg}= \sum_{(u,v) \in E(u>v)}(\alpha_{uv}X_u X_v + \beta_{uv}Y_u Y_v, + \gamma_{uv}Z_u Z_v) \end{align}\]
Parameters:
edges : Tensor

A tensor E shape=[3, V, V], where E[0][u][v] is alpha_{uv}, E[1][u][v] is beta_{uv} and E[2][u][v] is gamma_{uv}.

Returns:

H_{Heisenberg}

Return type:

Hamiltonian