diff --git a/examples/ed_basic_tutorial.ipynb b/examples/ed_basic_tutorial.ipynb new file mode 100644 index 00000000..25997417 --- /dev/null +++ b/examples/ed_basic_tutorial.ipynb @@ -0,0 +1,689 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d950a45b-ca37-4a80-a4f8-d38bfbd155dc", + "metadata": {}, + "source": [ + "# Exact Diagonalization using XDiag and Julia\n", + "\n", + "> **Alexander Wietek**\n", + ">\n", + "> Max Planck Institute for the Physics of Complex Systems, Dresden\n", + ">\n", + "> https://awietek.github.io/xdiag/\n", + ">\n", + "> https://www.pks.mpg.de/smc" + ] + }, + { + "cell_type": "markdown", + "id": "599981b2-1b30-42e9-8ee5-a420392e520f", + "metadata": {}, + "source": [ + "## Creating Hilbert spaces\n", + "First we load the XDiag package for Exact Diagonalization" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6abe2397-7a68-4569-bab0-54cffe95819f", + "metadata": {}, + "outputs": [], + "source": [ + "using XDiag" + ] + }, + { + "cell_type": "markdown", + "id": "b440fba6-c842-4f56-b22b-a99216f28798", + "metadata": {}, + "source": [ + "Let us start with a single spin $S=1/2$ particle and create its Hilbert space, and print out the configurations." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d4c4ebdb-79a6-49ee-9c01-b993e451a046", + "metadata": {}, + "outputs": [], + "source": [ + "hspace = Spinhalf(1)\n", + "for s in hspace\n", + " print(s)\n", + "end" + ] + }, + { + "cell_type": "markdown", + "id": "7675f8f3-2069-4d22-917d-fc6708aad5c4", + "metadata": {}, + "source": [ + "We can so the same for 2-particles, " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3322dbd6-6fca-48bc-b8d7-38a422821a89", + "metadata": {}, + "outputs": [], + "source": [ + "hspace = Spinhalf(2)\n", + "for s in hspace\n", + " print(s)\n", + "end" + ] + }, + { + "cell_type": "markdown", + "id": "f6763dc8-4d0c-47df-9938-6e8174455731", + "metadata": {}, + "source": [ + "3-particles, and so on." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9c43e8d2-6fda-4cbc-8782-6bba873f0fdd", + "metadata": {}, + "outputs": [], + "source": [ + "hspace = Spinhalf(3)\n", + "for s in hspace\n", + " print(s)\n", + "end" + ] + }, + { + "cell_type": "markdown", + "id": "d19d569e-5852-4571-97b6-4aaec8cd1b45", + "metadata": {}, + "source": [ + "## Defining operators\n", + "\n", + "We define our first operator acting on two spin one-half particles. We define the Heisenberg (\"HB\") interaction given by\n", + "\n", + "$$ \\mathbf{S}_i\\cdot \\mathbf{S}_j = S^x_i S^x_j + S^y_i S^y_j + S^z_i S^z_j$$\n", + "\n", + "where the spin matrices $S^\\alpha$ are given by\n", + "\n", + "$$ S^x = \\frac{1}{2} \\begin{pmatrix} 0 & 1 \\\\ 1 & 0 \\end{pmatrix} \\quad\n", + "S^y = \\frac{1}{2} \\begin{pmatrix} 0 & -i \\\\ i & 0 \\end{pmatrix} \\quad\n", + "S^z = \\frac{1}{2} \\begin{pmatrix} 1 & 0 \\\\ 0 & 1 \\end{pmatrix}\n", + "$$\n", + "\n", + "To do so, we create an \"OpSum\" object, which encodes the sum of local operators, and add an \"Op\" object to it describing the Heisenberg interaction." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6552c934-d419-4fab-a066-b568e23775e9", + "metadata": {}, + "outputs": [], + "source": [ + "ops = OpSum()\n", + "ops += Op(\"HB\", 1.0, [1, 2])\n", + "hspace = Spinhalf(2)\n", + "H = matrix(ops, hspace)" + ] + }, + { + "cell_type": "markdown", + "id": "4af53f66-eb27-4afa-9351-7640dd30014e", + "metadata": {}, + "source": [ + "For the \"Op\" object the first argument defines the type of the interaction, in this case the Heisenberg interaction \"HB\". The second arguments sets the prefactor, in this case just 1.0. The third argument is a list of the sites this operator is acting on. Now we are interested in the eigenvalues and eigenvectors of this interaction." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "82945cbf-5fb5-4441-994e-58715fb48640", + "metadata": {}, + "outputs": [], + "source": [ + "using LinearAlgebra\n", + "eigen(H)" + ] + }, + { + "cell_type": "markdown", + "id": "3e5f1904-8154-4e5a-a68f-56ddc37d4e07", + "metadata": {}, + "source": [ + "We see there is one eigenvalue $\\varepsilon_1 = -3/4$ and three degenerate eigenvalues $\\varepsilon_{2,3,4} = 1/4$. The corresponding eigenvectors are:\n", + "\n", + "$$\n", + "\\begin{align}\n", + "| \\psi_1 \\rangle &= \\frac{1}{\\sqrt{2}}(|\\uparrow\\downarrow\\rangle - |\\downarrow\\uparrow\\rangle) \\\\\n", + "| \\psi_2 \\rangle &= |\\downarrow\\downarrow\\rangle \\\\\n", + "| \\psi_3 \\rangle &= \\frac{1}{\\sqrt{2}}(|\\uparrow\\downarrow\\rangle + |\\downarrow\\uparrow\\rangle) \\\\\n", + "| \\psi_4 \\rangle &= |\\uparrow\\uparrow\\rangle \n", + "\\end{align}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "id": "c24ded1f-4fca-4bac-8412-0ca802334be6", + "metadata": {}, + "source": [ + "So we see the ground state is the singlet state with total spin $S=0$ and the excited states are the triplet states with $S=1$." + ] + }, + { + "cell_type": "markdown", + "id": "32903f10-5faa-4c5b-9b94-bcfa1156306a", + "metadata": {}, + "source": [ + "### Exersise 1:\n", + "\n", + "Create a Hilbert space on three sites denoting the edges 1,2, and 3 of a triangle. Then consider the Heisenberg model on this triangle, i.e. Heisenberg interactions between the site pairs [1, 2], [2, 3], and [3, 1]. Compute the eigenvalues and eigenvectors, to find out what is the degeneracy and total spin of the ground state and the excited states. Can all degeneracies be explained by spin rotation $SU(2)$ symmetry?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6de7ba93-033b-4ac4-bc36-f3b110721ed2", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "b0fbbd53-61a8-4bfa-a7bb-540ded87388a", + "metadata": {}, + "source": [ + "#### Solution" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "10a3aed0-74e8-488f-be3c-45253a5f9881", + "metadata": { + "jupyter": { + "source_hidden": true + } + }, + "outputs": [], + "source": [ + "hspace = Spinhalf(3)\n", + "ops = OpSum()\n", + "ops += Op(\"HB\", 1.0, [1, 2])\n", + "ops += Op(\"HB\", 1.0, [2, 3])\n", + "ops += Op(\"HB\", 1.0, [3, 1])\n", + "H = matrix(ops, hspace)\n", + "eigen(H)" + ] + }, + { + "cell_type": "markdown", + "id": "8f08ac6b-8435-44cd-80fa-cd0a2aef205f", + "metadata": {}, + "source": [ + "## $S^z$ conservation\n", + "\n", + "The Heisenberg interaction conserved the total $S^z$. Thus, our Hilbert space decomposes into blocks which are not coupled by one another, where configurations have a fixed value of the total $S^z$. We can create these blocks and express the H" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cc3a1bda-ffaf-4a8f-8d9f-7439a1288957", + "metadata": {}, + "outputs": [], + "source": [ + "ops = OpSum()\n", + "ops += Op(\"HB\", 1.0, [1, 2])\n", + "ops += Op(\"HB\", 1.0, [2, 3])\n", + "ops += Op(\"HB\", 1.0, [3, 1])\n", + "for nup in 0:3\n", + " block = Spinhalf(3, nup)\n", + " H = matrix(ops, block)\n", + " display(H)\n", + "end" + ] + }, + { + "cell_type": "markdown", + "id": "75ed8126-36c9-491f-b425-127de9c8c84a", + "metadata": {}, + "source": [ + "## Translational symmetry\n", + "\n", + "Let us refer to the Hamiltonian,\n", + "\n", + "$$ H = \\sum_{i=1}^N \\mathbf{S}_i\\cdot \\mathbf{S}_{(i+1) \\textrm{ mod } N} $$\n", + "\n", + "to the $N$-site Heisenberg chain with periodic boundary conditions. Hamiltonians can be invariant under translation symmetries. In the example with the three-site Heisenberg model, the Hamiltonian is invariant under exchanging the sites $1 \\rightarrow 2 \\rightarrow 3 \\rightarrow 1$. More formally, we can define a translation operator by\n", + "\n", + "$$ T: |\\sigma_1 \\sigma_2 \\cdots \\sigma_{N-1} \\sigma_N \\rangle \\rightarrow |\\sigma_N \\sigma_1 \\cdots \\sigma_{N-2} \\sigma_{N-1} \\rangle$$ \n", + "\n", + "A symmetry $S$ of a Hamiltonian $H$ is an operator which commutes with $H$, i.e.\n", + "\n", + "$$ [H, S] \\equiv H S - S H = 0$$\n", + "\n", + "For a cyclic Hamiltonian, one can easily check that $T$ commutes with $H$. If $S$ and $T$ commute with a Hamiltonian, so does $ST$,\n", + "\n", + "$$ HST = SHT = STH \\Rightarrow [H, ST] = 0$$\n", + "\n", + "Similarly, one can also see that the inverse of $S$ needs to be yet another symmetry. Hence, the set of symmetries forms a mathematical group, the symmetry group. A key concept in quantum mechanics is that every symmetry group divides the Hilbert space into **blocks** which can be labeled by a so-called **quantum number** $\\rho$. Quantum numbers refer to the eigenvalues of the symmetry operator. Assume we have a state $|\\psi\\rangle$ which fulfills\n", + "\n", + "$$ S |\\psi_\\rho\\rangle = \\rho |\\psi_\\rho\\rangle $$\n", + "\n", + "Then, also $H |\\psi_\\rho\\rangle$ is an eigenstate of $S$ with eigenvector $\\rho$ due to, \n", + "\n", + "$$ S (H |\\psi_\\rho\\rangle) = H S|\\psi_\\rho\\rangle = \\rho (H|\\psi_\\rho\\rangle).$$\n", + "\n", + "Now explicitly for an $N$-site Heisenberg chain, given a spin configuration $|\\sigma_1 \\sigma_2 \\cdots \\sigma_{N-1} \\sigma_N \\rangle$ we can consider the so-called **symmetry-adapted state**,\n", + "\n", + "$$ P_\\rho |\\sigma_1 \\sigma_2 \\cdots \\sigma_{N-1} \\sigma_N \\rangle= \\sum_{n=0}^{N-1} e^{i k n} T^n |\\sigma_1 \\sigma_2 \\cdots \\sigma_{N-1} \\sigma_N \\rangle. $$\n", + "\n", + "We have,\n", + "\n", + "$$ T P_\\rho |\\sigma_1 \\sigma_2 \\cdots \\sigma_{N-1} \\sigma_N \\rangle = e^{-i k} P_\\rho |\\sigma_1 \\sigma_2 \\cdots \\sigma_{N-1}\\rangle$$\n", + "\n", + "and, hence, $P_\\rho |\\sigma_1 \\sigma_2 \\cdots \\sigma_{N-1} \\sigma_N \\rangle$ is an eigenstate of $T$. Since $T^n = \\textrm{Id}$, the values of $k$ need to satisfy $k = 2\\pi l / n$, where $l$ is an integer. The Hamiltonian can now be expressed in the basis of these symmetry adapted states, where it then decomposes into blocks labeled by there quantum number, in this case the **(quasi-)momentum**. More generically, the numbers $\\chi(n) = e^{i k n}$ can have different forms for different symmetry groups and are refered to as an (one-dimensional) **irreducible representation (irrep)** of the symmetry group." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a22460a9-0bd1-4bf0-8d68-f615728a3ffa", + "metadata": {}, + "outputs": [], + "source": [ + "N = 4\n", + "nup = 2\n", + "ops = OpSum()\n", + "for i in 1:N\n", + " ops += Op(\"HB\", 1.0, [i, mod1(i+1, N)])\n", + "end\n", + "\n", + "id = Permutation([1, 2, 3, 4])\n", + "T = Permutation([2, 3, 4, 1])\n", + "group = PermutationGroup([id, T, T*T, T*T*T])\n", + "\n", + "# 0-momentum irrep\n", + "irrep = Representation([1, 1, 1, 1])\n", + "block = Spinhalf(N, nup, group, irrep)\n", + "for s in block\n", + " print(s)\n", + "end\n", + "println()\n", + "\n", + "H = matrix(ops, block)\n", + "println(\"0 momentum\")\n", + "display(H)\n", + "display(eigvals(H))\n", + "\n", + "# pi/2-momentum irrep\n", + "irrep = Representation([1, 1im, -1, -1im])\n", + "block = Spinhalf(N, nup, group, irrep)\n", + "H = matrix(ops, block)\n", + "println(\"pi/2 momentum\")\n", + "display(H)\n", + "display(eigvals(Hermitian(H)))\n", + "\n", + "# pi-momentum irrep\n", + "irrep = Representation([1, -1, 1, -1])\n", + "block = Spinhalf(N, nup, group, irrep)\n", + "H = matrix(ops, block)\n", + "println(\"pi momentum\")\n", + "display(H)\n", + "display(eigvals(H))" + ] + }, + { + "cell_type": "markdown", + "id": "b4e1eec5-414f-45a2-918b-3c2a990d3083", + "metadata": {}, + "source": [ + "### Exersize 2\n", + "\n", + "Compute the full spectrum of the four-site Heisenberg chain, both with and without momentum conservation. Check whether the results from both computations agree." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cce4d3d8-b3fc-4ced-b46f-8657e10c550b", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "0d87ea96-4401-40ac-8221-a9dd10d1828e", + "metadata": {}, + "source": [ + "#### Solution" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c9f5af4b-d68a-4c4e-bb9e-b218592a03f4", + "metadata": { + "jupyter": { + "source_hidden": true + } + }, + "outputs": [], + "source": [ + "N = 4\n", + "ops = OpSum()\n", + "for i in 1:N\n", + " ops += Op(\"HB\", 1.0, [i, mod1(i+1, N)])\n", + "end\n", + "block = Spinhalf(N)\n", + "H = matrix(ops, block)\n", + "eigs = eigvals(Symmetric(H))\n", + "\n", + "id = Permutation([1, 2, 3, 4])\n", + "T = Permutation([2, 3, 4, 1])\n", + "group = PermutationGroup([id, T, T*T, T*T*T])\n", + "\n", + "ir1 = Representation([1, 1, 1, 1]) \n", + "ir2 = Representation([1, -1, 1, -1]) \n", + "ir3 = Representation([1, im, -1, -im]) \n", + "ir4 = Representation([1, -im, -1, im]) \n", + "\n", + "eigs_sym = []\n", + "for nup in 0:N\n", + " for irrep in [ir1, ir2, ir3, ir4]\n", + " block = Spinhalf(N, nup, group, irrep)\n", + " H = matrix(ops, block)\n", + " append!(eigs_sym, eigvals(Hermitian(H)))\n", + " end\n", + "end\n", + "sort!(eigs_sym)\n", + "display(eigs)\n", + "display(eigs_sym)\n", + "@show isapprox(eigs, eigs_sym)" + ] + }, + { + "cell_type": "markdown", + "id": "6b113f1b-92ec-477f-8927-2d11cb00fd30", + "metadata": {}, + "source": [ + "## Sparse Diagonalization and Algebra\n", + "\n", + "Instead of dealing with the full matrix of a Hamiltonian, XDiag implements iterative algorithms such as the [Lanczos algorithm](https://en.wikipedia.org/wiki/Lanczos_algorithm). It can be used to perform ED on larger system sizes. Moreover, there are several functions to apply operators and create zero or random states." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "192a620f-1d34-43e9-8710-c0e3b8cddfb0", + "metadata": {}, + "outputs": [], + "source": [ + "N = 10\n", + "ops = OpSum()\n", + "for i in 1:N\n", + " ops += Op(\"HB\", 1.0, [i, mod1(i+1, N)])\n", + "end\n", + "block = Spinhalf(N)\n", + "H = matrix(ops, block)\n", + "eigs = eigvals(Symmetric(H))\n", + "\n", + "e0, gs = eig0(ops, block)\n", + "\n", + "Hgs = zeros(block)\n", + "apply(ops, gs, Hgs)\n", + "@show e0, eigs[1]\n", + "@show norm(gs)\n", + "@show dot(gs, Hgs)\n", + "@show inner(ops, gs)\n", + "\n", + "rstate = rand(block)\n", + "@show inner(ops, rstate)" + ] + }, + { + "cell_type": "markdown", + "id": "d36e8a16-1e0a-45bd-b332-4f9d0636873c", + "metadata": {}, + "source": [ + "### Exercise 3\n", + "\n", + "Implement the Lanczos algorithm using the functions **rand**, and **apply** above to compute the ground state energy of a 10-site Heisenberg chain. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "74512b99-10d3-4653-a6b7-a797be483f83", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "d34c661c-23de-42bd-a333-6ec7b8bd0ed0", + "metadata": {}, + "source": [ + "#### Solution" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4c4a5e25-e9bf-4d26-80cb-f1325eae9c4e", + "metadata": { + "jupyter": { + "source_hidden": true + } + }, + "outputs": [], + "source": [ + "N = 10\n", + "ops = OpSum()\n", + "for i in 1:N\n", + " ops += Op(\"HB\", 1.0, [i, mod1(i+1, N)])\n", + "end\n", + "block = Spinhalf(N)\n", + " \n", + "function lanczos(ops, block; precision=1e-12, max_iterations=1000)\n", + " \n", + " alphas = Float64[]\n", + " betas = Float64[]\n", + "\n", + " v1 = rand(block; normalized=true)\n", + " v0 = zeros(block)\n", + " w = zeros(block)\n", + "\n", + " alpha = 0.0\n", + " beta = 0.0\n", + " \n", + " prev_energy = 0\n", + " for iteration in 1:max_iterations\n", + "\n", + " # Perform basic Lanczos iteration step\n", + " apply(ops, v1, w)\n", + " alpha = dot(v1, w)\n", + " w = w - alpha * v1 - beta * v0\n", + " v0 = v1\n", + "\n", + " beta = norm(w)\n", + " v1 = w / beta\n", + "\n", + " push!(alphas, alpha)\n", + "\n", + " # Build up T-matrix\n", + " t_matrix = diagm(0 => alphas, 1 => betas, -1 => betas)\n", + " t_eigs = eigvals(Symmetric(t_matrix))\n", + "\n", + " push!(betas, beta)\n", + " @show iteration, t_eigs[1]\n", + "\n", + " # Return if converged\n", + " if isapprox(t_eigs[1], prev_energy; rtol=precision)\n", + " println(\"Lanczos converged in $iteration steps\")\n", + " return t_eigs, alphas, betas\n", + " end\n", + " prev_energy = t_eigs[1]\n", + " end \n", + "end\n", + "\n", + "t_eigs, alphas, betas = lanczos(ops, block)\n", + "@show t_eigs[1]\n", + "@show eigval0(ops, block)" + ] + }, + { + "cell_type": "markdown", + "id": "5312c463-2445-4804-8115-bb4b72247607", + "metadata": {}, + "source": [ + "## Convergence of the Lanczos algorithm" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "199b93ae-83ab-4938-828e-43cae4bdcbd1", + "metadata": {}, + "outputs": [], + "source": [ + "using CairoMakie\n", + "f = Figure()\n", + "ax = Axis(f[1, 1])\n", + "niter = length(alphas)\n", + "for iter in 1:niter\n", + " t_matrix = diagm(0 => alphas[1:iter], 1 => betas[1:iter-1], -1 => betas[1:iter-1])\n", + " t_eigs = eigvals(Symmetric(t_matrix))\n", + " scatter!(ax, iter*ones(size(t_eigs)), t_eigs)\n", + "end\n", + "ax.xlabel = \"iteration\"\n", + "ax.ylabel = \"eigenvalue\"\n", + "display(f)" + ] + }, + { + "cell_type": "markdown", + "id": "8c3d8ca0-b5b6-4cf3-977b-6128781b0c00", + "metadata": {}, + "source": [ + "## Ground state correlations of triangular lattice Heisenberg model" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6d146bde-f1d4-4d62-ad69-39304655f4ea", + "metadata": {}, + "outputs": [], + "source": [ + "using TOML\n", + "N = 12\n", + "latfile = TOML.parsefile(\"triangular.$N.J1J2.toml\")\n", + " \n", + "coords = latfile[\"Coordinates\"]\n", + "interactions = latfile[\"Interactions\"]\n", + "ops = OpSum()\n", + "for interaction in interactions\n", + " type = interaction[1]\n", + " couplingname = interaction[2]\n", + " s1 = interaction[3] + 1\n", + " s2 = interaction[4] + 1\n", + " ops += Op(type, couplingname, [s1, s2])\n", + "end\n", + "ops[\"J1\"] = 1.0\n", + "ops[\"J2\"] = 0.0\n", + "\n", + "block = Spinhalf(N, N÷2)\n", + "e0, gs = eig0(ops, block)\n", + "@show e0\n", + " \n", + "for i in 2:N\n", + " s1si = Op(\"HB\", 1.0, [1, i])\n", + " corr = inner(s1si, gs)\n", + " println(\"$i $corr\")\n", + "end" + ] + }, + { + "cell_type": "markdown", + "id": "cf01a86c-4bb4-4b74-bbf3-f3a9cd251daa", + "metadata": {}, + "source": [ + "### Exercise 4\n", + "\n", + "Plot the correlation function on the triangular lattice defined by its coordinates, as read in from the text file above. What kind of magnetic order does the ground state have?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "01f28fef-1626-41cd-acc0-885519895e31", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "0df7afee-d77b-4e99-947d-c54443ea34a5", + "metadata": {}, + "source": [ + "## Ground state correlations of triangular lattice Heisenberg model (with translational symmetries)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4b50dda6-e018-4f47-b2bf-87377d70c988", + "metadata": {}, + "outputs": [], + "source": [ + " permutation_vecs = latfile[\"Symmetries\"]\n", + " permutations = Permutation[]\n", + " for permutation_vec in permutation_vecs\n", + " push!(permutations, Permutation(permutation_vec .+ 1))\n", + " end\n", + " group = PermutationGroup(permutations)\n", + " irrep = Representation(ones(size(group)))\n", + " block = Spinhalf(N, N÷2, group, irrep)\n", + " e0, gs = eig0(ops, block)\n", + " @show e0\n", + "\n", + " for i in 2:N\n", + " s1si = symmetrize(Op(\"HB\", 1.0, [1, i]), group)\n", + " corr = inner(s1si, gs)\n", + " println(\"$i $corr\")\n", + " end" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "09dbfc5d-c31a-4c5a-93bc-df7494f14af8", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Julia 1.10.5", + "language": "julia", + "name": "julia-1.10" + }, + "language_info": { + "file_extension": ".jl", + "mimetype": "application/julia", + "name": "julia", + "version": "1.10.5" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/examples/triangular.12.J1J2.toml b/examples/triangular.12.J1J2.toml new file mode 100644 index 00000000..d8415f00 --- /dev/null +++ b/examples/triangular.12.J1J2.toml @@ -0,0 +1,1493 @@ +# This modelfile was created with the following properties: +# Basis coordinates: (0.0, 0.0) +# Lattice vectors: a1=(1.0, 0.0), a2=(0.5, 0.8660254037844386) +# Simulation torus vectors: t1=(3.0, 1.7320508075688772), t2=(0.0, -3.4641016151377544) +# Simulation torus matrix: ((2, 2), (2, -4)) +# Symmetry center: (0.0, 0.0) +# Lattice Point Group: D6 +# Lattice Space Group (infinite Lattice): D6 +# K points (K wedge marked with *): +# [4.1887902047863905 0.0] * +# [3.141592653589793 1.8137993642342178] * +# [3.141592653589793 -1.8137993642342178] +# [2.0943951023931953 3.6275987284684357] +# [2.0943951023931953 0.0] * +# [1.0471975511965976 1.8137993642342178] +# [1.0471975511965976 -1.8137993642342178] +# [0.0 3.6275987284684357] +# [0.0 0.0] * +# [-1.0471975511965976 1.8137993642342178] +# [-1.0471975511965976 -1.8137993642342178] +# [-2.0943951023931953 0.0] +# High Symmetry Points: K.D3, M.D2, X.D1, Gamma.D6, +# Eccentricity: -- + +Coordinates = [ + [0.0, 0.0], + [0.0, -1.7320508075688772], + [0.5, -0.8660254037844386], + [1.0, 0.0], + [1.5, 0.8660254037844386], + [0.5, -2.598076211353316], + [1.0, -1.7320508075688772], + [1.5, -0.8660254037844386], + [2.0, 0.0], + [2.5, 0.8660254037844386], + [2.0, -1.7320508075688772], + [2.5, -0.8660254037844386] +] + +Interactions = [ + ['HB', 'J1', 0, 5], + ['HB', 'J1', 3, 4], + ['HB', 'J1', 4, 10], + ['HB', 'J1', 1, 2], + ['HB', 'J1', 2, 3], + ['HB', 'J1', 8, 9], + ['HB', 'J1', 9, 0], + ['HB', 'J1', 5, 6], + ['HB', 'J1', 6, 7], + ['HB', 'J1', 7, 8], + ['HB', 'J1', 10, 11], + ['HB', 'J1', 11, 1], + ['HB', 'J1', 0, 3], + ['HB', 'J1', 3, 8], + ['HB', 'J1', 4, 9], + ['HB', 'J1', 1, 6], + ['HB', 'J1', 2, 7], + ['HB', 'J1', 8, 1], + ['HB', 'J1', 9, 2], + ['HB', 'J1', 5, 4], + ['HB', 'J1', 6, 10], + ['HB', 'J1', 7, 11], + ['HB', 'J1', 10, 0], + ['HB', 'J1', 11, 5], + ['HB', 'J1', 0, 2], + ['HB', 'J1', 3, 7], + ['HB', 'J1', 4, 8], + ['HB', 'J1', 1, 5], + ['HB', 'J1', 2, 6], + ['HB', 'J1', 8, 11], + ['HB', 'J1', 9, 1], + ['HB', 'J1', 5, 3], + ['HB', 'J1', 6, 4], + ['HB', 'J1', 7, 10], + ['HB', 'J1', 10, 9], + ['HB', 'J1', 11, 0], + ['HB', 'J2', 0, 4], + ['HB', 'J2', 3, 9], + ['HB', 'J2', 4, 0], + ['HB', 'J2', 1, 7], + ['HB', 'J2', 2, 8], + ['HB', 'J2', 8, 2], + ['HB', 'J2', 9, 3], + ['HB', 'J2', 5, 10], + ['HB', 'J2', 6, 11], + ['HB', 'J2', 7, 1], + ['HB', 'J2', 10, 5], + ['HB', 'J2', 11, 6], + ['HB', 'J2', 0, 1], + ['HB', 'J2', 3, 6], + ['HB', 'J2', 4, 7], + ['HB', 'J2', 1, 0], + ['HB', 'J2', 2, 5], + ['HB', 'J2', 8, 10], + ['HB', 'J2', 9, 11], + ['HB', 'J2', 5, 2], + ['HB', 'J2', 6, 3], + ['HB', 'J2', 7, 4], + ['HB', 'J2', 10, 8], + ['HB', 'J2', 11, 9], + ['HB', 'J2', 0, 7], + ['HB', 'J2', 3, 11], + ['HB', 'J2', 4, 1], + ['HB', 'J2', 1, 4], + ['HB', 'J2', 2, 10], + ['HB', 'J2', 8, 5], + ['HB', 'J2', 9, 6], + ['HB', 'J2', 5, 8], + ['HB', 'J2', 6, 9], + ['HB', 'J2', 7, 0], + ['HB', 'J2', 10, 2], + ['HB', 'J2', 11, 3] +] + +Symmetries = [ + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], + [1, 0, 5, 6, 7, 2, 3, 4, 10, 11, 8, 9], + [2, 5, 6, 7, 8, 3, 4, 10, 11, 1, 9, 0], + [3, 6, 7, 8, 9, 4, 10, 11, 1, 2, 0, 5], + [4, 7, 8, 9, 0, 10, 11, 1, 2, 3, 5, 6], + [5, 2, 3, 4, 10, 6, 7, 8, 9, 0, 11, 1], + [6, 3, 4, 10, 11, 7, 8, 9, 0, 5, 1, 2], + [7, 4, 10, 11, 1, 8, 9, 0, 5, 6, 2, 3], + [8, 10, 11, 1, 2, 9, 0, 5, 6, 7, 3, 4], + [9, 11, 1, 2, 3, 0, 5, 6, 7, 8, 4, 10], + [10, 8, 9, 0, 5, 11, 1, 2, 3, 4, 6, 7], + [11, 9, 0, 5, 6, 1, 2, 3, 4, 10, 7, 8], + [0, 7, 3, 5, 1, 11, 8, 4, 6, 2, 9, 10], + [1, 4, 6, 2, 0, 9, 10, 7, 3, 5, 11, 8], + [2, 10, 7, 3, 5, 0, 11, 8, 4, 6, 1, 9], + [3, 11, 8, 4, 6, 5, 1, 9, 10, 7, 2, 0], + [4, 1, 9, 10, 7, 6, 2, 0, 11, 8, 3, 5], + [5, 8, 4, 6, 2, 1, 9, 10, 7, 3, 0, 11], + [6, 9, 10, 7, 3, 2, 0, 11, 8, 4, 5, 1], + [7, 0, 11, 8, 4, 3, 5, 1, 9, 10, 6, 2], + [8, 5, 1, 9, 10, 4, 6, 2, 0, 11, 7, 3], + [9, 6, 2, 0, 11, 10, 7, 3, 5, 1, 8, 4], + [10, 2, 0, 11, 8, 7, 3, 5, 1, 9, 4, 6], + [11, 3, 5, 1, 9, 8, 4, 6, 2, 0, 10, 7], + [0, 4, 5, 11, 7, 10, 6, 1, 8, 3, 2, 9], + [1, 7, 2, 9, 4, 8, 3, 0, 10, 6, 5, 11], + [2, 8, 3, 0, 10, 9, 4, 5, 11, 7, 6, 1], + [3, 9, 4, 5, 11, 0, 10, 6, 1, 8, 7, 2], + [4, 0, 10, 6, 1, 5, 11, 7, 2, 9, 8, 3], + [5, 10, 6, 1, 8, 11, 7, 2, 9, 4, 3, 0], + [6, 11, 7, 2, 9, 1, 8, 3, 0, 10, 4, 5], + [7, 1, 8, 3, 0, 2, 9, 4, 5, 11, 10, 6], + [8, 2, 9, 4, 5, 3, 0, 10, 6, 1, 11, 7], + [9, 3, 0, 10, 6, 4, 5, 11, 7, 2, 1, 8], + [10, 5, 11, 7, 2, 6, 1, 8, 3, 0, 9, 4], + [11, 6, 1, 8, 3, 7, 2, 9, 4, 5, 0, 10], + [0, 1, 11, 10, 4, 9, 8, 7, 6, 5, 3, 2], + [1, 0, 9, 8, 7, 11, 10, 4, 3, 2, 6, 5], + [2, 5, 0, 9, 8, 1, 11, 10, 4, 3, 7, 6], + [3, 6, 5, 0, 9, 2, 1, 11, 10, 4, 8, 7], + [4, 7, 6, 5, 0, 3, 2, 1, 11, 10, 9, 8], + [5, 2, 1, 11, 10, 0, 9, 8, 7, 6, 4, 3], + [6, 3, 2, 1, 11, 5, 0, 9, 8, 7, 10, 4], + [7, 4, 3, 2, 1, 6, 5, 0, 9, 8, 11, 10], + [8, 10, 4, 3, 2, 7, 6, 5, 0, 9, 1, 11], + [9, 11, 10, 4, 3, 8, 7, 6, 5, 0, 2, 1], + [10, 8, 7, 6, 5, 4, 3, 2, 1, 11, 0, 9], + [11, 9, 8, 7, 6, 10, 4, 3, 2, 1, 5, 0], + [0, 7, 10, 9, 1, 2, 6, 4, 8, 11, 5, 3], + [1, 4, 8, 11, 0, 5, 3, 7, 10, 9, 2, 6], + [2, 10, 9, 1, 5, 6, 4, 8, 11, 0, 3, 7], + [3, 11, 0, 2, 6, 7, 10, 9, 1, 5, 4, 8], + [4, 1, 5, 3, 7, 8, 11, 0, 2, 6, 10, 9], + [5, 8, 11, 0, 2, 3, 7, 10, 9, 1, 6, 4], + [6, 9, 1, 5, 3, 4, 8, 11, 0, 2, 7, 10], + [7, 0, 2, 6, 4, 10, 9, 1, 5, 3, 8, 11], + [8, 5, 3, 7, 10, 11, 0, 2, 6, 4, 9, 1], + [9, 6, 4, 8, 11, 1, 5, 3, 7, 10, 0, 2], + [10, 2, 6, 4, 8, 9, 1, 5, 3, 7, 11, 0], + [11, 3, 7, 10, 9, 0, 2, 6, 4, 8, 1, 5], + [0, 4, 9, 2, 7, 3, 8, 1, 6, 10, 11, 5], + [1, 7, 11, 5, 4, 6, 10, 0, 3, 8, 9, 2], + [2, 8, 1, 6, 10, 7, 11, 5, 4, 9, 0, 3], + [3, 9, 2, 7, 11, 8, 1, 6, 10, 0, 5, 4], + [4, 0, 3, 8, 1, 9, 2, 7, 11, 5, 6, 10], + [5, 10, 0, 3, 8, 4, 9, 2, 7, 11, 1, 6], + [6, 11, 5, 4, 9, 10, 0, 3, 8, 1, 2, 7], + [7, 1, 6, 10, 0, 11, 5, 4, 9, 2, 3, 8], + [8, 2, 7, 11, 5, 1, 6, 10, 0, 3, 4, 9], + [9, 3, 8, 1, 6, 2, 7, 11, 5, 4, 10, 0], + [10, 5, 4, 9, 2, 0, 3, 8, 1, 6, 7, 11], + [11, 6, 10, 0, 3, 5, 4, 9, 2, 7, 8, 1], + [0, 1, 5, 3, 7, 2, 6, 4, 8, 11, 10, 9], + [1, 0, 2, 6, 4, 5, 3, 7, 10, 9, 8, 11], + [2, 5, 3, 7, 10, 6, 4, 8, 11, 0, 9, 1], + [3, 6, 4, 8, 11, 7, 10, 9, 1, 5, 0, 2], + [4, 7, 10, 9, 1, 8, 11, 0, 2, 6, 5, 3], + [5, 2, 6, 4, 8, 3, 7, 10, 9, 1, 11, 0], + [6, 3, 7, 10, 9, 4, 8, 11, 0, 2, 1, 5], + [7, 4, 8, 11, 0, 10, 9, 1, 5, 3, 2, 6], + [8, 10, 9, 1, 5, 11, 0, 2, 6, 4, 3, 7], + [9, 11, 0, 2, 6, 1, 5, 3, 7, 10, 4, 8], + [10, 8, 11, 0, 2, 9, 1, 5, 3, 7, 6, 4], + [11, 9, 1, 5, 3, 0, 2, 6, 4, 8, 7, 10], + [0, 7, 11, 5, 4, 3, 8, 1, 6, 10, 9, 2], + [1, 4, 9, 2, 7, 6, 10, 0, 3, 8, 11, 5], + [2, 10, 0, 3, 8, 7, 11, 5, 4, 9, 1, 6], + [3, 11, 5, 4, 9, 8, 1, 6, 10, 0, 2, 7], + [4, 1, 6, 10, 0, 9, 2, 7, 11, 5, 3, 8], + [5, 8, 1, 6, 10, 4, 9, 2, 7, 11, 0, 3], + [6, 9, 2, 7, 11, 10, 0, 3, 8, 1, 5, 4], + [7, 0, 3, 8, 1, 11, 5, 4, 9, 2, 6, 10], + [8, 5, 4, 9, 2, 1, 6, 10, 0, 3, 7, 11], + [9, 6, 10, 0, 3, 2, 7, 11, 5, 4, 8, 1], + [10, 2, 7, 11, 5, 0, 3, 8, 1, 6, 4, 9], + [11, 3, 8, 1, 6, 5, 4, 9, 2, 7, 10, 0], + [0, 4, 10, 11, 1, 5, 6, 7, 8, 9, 2, 3], + [1, 7, 8, 9, 0, 2, 3, 4, 10, 11, 5, 6], + [2, 8, 9, 0, 5, 3, 4, 10, 11, 1, 6, 7], + [3, 9, 0, 5, 6, 4, 10, 11, 1, 2, 7, 8], + [4, 0, 5, 6, 7, 10, 11, 1, 2, 3, 8, 9], + [5, 10, 11, 1, 2, 6, 7, 8, 9, 0, 3, 4], + [6, 11, 1, 2, 3, 7, 8, 9, 0, 5, 4, 10], + [7, 1, 2, 3, 4, 8, 9, 0, 5, 6, 10, 11], + [8, 2, 3, 4, 10, 9, 0, 5, 6, 7, 11, 1], + [9, 3, 4, 10, 11, 0, 5, 6, 7, 8, 1, 2], + [10, 5, 6, 7, 8, 11, 1, 2, 3, 4, 9, 0], + [11, 6, 7, 8, 9, 1, 2, 3, 4, 10, 0, 5], + [0, 1, 9, 10, 7, 11, 8, 4, 6, 2, 3, 5], + [1, 0, 11, 8, 4, 9, 10, 7, 3, 5, 6, 2], + [2, 5, 1, 9, 10, 0, 11, 8, 4, 6, 7, 3], + [3, 6, 2, 0, 11, 5, 1, 9, 10, 7, 8, 4], + [4, 7, 3, 5, 1, 6, 2, 0, 11, 8, 9, 10], + [5, 2, 0, 11, 8, 1, 9, 10, 7, 3, 4, 6], + [6, 3, 5, 1, 9, 2, 0, 11, 8, 4, 10, 7], + [7, 4, 6, 2, 0, 3, 5, 1, 9, 10, 11, 8], + [8, 10, 7, 3, 5, 4, 6, 2, 0, 11, 1, 9], + [9, 11, 8, 4, 6, 10, 7, 3, 5, 1, 2, 0], + [10, 8, 4, 6, 2, 7, 3, 5, 1, 9, 0, 11], + [11, 9, 10, 7, 3, 8, 4, 6, 2, 0, 5, 1], + [0, 7, 2, 9, 4, 10, 6, 1, 8, 3, 5, 11], + [1, 4, 5, 11, 7, 8, 3, 0, 10, 6, 2, 9], + [2, 10, 6, 1, 8, 9, 4, 5, 11, 7, 3, 0], + [3, 11, 7, 2, 9, 0, 10, 6, 1, 8, 4, 5], + [4, 1, 8, 3, 0, 5, 11, 7, 2, 9, 10, 6], + [5, 8, 3, 0, 10, 11, 7, 2, 9, 4, 6, 1], + [6, 9, 4, 5, 11, 1, 8, 3, 0, 10, 7, 2], + [7, 0, 10, 6, 1, 2, 9, 4, 5, 11, 8, 3], + [8, 5, 11, 7, 2, 3, 0, 10, 6, 1, 9, 4], + [9, 6, 1, 8, 3, 4, 5, 11, 7, 2, 0, 10], + [10, 2, 9, 4, 5, 6, 1, 8, 3, 0, 11, 7], + [11, 3, 0, 10, 6, 7, 2, 9, 4, 5, 1, 8], + [0, 4, 3, 2, 1, 9, 8, 7, 6, 5, 11, 10], + [1, 7, 6, 5, 0, 11, 10, 4, 3, 2, 9, 8], + [2, 8, 7, 6, 5, 1, 11, 10, 4, 3, 0, 9], + [3, 9, 8, 7, 6, 2, 1, 11, 10, 4, 5, 0], + [4, 0, 9, 8, 7, 3, 2, 1, 11, 10, 6, 5], + [5, 10, 4, 3, 2, 0, 9, 8, 7, 6, 1, 11], + [6, 11, 10, 4, 3, 5, 0, 9, 8, 7, 2, 1], + [7, 1, 11, 10, 4, 6, 5, 0, 9, 8, 3, 2], + [8, 2, 1, 11, 10, 7, 6, 5, 0, 9, 4, 3], + [9, 3, 2, 1, 11, 8, 7, 6, 5, 0, 10, 4], + [10, 5, 0, 9, 8, 4, 3, 2, 1, 11, 7, 6], + [11, 6, 5, 0, 9, 10, 4, 3, 2, 1, 8, 7] +] + +# Irreducible representations +[Gamma.D6.A1] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143] +momentum = [0.0000000000000000, 0.0000000000000000] + +[Gamma.D6.A2] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143] +momentum = [0.0000000000000000, 0.0000000000000000] + +[Gamma.D6.B1] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143] +momentum = [0.0000000000000000, 0.0000000000000000] + +[Gamma.D6.B2] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143] +momentum = [0.0000000000000000, 0.0000000000000000] + +[Gamma.D6.E1] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386], + [0.5000000000000001, -0.8660254037844386] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71] +momentum = [0.0000000000000000, 0.0000000000000000] + +[Gamma.D6.E2] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, 0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386], + [-0.5000000000000001, -0.8660254037844386] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71] +momentum = [0.0000000000000000, 0.0000000000000000] + +[K.D3.A1] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131] +momentum = [4.1887902047863905, 0.0000000000000000] + +[K.D3.A2] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [0.4999999999999998, -0.8660254037844388], + [0.5000000000000004, 0.8660254037844384], + [-1.0000000000000000, 0.0000000000000002], + [0.4999999999999998, -0.8660254037844388], + [0.5000000000000004, 0.8660254037844384], + [-1.0000000000000000, 0.0000000000000002], + [0.4999999999999992, -0.8660254037844392], + [0.5000000000000014, 0.8660254037844378], + [0.4999999999999992, -0.8660254037844392], + [0.5000000000000014, 0.8660254037844378], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [0.4999999999999998, -0.8660254037844388], + [0.5000000000000004, 0.8660254037844384], + [-1.0000000000000000, 0.0000000000000002], + [0.4999999999999998, -0.8660254037844388], + [0.5000000000000004, 0.8660254037844384], + [-1.0000000000000000, 0.0000000000000002], + [0.4999999999999992, -0.8660254037844392], + [0.5000000000000014, 0.8660254037844378], + [0.4999999999999992, -0.8660254037844392], + [0.5000000000000014, 0.8660254037844378], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [0.4999999999999998, -0.8660254037844388], + [0.5000000000000004, 0.8660254037844384], + [-1.0000000000000000, 0.0000000000000002], + [0.4999999999999998, -0.8660254037844388], + [0.5000000000000004, 0.8660254037844384], + [-1.0000000000000000, 0.0000000000000002], + [0.4999999999999992, -0.8660254037844392], + [0.5000000000000014, 0.8660254037844378], + [0.4999999999999992, -0.8660254037844392], + [0.5000000000000014, 0.8660254037844378] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131] +momentum = [4.1887902047863905, 0.0000000000000000] + +[K.D3.E] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000004, -0.8660254037844384], + [1.0000000000000000, -0.0000000000000002], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999992, 0.8660254037844392], + [-0.5000000000000014, -0.8660254037844378], + [-0.4999999999999998, 0.8660254037844388], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000006, -0.8660254037844385], + [1.0000000000000000, -0.0000000000000008], + [-0.4999999999999996, 0.8660254037844389], + [-0.5000000000000006, -0.8660254037844385], + [1.0000000000000000, -0.0000000000000008], + [-0.4999999999999996, 0.8660254037844389], + [-0.5000000000000011, -0.8660254037844382], + [1.0000000000000000, -0.0000000000000019], + [-0.5000000000000011, -0.8660254037844382], + [1.0000000000000000, -0.0000000000000019], + [-0.4999999999999998, -0.8660254037844388], + [-0.4999999999999998, -0.8660254037844388], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000000, -0.8660254037844387], + [1.0000000000000000, 0.0000000000000000], + [-0.4999999999999998, 0.8660254037844388], + [-0.5000000000000000, -0.8660254037844387], + [1.0000000000000000, -0.0000000000000007], + [-0.4999999999999988, 0.8660254037844395], + [1.0000000000000000, -0.0000000000000007], + [-0.4999999999999988, 0.8660254037844395] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59] +momentum = [4.1887902047863905, 0.0000000000000000] + +[M.D2.A1] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000004], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000004], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000004], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000004], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131] +momentum = [3.1415926535897931, 1.8137993642342178] + +[M.D2.A2] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000004], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000004], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, -0.0000000000000004], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, -0.0000000000000004], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131] +momentum = [3.1415926535897931, 1.8137993642342178] + +[M.D2.B1] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000004], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, -0.0000000000000004], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000004], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, -0.0000000000000004], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131] +momentum = [3.1415926535897931, 1.8137993642342178] + +[M.D2.B2] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000004], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, -0.0000000000000004], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, 0.0000000000000001], + [-1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, -0.0000000000000004], + [1.0000000000000000, -0.0000000000000001], + [-1.0000000000000000, 0.0000000000000002], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, -0.0000000000000001], + [1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002], + [-1.0000000000000000, 0.0000000000000004], + [-1.0000000000000000, 0.0000000000000001], + [1.0000000000000000, -0.0000000000000002] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131] +momentum = [3.1415926535897931, 1.8137993642342178] + +[X.D1.A] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [0.5000000000000001, 0.8660254037844386], + [-0.4999999999999998, 0.8660254037844388], + [-1.0000000000000000, 0.0000000000000001], + [0.5000000000000001, 0.8660254037844386], + [-0.4999999999999998, 0.8660254037844388], + [-1.0000000000000000, 0.0000000000000001], + [-0.5000000000000004, -0.8660254037844384], + [0.4999999999999993, -0.8660254037844390], + [-0.5000000000000004, -0.8660254037844384], + [0.4999999999999993, -0.8660254037844390], + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [0.5000000000000001, 0.8660254037844386], + [-0.4999999999999998, 0.8660254037844388], + [-1.0000000000000000, 0.0000000000000001], + [0.5000000000000001, 0.8660254037844386], + [-0.4999999999999998, 0.8660254037844388], + [-1.0000000000000000, 0.0000000000000001], + [-0.5000000000000004, -0.8660254037844384], + [0.4999999999999993, -0.8660254037844390], + [-0.5000000000000004, -0.8660254037844384], + [0.4999999999999993, -0.8660254037844390] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83] +momentum = [2.0943951023931953, 0.0000000000000000] + +[X.D1.B] +characters = [ + [1.0000000000000000, 0.0000000000000000], + [1.0000000000000000, 0.0000000000000000], + [0.5000000000000001, 0.8660254037844386], + [-0.4999999999999998, 0.8660254037844388], + [-1.0000000000000000, 0.0000000000000001], + [0.5000000000000001, 0.8660254037844386], + [-0.4999999999999998, 0.8660254037844388], + [-1.0000000000000000, 0.0000000000000001], + [-0.5000000000000004, -0.8660254037844384], + [0.4999999999999993, -0.8660254037844390], + [-0.5000000000000004, -0.8660254037844384], + [0.4999999999999993, -0.8660254037844390], + [-1.0000000000000000, 0.0000000000000000], + [-1.0000000000000000, 0.0000000000000000], + [-0.5000000000000001, -0.8660254037844386], + [0.4999999999999998, -0.8660254037844388], + [1.0000000000000000, -0.0000000000000001], + [-0.5000000000000001, -0.8660254037844386], + [0.4999999999999998, -0.8660254037844388], + [1.0000000000000000, -0.0000000000000001], + [0.5000000000000004, 0.8660254037844384], + [-0.4999999999999993, 0.8660254037844390], + [0.5000000000000004, 0.8660254037844384], + [-0.4999999999999993, 0.8660254037844390] +] +allowed_symmetries = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83] +momentum = [2.0943951023931953, 0.0000000000000000] + + diff --git a/search/search_index.json b/search/search_index.json index be9d66e0..6bb7f1f9 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"

Quick Start Code on GitHub

"},{"location":"#overview","title":"Overview","text":"

XDiag is a library for performing Exact Diagonalizations of quantum many-body systems. Key features include optimized combinatorical algorithms for navigating Hilbert spaces, iterative linear algebra algorithms, shared and distributed memory parallelization. It consist of two packages:

"},{"location":"#citation","title":"Citation","text":"

Please support our work by citing XDiag and the implemented algorithms if it is used in your published research.

@article{Wietek2018,\n  title = {Sublattice coding algorithm and distributed memory parallelization for large-scale exact diagonalizations of quantum many-body systems},\n  author = {Wietek, Alexander and L\\\"auchli, Andreas M.},\n  journal = {Phys. Rev. E},\n  volume = {98},\n  issue = {3},\n  pages = {033309},\n  numpages = {10},\n  year = {2018},\n  month = {Sep},\n  publisher = {American Physical Society},\n  doi = {10.1103/PhysRevE.98.033309},\n  url = {https://link.aps.org/doi/10.1103/PhysRevE.98.033309}\n}\n
"},{"location":"#gallery","title":"Gallery","text":""},{"location":"installation/","title":"Installation","text":""},{"location":"installation/#julia-installation","title":"Julia Installation","text":"

Enter the package mode using ] in the Julia REPL and type:

add XDiag\n

That's it!

"},{"location":"installation/#c-compilation","title":"C++ Compilation","text":"

Using XDiag with C++ is a two-step process. First the xdiag library needs to be compiled and installed. Therafter, application codes are compiled in a second step. Here we explain how to compile the library.

"},{"location":"installation/#prerequisites","title":"Prerequisites","text":""},{"location":"installation/#basic-compilation","title":"Basic Compilation","text":""},{"location":"installation/#advanced-compilation","title":"Advanced Compilation","text":""},{"location":"installation/#building-documentation","title":"Building Documentation","text":"

The source files for the documentation can be found in the directory docs. The documentation is built using Material for MKDocs. To work on it locally, it can be served using

mkdocs serve\n

from the xdiag root source directory. A local build of the documentation can then be accessed in a webbrowser at the adress

127.0.0.1:8000\n
"},{"location":"quickstart/","title":"Quick start","text":""},{"location":"quickstart/#hello-world","title":"Hello World","text":"

Let us set up our first program using the xdiag library.

JuliaC++
using XDiag\nsay_hello()\n
#include <xdiag/all.hpp>\n\nusing namespace xdiag;\n\nint main() try {\n  say_hello();\n} catch (Error e) {\n  error_trace(e);\n}\n

The function say_hello() prints out a welcome message, which also contains information which exact XDiag version is used. In Julia this is all there is to it.

For the C++ code we need to create two files to compile the program. The first is the actual C++ code. What is maybe a bit unfamiliar is the try / catch block. XDiag implements a traceback mechanism for runtime errors, which is activated by this idiom. While not stricly necessary here, it is a good practice to make use of this.

Now that the application program is written, we next need to set up the compilation instructions using CMake. To do so we create a second file called CMakeLists.txt in the same directory.

cmake_minimum_required(VERSION 3.19)\n\nproject(\n  hello_world\n)\n\nfind_package(xdiag REQUIRED HINTS \"../../install\")\nadd_executable(main main.cpp)\ntarget_link_libraries(main PRIVATE xdiag::xdiag)\n

You should replace \"/path/to/xdiag/install\" with the appropriate directory where your XDiag library is installed after compilation. This exact CMakeLists.txt file can be used to compile any XDiag application.

Info

For using the distributed XDiag library the last line of the above CMakeLists.txt should be changed to

target_link_libraries(main PUBLIC xdiag::xdiag_distributed)\n

We then compile the application code,

cmake -S . -B build\ncmake --build build\n

and finally run our first xdiag application.

./build/main\n
"},{"location":"quickstart/#computing-the-ground-state-energy-of-a-spin-chain","title":"Computing the ground state energy of a spin chain","text":"

We compute the ground state energy of the \\(S=1/2\\) Heisenberg chain on a periodic chain lattice in one dimension. The Hamiltonian is given by

\\[ H = J\\sum_{\\langle i,j \\rangle} \\mathbf{S}_i \\cdot \\mathbf{S}_j\\]

where \\(\\mathbf{S}_i = (S_i^x, S_i^y, S_i^z)\\) are the spin \\(S=1/2\\) operators and \\(\\langle i,j \\rangle\\) denotes summation over nearest-meighbor sites \\(i\\) and \\(j\\).

The following code, sets up the Hilbert space, defines the Hamiltonian and finally calls an iterative eigenvalue solver to compute the ground state energy.

JuliaC++
using XDiag\n\nlet \n    N = 16\n    nup = N \u00f7 2\n    block = Spinhalf(N, nup)\n\n    # Define the nearest-neighbor Heisenberg model\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", \"J\", [i-1, i % N])\n    end\n    ops[\"J\"] = 1.0\n\n    set_verbosity(2)            # set verbosity for monitoring progress\n    e0 = eigval0(ops, block)    # compute ground state energy\n\n    println(\"Ground state energy: $e0\")\nend\n
#include <xdiag/all.hpp>\n\nusing namespace xdiag;\n\nint main() try {\n  int N = 16;\n  int nup = N / 2;\n  Spinhalf block(N, nup);\n\n  // Define the nearest-neighbor Heisenberg model\n  OpSum ops;\n  for (int i = 0; i < N; ++i) {\n    ops += Op(\"HB\", \"J\", {i, (i + 1) % N});\n  }\n  ops[\"J\"] = 1.0;\n\n  set_verbosity(2);                  // set verbosity for monitoring progress\n  double e0 = eigval0(ops, block); // compute ground state energy\n\n  Log(\"Ground state energy: {:.12f}\", e0);\n\n} catch (Error e) {\n  error_trace(e);\n}\n
"},{"location":"releases/","title":"Releases","text":""},{"location":"releases/#v023","title":"v0.2.3","text":"

Sep. 9, 2024

Introduced 1-indexing everywhere in Julia version

"},{"location":"releases/#v022","title":"v0.2.2","text":"

Aug. 27, 2024

Lanczos routines and multicolumn States

"},{"location":"releases/#v021","title":"v0.2.1","text":"

Aug. 16, 2024

Small patch release providing small utility functions

"},{"location":"releases/#v020","title":"v0.2.0","text":"

Aug. 15, 2024

Basic functionality for three Hilbert space types, Spinhalf, tJ, and Electron, has been implemented. Features are:

"},{"location":"tutorials/","title":"Tutorials","text":""},{"location":"tutorials/#basic-examples","title":"Basic examples","text":""},{"location":"tutorials/#distributed-examples","title":"Distributed examples","text":""},{"location":"tutorials/#cmakeliststxt-for-applications","title":"CMakeLists.txt for applications","text":""},{"location":"documentation/","title":"Documentation","text":""},{"location":"documentation/#algorithms","title":"Algorithms","text":"Name Description Language eigval0 Computes the lowest lying eigenvalue of an operator eig0 Computes the lowest lying eigenvalue and eigenvector of an operator eigvals_lanczos Performs an iterative eigenvalue calculation using the Lanczos algorithm eigs_lanczos Performs an iterative eigenvalue calculation building eigenvectors using the Lanczos algorithm"},{"location":"documentation/#algebra","title":"Algebra","text":"matrix Creates the full matrix representation of an operator on a block apply Applies an operator to a state \\(\\vert w \\rangle = O \\vert v\\rangle\\) norm Computes the 2-norm of a state norm1 Computes the 1-norm of a state norminf Computes the \\(\\infty\\)-norm of a state dot Computes the dot product between two states inner Computes an expectation value \\(\\langle v \\vert O \\vert v \\rangle\\)"},{"location":"documentation/#blocks","title":"Blocks","text":"Spinhalf Block of a spin \\(S=1/2\\) type Hilbert space tJ Block of a \\(t-J\\) type Hilbert space Electron Block of a Electron type Hilbert space"},{"location":"documentation/#operators","title":"Operators","text":"Op A local operator acting on several lattice sites OpSum Sum of local operators Coupling Describes the coupling of a local operator symmetrize Symmetrizes an operator with respect to a permutation symmetry group"},{"location":"documentation/#states","title":"States","text":"State A generic state describing a quantum wave function ProductState A product state of local configurations RandomState A random state with normal distributed coefficients fill Fill a state with a given model state product Creates a filled product state rand Create a filled random state with normal distributed coefficients zeros Create a filled state with all zero entries zero Set all coefficients of a given state to zero"},{"location":"documentation/#symmetries","title":"Symmetries","text":"Permutation Permutations of indices or lattice sites PermutationGroup A group of permutations Representation A (1D) irreducible representation of a finite group"},{"location":"documentation/#utilities","title":"Utilities","text":"set_verbosity Sets how much information is printed during computations say_hello Prints a nice welcome message with version number print_version Prints the plain version number Logging Controling what is written to standard output Timing Measurng wall time straightforwardly XDIAG_SHOW Macro for printing debugging information"},{"location":"documentation/algebra/algebra/","title":"Basic algebra routines","text":"

Source algebra.hpp

"},{"location":"documentation/algebra/algebra/#norm","title":"norm","text":"

Computes the 2-norm of a state

JuliaC++
norm(state::State)\n
double norm(State const &v);\n
"},{"location":"documentation/algebra/algebra/#norm1","title":"norm1","text":"

Computes the 1-norm of a state

JuliaC++
norm1(state::State)\n
double norm1(State const &v);\n
"},{"location":"documentation/algebra/algebra/#norminf","title":"norminf","text":"

Computes the \\(\\infty\\)-norm of a state

JuliaC++
norminf(state::State)\n
double norminf(State const &v);\n
"},{"location":"documentation/algebra/algebra/#dot","title":"dot","text":"

Computes the dot product between two states. In C++, please use the dotC function if one of the two states is expected to be complex.

JuliaC++
dot(v::State, w::State)\n
double dot(State const &v, State const &w);\ncomplex dotC(State const &v, State const &w);\n
"},{"location":"documentation/algebra/algebra/#inner","title":"inner","text":"

Computes the expectation value \\(\\langle v | O |v \\rangle\\) of an operator \\(O\\) and a state \\(|v\\rangle\\). The operator can either be an Op or an OpSum object. In C++, please use the innerC function if either the operator or the state are complex.

JuliaC++
inner(ops::OpSum, v::State)\ninner(op::Op, v::State)\n
double inner(OpSum const &ops, State const &v);\ndouble inner(Op const &op, State const &v);\ncomplex innerC(OpSum const &ops, State const &v);\ncomplex innerC(Op const &op, State const &v);\n
"},{"location":"documentation/algebra/algebra/#usage-examples","title":"Usage Examples","text":"JuliaC++
let \n    N = 8\n    block = Spinhalf(N,  N \u00f7 2)\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", 1.0, [i, mod1(i+1, N)])\n    end\n    e0, psi = eig0(ops, block);\n\n    @show norm(psi)\n    @show norm1(psi)\n    @show norminf(psi)\n\n    @show dot(psi, psi)\n    @show e0, inner(ops, psi)\n\n    phi = rand(block)\n    display(vector(phi))\n    display(vector(psi))\n    display(vector(psi + 2.0*phi))\n    display(vector(psi*3.0im + phi/2.0))\nend\n
int N = 8;\nauto block = Spinhalf(N,  N / 2);\nauto ops = OpSum();\nfor (int i=0; i<N; ++i) {\n  ops += Op(\"HB\", 1.0, {i, (i+1)%N});\n}\nauto [e0, psi] = eig0(ops, block);\n\nXDIAG_SHOW(norm(psi));\nXDIAG_SHOW(norm1(psi));\nXDIAG_SHOW(norminf(psi));\n\nXDIAG_SHOW(dot(psi, psi));\nXDIAG_SHOW(e0);\nXDIAG_SHOW(inner(ops, psi));\n\nauto phi = rand(block);\nXDIAG_SHOW(phi.vector());\nXDIAG_SHOW(psi.vector());\nXDIAG_SHOW((psi + 2.0*phi).vector());\nXDIAG_SHOW((psi*complex(0,3.0) + phi/2.0).vectorC());\n
"},{"location":"documentation/algebra/apply/","title":"apply","text":"

Applies an operator to a state \\(\\vert w \\rangle = O \\vert v\\rangle\\) or block of states \\(\\left( \\vert w_1 \\rangle \\dots \\vert w_M \\rangle \\right) = O \\left( \\vert v_1 \\rangle \\dots \\vert v_M \\rangle \\right)\\).

Source apply.hpp

JuliaC++
apply(op::Op, v::State, w::State, precision::Float64 = 1e-12)\napply(ops::OpSum, v::State, w::State, precision::Float64 = 1e-12)\n
void apply(Op const &op, State const &v, State &w, double precision = 1e-12);\nvoid apply(OpSum const &ops, State const &v, State &w, double precision = 1e-12);\n

The resulting state is handed as the third argument and is overwritten upon exit.

"},{"location":"documentation/algebra/apply/#parameters","title":"Parameters","text":"Name Description ops / op OpSum or Op defining the operator v input state $\\vert v\\rangle $ w output state \\(\\vert w \\rangle = O \\vert v\\rangle\\) precision precision with which checks for zero are performed (default \\(10^{-12}\\))"},{"location":"documentation/algebra/apply/#usage-example","title":"Usage Example","text":"JuliaC++
let \n    N = 8\n    block = Spinhalf(N,  N \u00f7 2)\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", 1.0, [i, mod1(i+1, N)])\n    end\n    e0, psi = eig0(ops, block);\n\n    blockp = Spinhalf(N,  N \u00f7 2 + 1)\n    phi = zeros(blockp)\n    apply(Op(\"S+\", 1.0, 2), psi, phi)\n    @show inner(ops, psi)\n    @show inner(ops, phi)\nend\n
int N = 8;\nauto block = Spinhalf(N,  N / 2);\nauto ops = OpSum();\nfor (int i=0; i<N; ++i){\n  ops += Op(\"HB\", 1.0, {i, (i+1)%N});\n}\nauto [e0, psi] = eig0(ops, block);\n\nauto blockp = Spinhalf(N,  N / 2 + 1);\nauto phi = zeros(blockp);\napply(Op(\"S+\", 1.0, 2), psi, phi);\nXDIAG_SHOW(inner(ops, psi));\nXDIAG_SHOW(inner(ops, phi));\n
"},{"location":"documentation/algebra/matrix/","title":"matrix","text":"
matrix(ops, block; force_complex=false)\nmatrixC(ops, block)  # c++ only\n

Creates the full matrix representation of a given OpSum on a block.

In Julia, depending on whether a real/complex matrix is generated also a real/complex matrix is returned. The C++ version has to return a fixed type. If a real matrix is desired, use the function matrix. If a complex matrix is desired, use the function matrixC.

Source matrix.hpp

"},{"location":"documentation/algebra/matrix/#parameters","title":"Parameters","text":"Name Description ops OpSum defining the operator block block on which the operator is defined force_complex flag to determine if returned matrix is forced to be complex (Julia only)"},{"location":"documentation/algebra/matrix/#returns","title":"Returns","text":"Type Description matrix matrix representation of opsum on block"},{"location":"documentation/algebra/matrix/#definition","title":"Definition","text":"JuliaC++
matrix(ops::Opsum, block::Block; force_complex::Bool=false)\n
template <typename block_t>\narma::mat matrix(OpSum const &ops, block_t const &block);\n\ntemplate <typename block_t>\narma::cx_mat matrixC(OpSum const &ops, block_t const &block);\n
"},{"location":"documentation/algebra/matrix/#usage-example","title":"Usage Example","text":"JuliaC++
let\n    # Creates matrix H_{k=2} in Eq (18.23) of https://link.springer.com/content/pdf/10.1007/978-3-540-74686-7_18.pdf\n    N = 4\n    nup = 3\n    ndn = 2\n\n    # Define a Hubbard chain model\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HOP\", \"T\", [i, mod1(i+1, N)])\n    end\n    ops[\"T\"] = 1.0;\n    ops[\"U\"] = 5.0;\n\n    # Create the a permutation group\n    p1 = Permutation([1, 2, 3, 4])\n    p2 = Permutation([2, 3, 4, 1])\n    p3 = Permutation([3, 4, 1, 2])\n    p4 = Permutation([4, 1, 2, 3])\n    group = PermutationGroup([p1, p2, p3, p4])\n    irrep = Representation([1, -1, 1, -1])\n    block = Electron(N, nup, ndn, group, irrep)\n\n    H = matrix(ops, block)\n    display(H)\nend\n
// Creates matrix H_{k=2} in Eq (18.23) of https://link.springer.com/content/pdf/10.1007/978-3-540-74686-7_18.pdf\nint N = 4;\nint nup = 3;\nint ndn = 2;\n\n// Define a Hubbard chain model\nauto ops = OpSum();\nfor (int i=0; i< N; ++i){\n  ops += Op(\"HOP\", \"T\", {i, (i+1) % N});\n}\nops[\"T\"] = 1.0;\nops[\"U\"] = 5.0;\n\n// Create the a permutation group\nauto p1 = Permutation({0, 1, 2, 3});\nauto p2 = Permutation({1, 2, 3, 0});\nauto p3 = Permutation({2, 3, 0, 1});\nauto p4 = Permutation({3, 0, 1, 2});\nauto group = PermutationGroup({p1, p2, p3, p4});\nauto irrep = Representation({1, -1, 1, -1});\nauto block = Electron(N, nup, ndn, group, irrep);\n\nauto H = matrix(ops, block);\nH.print();\n
"},{"location":"documentation/algorithms/eig0/","title":"eig0","text":"

Computes the groud state energy and the ground state of an operator on a block.

Source sparse_diag.hpp

JuliaC++
function eig0(\n    ops::OpSum,\n    block::Block;\n    precision::Real = 1e-12,\n    maxiter::Int64 = 1000,\n    force_complex::Bool = false,\n    seed::Int64 = 42,\n)\n
std::tuple<double, State> eig0(OpSum const &ops, Block const &block,\n    double precision = 1e-12,\n    int64_t max_iterations = 1000,\n    bool force_complex = false,\n    int64_t random_seed = 42);\n
"},{"location":"documentation/algorithms/eig0/#parameters","title":"Parameters","text":"Name Description Default ops OpSum defining the bonds of the operator block block on which the operator is defined precision accuracy of the computed ground state 1e-12 max_iterations maximum number of iterations 1000 force_complex whether or not computation should be forced to have complex arithmetic false random_seed random seed for setting up the initial vector 42"},{"location":"documentation/algorithms/eig0/#returns","title":"Returns","text":"Type Description real number lowest lying eigenvalue State groundstate"},{"location":"documentation/algorithms/eig0/#usage-example","title":"Usage Example","text":"JuliaC++
let \n    N = 8\n    nup = N \u00f7 2\n    block = Spinhalf(N, nup)\n\n    # Define the nearest-neighbor Heisenberg model\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", \"J\", [i, mod1(i+1, N)])\n    end\n    ops[\"J\"] = 1.0;\n\n    e0, gs = eig0(ops, block);\nend\n
int N = 8;\nint nup = N / 2;\nauto block = Spinhalf(N, nup);\n\n// Define the nearest-neighbor Heisenberg model\nauto ops = OpSum();\nfor (int i=0; i<N; ++i) {\n  ops += Op(\"HB\", \"J\", {i, (i+1) % N});\n}\nops[\"J\"] = 1.0;\nauto [e0, gs] = eig0(ops, block);\n
"},{"location":"documentation/algorithms/eigs_lanczos/","title":"eigs_lanczos","text":"

Performs an iterative eigenvalue calculation building eigenvectors using the Lanczos algorithm

Source eigs_lanczos.hpp

JuliaC++C++ (explicit state initialization)
function eigs_lanczos(\n    ops::OpSum,\n    block::Block;\n    neigvals::Int64 = 1,\n    precision::Float64 = 1e-12,\n    max_iterations::Int64 = 1000,\n    force_complex::Bool = false,\n    deflation_tol::Float64 = 1e-7,\n    random_seed::Int64 = 42,\n)\n
eigs_lanczos_result_t\neigs_lanczos(OpSum const &ops, Block const &block, int64_t neigvals = 1,\n            double precision = 1e-12, int64_t max_iterations = 1000,\n            bool force_complex = false, double deflation_tol = 1e-7,\n            int64_t random_seed = 42);\n
eigs_lanczos_result_t \neigs_lanczos(OpSum const &ops, Block const &block,\n            State const &state, int64_t neigenvalues = 1,\n            double precision = 1e-12, int64_t max_iterations = 1000,\n            bool force_complex = false);\n
"},{"location":"documentation/algorithms/eigs_lanczos/#parameters","title":"Parameters","text":"Name Description Default ops OpSum defining the bonds of the operator block block on which the operator is defined neigvals number of eigenvalues to converge 1 precision accuracy of the computed ground state 1e-12 max_iterations maximum number of iterations 1000 force_complex whether or not computation should be forced to have complex arithmetic false deflation_tol tolerance for deflation, i.e. breakdown of Lanczos due to Krylow space exhaustion 1e-7 random_seed random seed for setting up the initial vector 42"},{"location":"documentation/algorithms/eigs_lanczos/#returns","title":"Returns","text":"

A struct with the following entries

Entry Description alphas diagonal elements of the tridiagonal matrix betas off-diagonal elements of the tridiagonal matrix eigenvalues the computed Ritz eigenvalues of the tridiagonal matrix eigenvectors State of shape $D \\times $neigvals holding all low-lying eigenvalues up to neigvals niterations number of iterations performed criterion string denoting the reason why the algorithm stopped"},{"location":"documentation/algorithms/eigval0/","title":"eigval0","text":"

Computes the groud state energy of an operator on a block.

Source sparse_diag.hpp

JuliaC++
function eigval0(\n    ops::OpSum,\n    block::Block;\n    precision::Real = 1e-12,\n    maxiter::Integer = 1000,\n    force_complex::Bool = false,\n    seed::Integer = 42,\n)\n
double eigval0(OpSum const &ops, Block const &block, double precision = 1e-12,\n           int64_t max_iterations = 1000, bool force_complex = false,\n           int64_t random_seed = 42);\n
"},{"location":"documentation/algorithms/eigval0/#parameters","title":"Parameters","text":"Name Description Default ops OpSum defining the bonds of the operator block block on which the operator is defined precision accuracy of the computed ground state 1e-12 max_iterations maximum number of iterations 1000 force_complex whether or not computation should be forced to have complex arithmetic false random_seed random seed for setting up the initial vector 42"},{"location":"documentation/algorithms/eigval0/#returns","title":"Returns","text":"Type Description real number lowest lying eigenvalue"},{"location":"documentation/algorithms/eigval0/#definition","title":"Definition","text":""},{"location":"documentation/algorithms/eigval0/#usage-example","title":"Usage Example","text":"JuliaC++
let \n    N = 8\n    nup = N \u00f7 2\n    block = Spinhalf(N, nup)\n\n    # Define the nearest-neighbor Heisenberg model\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", \"J\", [i, mod1(i+1, N)])\n    end\n    ops[\"J\"] = 1.0\n\n    e0 = eigval0(ops, block);\nend\n
int N = 8;\nint nup = N / 2;\nauto block = Spinhalf(N, nup);\n\n// Define the nearest-neighbor Heisenberg model\nauto ops = OpSum();\nfor (int i=0; i<N; ++i) {\n  ops += Op(\"HB\", \"J\", {i, (i+1) % N});\n}\nops[\"J\"] = 1.0;\ndouble e0 = eigval0(ops, block);\n
"},{"location":"documentation/algorithms/eigvals_lanczos/","title":"eigvals_lanczos","text":"

Performs an iterative eigenvalue calculation using the Lanczos algorithm.

Source eigvals_lanczos.hpp

JuliaC++C++ (explicit state initialization)
function eigvals_lanczos(\n    ops::OpSum,\n    block::Block;\n    neigvals::Int64 = 1,\n    precision::Float64 = 1e-12,\n    max_iterations::Int64 = 1000,\n    force_complex::Bool = false,\n    deflation_tol::Float64 = 1e-7,\n    random_seed::Int64 = 42,\n)\n
eigvals_lanczos_result_t\neigvals_lanczos(OpSum const &ops, Block const &block, int64_t neigvals = 1,\n            double precision = 1e-12, int64_t max_iterations = 1000,\n            bool force_complex = false, double deflation_tol = 1e-7,\n            int64_t random_seed = 42);\n
eigvals_lanczos_result_t\neigvals_lanczos(OpSum const &ops, Block const &block, \n            State const &state, int64_t neigvals = 1,\n            double precision = 1e-12, int64_t max_iterations = 1000,\n            bool force_complex = false);\n
"},{"location":"documentation/algorithms/eigvals_lanczos/#parameters","title":"Parameters","text":"Name Description Default ops OpSum defining the bonds of the operator block block on which the operator is defined neigvals number of eigenvalues to converge 1 precision accuracy of the computed ground state 1e-12 max_iterations maximum number of iterations 1000 force_complex whether or not computation should be forced to have complex arithmetic false deflation_tol tolerance for deflation, i.e. breakdown of Lanczos due to Krylow space exhaustion 1e-7 random_seed random seed for setting up the initial vector 42"},{"location":"documentation/algorithms/eigvals_lanczos/#returns","title":"Returns","text":"

A struct with the following entries

Entry Description alphas diagonal elements of the tridiagonal matrix betas off-diagonal elements of the tridiagonal matrix eigenvalues the computed Ritz eigenvalues of the tridiagonal matrix niterations number of iterations performed criterion string denoting the reason why the algorithm stopped"},{"location":"documentation/blocks/electron/","title":"Electron","text":"

Representation of a block in a Electron (spinful fermion) Hilbert space.

Source electron.hpp

"},{"location":"documentation/blocks/electron/#constructors","title":"Constructors","text":"JuliaC++
Electron(n_sites::Integer)\nElectron(n_sites::Integer, n_up::Integer, n_dn::Integer)\nElectron(n_sites::Integer, group::PermutationGroup, irrep::Representation)\nElectron(n_sites::Integer, n_up::Integer, n_dn::Integer, \n         group::PermutationGroup, irrep::Representation)\n
Electron(int64_t n_sites);\nElectron(int64_t n_sites, int64_t n_up, int64_t n_dn);\nElectron(int64_t n_sites, PermutationGroup permutation_group,\n         Representation irrep);\nElectron(int64_t n_sites, int64_t n_up, int64_t n_dn, \n         PermutationGroup group, Representation irrep);\n
Name Description n_sites number of sites (integer) n_up number of \"up\" electrons (integer) n_dn number of \"dn\" electrons (integer) group PermutationGroup defining the permutation symmetries irrep Irreducible Representation of the symmetry group"},{"location":"documentation/blocks/electron/#iteration","title":"Iteration","text":"

An Electron block can be iterated over, where at each iteration a ProductState representing the corresponding basis state is returned.

JuliaC++
block = Electron(4, 2, 2)\nfor pstate in block\n    @show pstate, index(block, pstate) \nend\n
auto block = Electron(4, 2, 2);\nfor (auto pstate : block) {\n    Log(\"{} {}\", to_string(pstate), block.index(pstate));\n}\n
"},{"location":"documentation/blocks/electron/#methods","title":"Methods","text":"

index

Returns the index of a given ProductState in the basis of the Electron block.

JuliaC++
index(block::Electron, pstate::ProductState)\n
int64_t index(ProductState const &pstate) const;\n

1-indexing

In the C++ version, the index count starts from \"0\" whereas in Julia the index count starts from \"1\".

n_sites

Returns the number of sites of the block.

JuliaC++
n_sites(block::Electron)\n
int64_t n_sites() const;\n

n_up

Returns the number of \"up\" electrons.

JuliaC++
n_up(block::Electron)\n
int64_t n_up() const;\n

n_dn

Returns the number of \"down\" electrons.

JuliaC++
n_dn(block::Electron)\n
int64_t n_dn() const;\n

permutation_group

Returns the PermutationGroup of the block, if defined.

JuliaC++
permutation_group(block::Electron)\n
PermutationGroup permutation_group() const;\n

irrep

Returns the Representation of the block, if defined.

JuliaC++
irrep(block::Electron)\n
Representation irrep() const;\n

size

Returns the size of the block, i.e. its dimension.

JuliaC++
size(block::Electron)\n
int64_t size() const;\n

dim

Returns the dimension of the block, same as \"size\" for non-distributed blocks.

JuliaC++
dim(block::Electron)\n
int64_tdim() const;\n

isreal

Returns whether the block can be used with real arithmetic. Complex arithmetic is needed when a Representation is genuinely complex.

JuliaC++
isreal(block::Electron; precision::Real=1e-12)\n
int64_t isreal(double precision = 1e-12) const;\n
"},{"location":"documentation/blocks/electron/#usage-example","title":"Usage Example","text":"JuliaC++
N = 4\nnup = 2\nndn = 1\n\n# without number conservation\nblock = Electron(N)\n@show block\n\n# with number conservation\nblock_np = Electron(N, nup, ndn)\n@show block_np\n\n# with symmetries, without number conservation\np1 = Permutation([1, 2, 3, 4])\np2 = Permutation([2, 3, 4, 1])\np3 = Permutation([3, 4, 1, 2])\np4 = Permutation([4, 1, 2, 3])\ngroup = PermutationGroup([p1, p2, p3, p4])\nrep = Representation([1, -1, 1, -1])\nblock_sym = Electron(N, group, rep)\n@show block_sym\n\n# with symmetries and number conservation\nblock_sym_np = Electron(N, nup, ndn, group, rep)\n@show block_sym_np\n\n@show n_sites(block_sym_np)\n@show size(block_sym_np)\n\n# Iteration\nfor pstate in block_sym_np\n    @show pstate, index(block_sym_np, pstate)\nend\n@show permutation_group(block_sym_np)\n@show irrep(block_sym_np)\n
int N = 4;\nint nup = 2;\nint ndn = 1;\n\n// without number conservation\nauto block = Electron(N);\nXDIAG_SHOW(block);\n\n// with number conservation\nauto block_np = Electron(N, nup, ndn);\nXDIAG_SHOW(block_np);\n\n// with symmetries, without number conservation\nauto p1 = Permutation({0, 1, 2, 3});\nauto p2 = Permutation({1, 2, 3, 0});\nauto p3 = Permutation({2, 3, 0, 1});\nauto p4 = Permutation({3, 0, 1, 2});\nauto group = PermutationGroup({p1, p2, p3, p4});\nauto irrep = Representation({1, -1, 1, -1});\nauto block_sym = Electron(N, group, irrep);\nXDIAG_SHOW(block_sym);\n\n// with symmetries and number conservation\nauto block_sym_np = Electron(N, nup, ndn, group, irrep);\nXDIAG_SHOW(block_sym_np);\n\nXDIAG_SHOW(block_sym_np.n_sites());\nXDIAG_SHOW(block_sym_np.size());\n\n// Iteration\nfor (auto pstate : block_sym_np) {\n  Log(\"{} {}\", to_string(pstate), block_sym_np.index(pstate));\n}\nXDIAG_SHOW(block_sym_np.permutation_group());\nXDIAG_SHOW(block_sym_np.irrep());\n
"},{"location":"documentation/blocks/spinhalf/","title":"Spinhalf","text":"

Representation of a block in a spin \\(S=1/2\\) Hilbert space.

Source spinhalf.hpp

"},{"location":"documentation/blocks/spinhalf/#constructors","title":"Constructors","text":"JuliaC++
Spinhalf(n_sites::Integer)\nSpinhalf(n_sites::Integer, n_up::Integer)\nSpinhalf(n_sites::Integer, group::PermutationGroup, irrep::Representation)\nSpinhalf(n_sites::Integer, n_up::Integer, group::PermutationGroup, \n         irrep::Representation)\n
Spinhalf(int64_t n_sites);\nSpinhalf(int64_t n_sites, int64_t n_up);\nSpinhalf(int64_t n_sites, PermutationGroup permutation_group,\n         Representation irrep);\nSpinhalf(int64_t n_sites, int64_t n_up, PermutationGroup group,\n         Representation irrep);\n
Name Description n_sites number of sites (integer) n_up number of \"up\" spin setting spin (integer) group PermutationGroup defining the permutation symmetries irrep Irreducible Representation of the symmetry group"},{"location":"documentation/blocks/spinhalf/#iteration","title":"Iteration","text":"

An Spinhalf block can be iterated over, where at each iteration a ProductState representing the corresponding basis state is returned.

JuliaC++
block = Spinhalf(4, 2)\nfor pstate in block\n    @show pstate, index(block, pstate) \nend\n
auto block = Spinhalf(4, 2);\nfor (auto pstate : block) {\n    Log(\"{} {}\", to_string(pstate), block.index(pstate));\n}\n
"},{"location":"documentation/blocks/spinhalf/#methods","title":"Methods","text":"

index

Returns the index of a given ProductState in the basis of the Spinhalf block.

JuliaC++
index(block::Spinhalf, pstate::ProductState)\n
int64_t index(ProductState const &pstate) const;\n

1-indexing

In the C++ version, the index count starts from \"0\" whereas in Julia the index count starts from \"1\".

n_sites

Returns the number of sites of the block.

JuliaC++
n_sites(block::Spinhalf)\n
int64_t n_sites() const;\n

n_up

Returns the number of \"up\" spins.

JuliaC++
n_up(block::Spinhalf)\n
int64_t n_up() const;\n

permutation_group

Returns the PermutationGroup of the block, if defined.

JuliaC++
permutation_group(block::Spinhalf)\n
PermutationGroup permutation_group() const;\n

irrep

Returns the Representation of the block, if defined.

JuliaC++
irrep(block::Spinhalf)\n
Representation irrep() const;\n

size

Returns the size of the block, i.e. its dimension.

JuliaC++
size(block::Spinhalf)\n
int64_t size() const;\n

dim

Returns the dimension of the block, same as \"size\" for non-distributed blocks.

JuliaC++
dim(block::Spinhalf)\n
int64_tdim() const;\n

isreal

Returns whether the block can be used with real arithmetic. Complex arithmetic is needed when a Representation is genuinely complex.

JuliaC++
isreal(block::Spinhalf; precision::Real=1e-12)\n
int64_t isreal(double precision = 1e-12) const;\n
"},{"location":"documentation/blocks/spinhalf/#usage-example","title":"Usage Example","text":"JuliaC++
N = 4\nnup = 2\n\n# without Sz conservation\nblock = Spinhalf(N)\n@show block\n\n\n# with Sz conservation\nblock_sz = Spinhalf(N, nup)\n@show block_sz\n\n# with symmetries, without Sz\np1 = Permutation([1, 2, 3, 4])\np2 = Permutation([2, 3, 4, 1])\np3 = Permutation([3, 4, 1, 2])\np4 = Permutation([4, 1, 2, 3])\ngroup = PermutationGroup([p1, p2, p3, p4])\nrep = Representation([1, -1, 1, -1])\nblock_sym = Spinhalf(N, group, rep)\n@show block_sym\n\n# with symmetries and Sz\nblock_sym_sz = Spinhalf(N, nup, group, rep)\n@show block_sym_sz\n\n@show n_sites(block_sym_sz)\n@show size(block_sym_sz)\n\n# Iteration\nfor pstate in block_sym_sz\n    @show pstate, index(block_sym_sz, pstate)\nend\n@show permutation_group(block_sym_sz)\n@show irrep(block_sym_sz)\n
int N = 4;\nint nup = 2;\n\n// without Sz conservation\nauto block = Spinhalf(N);\nXDIAG_SHOW(block);\n\n// with Sz conservation\nauto block_sz = Spinhalf(N, nup);\nXDIAG_SHOW(block_sz);\n\n// with symmetries, without Sz\nPermutation p1 = {0, 1, 2, 3};\nPermutation p2 = {1, 2, 3, 0};\nPermutation p3 = {2, 3, 0, 1};\nPermutation p4 = {3, 0, 1, 2};\nauto group = PermutationGroup({p1, p2, p3, p4});\nauto irrep = Representation({1, -1, 1, -1});\nauto block_sym = Spinhalf(N, group, irrep);\nXDIAG_SHOW(block_sym);\n\n// with symmetries and Sz\nauto block_sym_sz = Spinhalf(N, nup, group, irrep);\nXDIAG_SHOW(block_sym_sz);\n\nXDIAG_SHOW(block_sym_sz.n_sites());\nXDIAG_SHOW(block_sym_sz.size());\n\n// Iteration\nfor (auto pstate : block_sym_sz) {\n  Log(\"{} {}\", to_string(pstate), block_sym_sz.index(pstate));\n}\nXDIAG_SHOW(block_sym_sz.permutation_group());\nXDIAG_SHOW(block_sym_sz.irrep());\n
"},{"location":"documentation/blocks/tJ/","title":"tJ","text":"

Representation of a block in a \\(t-J\\) type Hilbert space.

Source tj.hpp

"},{"location":"documentation/blocks/tJ/#constructors","title":"Constructors","text":"JuliaC++
tJ(n_sites::Integer, n_up::Integer, n_dn::Integer)\ntJ(n_sites::Integer, n_up::Integer, n_dn::Integer, \n   group::PermutationGroup, irrep::Representation)\n
tJ(int64_t n_sites, int64_t n_up, int64_t n_dn);\ntJ(int64_t n_sites, int64_t n_up, int64_t n_dn, \n   PermutationGroup group, Representation irrep);\n
Name Description n_sites number of sites (integer) n_up number of \"up\" electrons (integer) n_dn number of \"dn\" electrons (integer) group PermutationGroup defining the permutation symmetries irrep Irreducible Representation of the symmetry group"},{"location":"documentation/blocks/tJ/#iteration","title":"Iteration","text":"

An tJ block can be iterated over, where at each iteration a ProductState representing the corresponding basis state is returned.

JuliaC++
block = tJ(4, 2, 1)\nfor pstate in block\n    @show pstate, index(block, pstate) \nend\n
auto block = tJ(4, 2, 1);\nfor (auto pstate : block) {\n    Log(\"{} {}\", to_string(pstate), block.index(pstate));\n}\n
"},{"location":"documentation/blocks/tJ/#methods","title":"Methods","text":"

index

Returns the index of a given ProductState in the basis of the tJ block.

JuliaC++
index(block::tJ, pstate::ProductState)\n
int64_t index(ProductState const &pstate) const;\n

1-indexing

In the C++ version, the index count starts from \"0\" whereas in Julia the index count starts from \"1\".

n_sites

Returns the number of sites of the block.

JuliaC++
n_sites(block::tJ)\n
int64_t n_sites() const;\n

n_up

Returns the number of \"up\" electrons.

JuliaC++
n_up(block::tJ)\n
int64_t n_up() const;\n

n_dn

Returns the number of \"down\" electrons.

JuliaC++
n_dn(block::tJ)\n
int64_t n_dn() const;\n

permutation_group

Returns the PermutationGroup of the block, if defined.

JuliaC++
permutation_group(block::tJ)\n
PermutationGroup permutation_group() const;\n

irrep

Returns the Representation of the block, if defined.

JuliaC++
irrep(block::tJ)\n
Representation irrep() const;\n

size

Returns the size of the block, i.e. its dimension.

JuliaC++
size(block::tJ)\n
int64_t size() const;\n

dim

Returns the dimension of the block, same as \"size\" for non-distributed blocks.

JuliaC++
dim(block::tJ)\n
int64_tdim() const;\n

isreal

Returns whether the block can be used with real arithmetic. Complex arithmetic is needed when a Representation is genuinely complex.

JuliaC++
isreal(block::tJ; precision::Real=1e-12)\n
int64_t isreal(double precision = 1e-12) const;\n
"},{"location":"documentation/blocks/tJ/#usage-example","title":"Usage Example","text":"JuliaC++
N = 4\nnup = 2\nndn = 1\n\n# without permutation symmetries\nblock = tJ(N, nup, ndn)\n@show block\n\n# with permutation symmetries\np1 = Permutation([1, 2, 3, 4])\np2 = Permutation([2, 3, 4, 1])\np3 = Permutation([3, 4, 1, 2])\np4 = Permutation([4, 1, 2, 3])\ngroup = PermutationGroup([p1, p2, p3, p4])\nrep = Representation([1, -1, 1, -1])\nblock_sym = tJ(N, nup, ndn, group, rep)\n@show block_sym\n\n@show n_sites(block_sym)\n@show size(block_sym)\n\n# Iteration\nfor pstate in block_sym\n    @show pstate, index(block_sym, pstate)\nend\n@show permutation_group(block_sym)\n@show irrep(block_sym)\n
int N = 4;\nint nup = 2;\nint ndn = 1;\n\n// without permutation symmetries\nauto block = tJ(N, nup, ndn);\nXDIAG_SHOW(block);\n\n// with permutation symmetries\nauto p1 = Permutation({0, 1, 2, 3});\nauto p2 = Permutation({1, 2, 3, 0});\nauto p3 = Permutation({2, 3, 0, 1});\nauto p4 = Permutation({3, 0, 1, 2});\nauto group = PermutationGroup({p1, p2, p3, p4});\nauto irrep = Representation({1, -1, 1, -1});\nauto block_sym = tJ(N, nup, ndn, group, irrep);\nXDIAG_SHOW(block_sym);\n\nXDIAG_SHOW(block_sym.n_sites());\nXDIAG_SHOW(block_sym.size());\n\n// Iteration\nfor (auto pstate : block_sym) {\n  Log(\"{} {}\", to_string(pstate), block_sym.index(pstate));\n}\nXDIAG_SHOW(block_sym.permutation_group());\nXDIAG_SHOW(block_sym.irrep());\n
"},{"location":"documentation/operators/coupling/","title":"Coupling","text":"

Describes the coupling of a local operator. A coupling can either be a string, a real/complex number or even a real/complex matrix. It allows for converting to real/complex numbers or matrices as well as strings, whenever this conversion is sensible.

Source coupling.hpp

"},{"location":"documentation/operators/coupling/#constructors","title":"Constructors","text":"JuliaC++
Coupling(name::String)\nCoupling(val::Float64)\nCoupling(val::ComplexF64)\nCoupling(mat::Matrix{Float64})\nCoupling(mat::Matrix{ComplexF64})\n
Coupling(std::string value);\nCoupling(double value);\nCoupling(complex value);\nCoupling(arma::mat const &value);\nCoupling(arma::cx_mat const &value);\n
"},{"location":"documentation/operators/coupling/#methods","title":"Methods","text":"

type

Returns the type of the Coupling, i.e. a string which either reads \"string\", \"double\", \"complex\", \"mat\", or \"cx_mat\"

JuliaC++
type(cpl::Coupling)\n
std::string type() const;\n

isreal

Returns whether or not the coupling is real. Throws an error if the coupling is given as a string, since then it cannot be determined whether the operator is real.

JuliaC++
isreal(cpl::Coupling)\n
bool isreal() const;\n

ismatrix

Returns whether or not the coupling is defined as a matrix. Throws an error if the coupling is given as a string, since then it cannot be determined whether the operator is real.

JuliaC++
ismatrix(cpl::Coupling)\n
bool ismatrix() const;\n

isexplicit

Returns false if the coupling is defined as a string, otherwise true

JuliaC++
isexplicit(cpl::Coupling)\n
bool isexplicit() const;\n
"},{"location":"documentation/operators/coupling/#conversions","title":"Conversions","text":"

A Coupling can be converted to the values it represents, so a string, real/complex number or a real/complex matrix. Initially real values can be cast to complex.

JuliaC++
convert(::Type{String}, cpl::Coupling)\nconvert(::Type{Float64}, cpl::Coupling)\nconvert(::Type{ComplexF64}, cpl::Coupling)\nconvert(::Type{Matrix{Float64}}, cpl::Coupling)\nconvert(::Type{Matrix{ComplexF64}}, cpl::Coupling)\n
template <typename coeff_t> coeff_t as() const;\n
"},{"location":"documentation/operators/coupling/#usage-example","title":"Usage Example","text":"JuliaC++
cpl = Coupling(\"J\")\n@show type(cpl)\n@show isexplicit(cpl)\n\ncpl = Coupling(1.23)\n@show ismatrix(cpl)\n@show convert(Float64, cpl)\n@show convert(ComplexF64, cpl)\n\ncpl = Coupling([1 2; -2 1])\n@show ismatrix(cpl)\n@show isreal(cpl)\n@show convert(Matrix{Float64}, cpl)\n@show convert(Matrix{ComplexF64}, cpl)\n
auto cpl = Coupling(\"J\");\nXDIAG_SHOW(cpl.type());\nXDIAG_SHOW(cpl.isexplicit());\n\ncpl = Coupling(1.23);\nXDIAG_SHOW(cpl.ismatrix());\nXDIAG_SHOW(cpl.as<double>());\nXDIAG_SHOW(cpl.as<complex>());\n\ncpl = Coupling(arma::mat(\"1 2; -2 1\"));\nXDIAG_SHOW(cpl.ismatrix());\nXDIAG_SHOW(cpl.isreal());\nXDIAG_SHOW(cpl.as<arma::mat>());\nXDIAG_SHOW(cpl.as<arma::cx_mat>());\n
"},{"location":"documentation/operators/op/","title":"Op","text":"

A local operator acting on several lattice sites.

Source op.hpp

"},{"location":"documentation/operators/op/#constructors","title":"Constructors","text":"JuliaC++
Op(type::String, coupling::String, sites::Vector{Int64})\nOp(type::String, coupling::String, site::Int64)\n\nOp(type::String, coupling::Float64, sites::Vector{Int64})\nOp(type::String, coupling::Float64, site::Int64)\n\nOp(type::String, coupling::ComplexF64, sites::Vector{Int64})\nOp(type::String, coupling::ComplexF64, site::Int64)\n\nOp(type::String, coupling::Matrix{Float64}, sites::Vector{Int64})\nOp(type::String, coupling::Matrix{Float64}, site::Int64)\n\nOp(type::String, coupling::Matrix{ComplexF64}, sites::Vector{Int64})\nOp(type::String, coupling::Matrix{ComplexF64}, site::Int64)\n
Op(std::string type, std::string coupling, std::vector<int64_t> const &sites)\nOp(std::string type, std::string coupling, int64_t site)\n\nOp(std::string type, double coupling, std::vector<int64_t> const &sites)\nOp(std::string type, double coupling, int64_t site)\n\nOp(std::string type, complex coupling, std::vector<int64_t> const &sites)\nOp(std::string type, complex coupling, int64_t site)\n\nOp(std::string type, arma::mat const &coupling, std::vector<int64_t> const &sites)\nOp(std::string type, arma::mat const &coupling, int64_t site)\n\nOp(std::string type, arma::cx_mat const &coupling, std::vector<int64_t> const &sites)\nOp(std::string type, arma::cx_mat const &coupling, int64_t site)\n
Parameter Description type a string which denotes what kind of operator is represented coupling sets the coefficients neded to specify the coupling. Further details below sites defines on which site(s) of the lattice the operator acts on.

1-indexing in Julia / 0-indexing in C++

To enumerate the sites of an Op, we start counting at 1 in Julia and 0 in C++.

The coupling can take on several types and allow some flexibility in defining operators.

type Description string the coupling is represented as a string, e.g. \"\\(t\\)\" or \"\\(J\\)\" in a \\(t-J\\) model real/cplx number the actual numerical value of the coupling real/cplx matrix more generic interactions can be specified as matrices"},{"location":"documentation/operators/op/#methods","title":"Methods","text":"

type

Returns the type of the operator

JuliaC++
type(op::Op)\n
std::string type() const;\n

coupling

Returns the coupling of the operator

JuliaC++
coupling(op::Op)\n
Coupling const &coupling() const;\n

This returns an object of type Coupling, which can then be converted to an appropriate type.

size

Returns how many sites the operator is defined on

JuliaC++
size(op::Op)\n
int64_t size() const;\n

getindex / operator[]

Returns the site with the given index.

JuliaC++
getindex(op::Op, idx::Int64)\n
int64_t operator[](int64_t idx) const;\n

sites

Returns all the sites the operator is defined on

JuliaC++
sites(op::Op)\n
std::vector<int64_t> const &sites() const;\n

isreal

Returns whether or not the coupling is real. Throws an error if the coupling is given as a string, since then it cannot be determined whether the operator is real.

JuliaC++
isreal(op::Op)\n
bool isreal() const;\n

ismatrix

Returns whether or not the coupling is defined as a matrix. Throws an error if the coupling is given as a string, since then it cannot be determined whether the operator is real.

JuliaC++
ismatrix(op::Op)\n
bool ismatrix() const;\n

isexplicit

Returns false if the coupling is defined as a string, otherwise true

JuliaC++
isexplicit(op::Op)\n
bool isexplicit() const;\n
"},{"location":"documentation/operators/op/#usage-example","title":"Usage Example","text":"JuliaC++
op = Op(\"HOP\", \"T\", [1, 2])\n@show op\n@show type(op)\n@show convert(String, coupling(op))\n@show size(op), op[1], op[2]\n@show sites(op) == [1, 2]\n@show isexplicit(op)\n\nop = Op(\"HOP\", 1.23, [1, 2])\n@show op\n@show isreal(op)\n@show ismatrix(op)\n@show isexplicit(op)\n\nop = Op(\"SY\", [0 -im; im 0], 1)\n@show op\n@show isreal(op)\n@show ismatrix(op)\n@show isexplicit(op)\n
auto op = Op(\"HOP\", \"T\", {0, 1});\nXDIAG_SHOW(op);\nXDIAG_SHOW(op.type());\nXDIAG_SHOW(op.coupling().as<std::string>());\nXDIAG_SHOW(op.size());\nXDIAG_SHOW(op[0]);\nXDIAG_SHOW(op[1]);\nXDIAG_SHOW(op.isexplicit());\n\n op = Op(\"HOP\", 1.23, {0, 1});\nXDIAG_SHOW(op);\nXDIAG_SHOW(op.isreal());\nXDIAG_SHOW(op.ismatrix());\nXDIAG_SHOW(op.isexplicit());\n\narma::cx_mat m(arma::mat(\"0 0; 0 0\"), arma::mat(\"0 -1; 1 0\"));\nop = Op(\"SY\", m, 0);\nXDIAG_SHOW(op);\nXDIAG_SHOW(op.isreal());\nXDIAG_SHOW(op.ismatrix());\nXDIAG_SHOW(op.isexplicit());\n
"},{"location":"documentation/operators/opsum/","title":"OpSum","text":"

A sum of local operators acting on several lattice sites.

Source opsum.hpp

"},{"location":"documentation/operators/opsum/#constructor","title":"Constructor","text":"JuliaC++
OpSum()\nOpSum(ops::Vector{Op})\n
OpSum() = default;\nOpSum(std::vector<Op> const &ops);\n
Parameter Description ops a vector of Op objects describing the operators summed over"},{"location":"documentation/operators/opsum/#methods","title":"Methods","text":"

size

Returns the number of local Op operators.

JuliaC++
size(ops::OpSum)\n
int64_t size() const;\n

defined

Returns bool whether a coupling (of type string) is defined

JuliaC++
defined(ops::OpSum, name::String)\n
bool defined(std::string name) const;\n

setindex! / operator[]

Sets a coupling given as a string to a certain numerical value or matrix

JuliaC++
Base.setindex!(ops::OpSum, cpl, name::String)\n
Coupling &operator[](std::string name);\n

getindex / operator[]

Returns the value of a Coupling defined as a string.

JuliaC++
getindex(ops::OpSum, name::String)\n
Coupling const &operator[](std::string name) const;\n

couplings

Returns all the possible names of Coupling as a vector of strings

JuliaC++
couplings(ops::OpSum)\n
std::vector<std::string> couplings() const;\n

isreal

Returns whether or not the OpSum is real. This will throw an error if some Coupling are only defined as a string.

JuliaC++
isreal(ops::OpSum)\n
bool isreal() const;\n

isexplicit

Returns false if there exist a Coupling which is defined as a string, otherwise true.

JuliaC++
isexplicit(ops::OpSum)\n
bool isexplicit() const;\n

operator +

Adds a single Op or a full OpSum

JuliaC++
+(ops::OpSum, op2::Op) = OpSum(ops.cxx_opsum + op2.cxx_op)\n+(ops::OpSum, ops2::OpSum) = OpSum(ops.cxx_opsum + ops2.cxx_opsum)\n
void operator+=(Op const &op);\nvoid operator+=(OpSum const &ops);\nOpSum operator+(Op const &op) const;\nOpSum operator+(OpSum const &ops) const;\n
"},{"location":"documentation/operators/opsum/#usage-example","title":"Usage Example","text":"JuliaC++
# Define the 1D transverse-field Ising chain\nlet \n    N = 12\n    J = 1.0\n    h = 0.5\n    Sx = [0 1; 1 0]\n\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"ISING\", \"J\", [i, mod1(i+1, N)])\n        ops += Op(\"SX\", h * Sx, i)\n    end\n\n    ops[\"J\"] = 1.0;\n    @show ops\n    @show defined(ops, \"J\")\n    @show isreal(ops)\n    @show isexplicit(ops)\nend\n
// Define the 1D transverse-field Ising chain\nint N = 12;\ndouble J = 1.0;\ndouble h = 0.5;\nauto Sx = arma::mat(\"0 1; 1 0\");\n\nauto ops = OpSum();\nfor (int i = 0; i<N; ++i) {\n  ops += Op(\"ISING\", \"J\", {i, (i+1)%N});\n  ops += Op(\"SX\", arma::mat(h*Sx), i);\n}\nops[\"J\"] = 1.0;\nXDIAG_SHOW(ops);\nXDIAG_SHOW(ops.defined(\"J\"));\nXDIAG_SHOW(ops.isreal());\nXDIAG_SHOW(ops.isexplicit());\n
"},{"location":"documentation/operators/symmetrize/","title":"symmetrize","text":"

Symmetrizes an operator with respect to a permutation symmetry group.

Source symmetrize.hpp

JuliaC++
symmetrize(op::Op, group::PermutationGroup)\nsymmetrize(op::Op, group::PermutationGroup, irrep::Representation)\nsymmetrize(ops::OpSum, group::PermutationGroup)\nsymmetrize(ops::OpSum, group::PermutationGroup, irrep::Representation)\n
OpSum symmetrize(Op const &op, PermutationGroup const &group);\nOpSum symmetrize(Op const &op, PermutationGroup const &group, Representation const &irrep);\nOpSum symmetrize(OpSum const &ops, PermutationGroup const &group);\nOpSum symmetrize(OpSum const &ops, PermutationGroup const &group, Representation const &irrep);\n
"},{"location":"documentation/operators/symmetrize/#parameters","title":"Parameters","text":"Name Description ops / op OpSum or Op defining the operator to be symmetrized group PermutationGroup defining the permutation symmetries irrep Irreducible Representation of the symmetry group

Symmetrization in this context means the following. In general, we are given an OpSum of the form,

\\[ O = \\sum_{A\\subseteq \\mathcal{L}} O_A,\\]

where \\(O_A\\) denotes a local operator acting on sites \\(A=\\{a_1, \\ldots, a_{l_A}\\}\\) and \\(L\\) denotes the lattice. A PermutationGroup \\(\\mathcal{G}\\) is defined through its permutations \\(\\pi_1, \\ldots, \\pi_M\\). The symmetrized operator returned by this function is then

\\[ O^\\mathcal{G} = \\frac{1}{M}\\sum_{A\\subseteq \\mathcal{L}} \\sum_{\\pi \\in \\mathcal{G}} O_{\\pi(A)},\\]

where \\(\\pi(A) = \\{\\pi(a_1), \\ldots,\\pi(a_{l_A})\\}\\) denotes the permutated set of sites of the local operator \\(O_A\\). If a Representation called \\(\\rho\\) is given in addition, the following operator is constructed,

\\[ O^\\mathcal{G, \\rho} = \\frac{1}{M}\\sum_{A\\subseteq \\mathcal{L}} \\sum_{\\pi \\in \\mathcal{G}} \\chi_\\rho(\\pi) O_{\\pi(A)},\\]

where \\(\\chi_\\rho(\\pi)\\) denotes the characters of the representation \\(\\rho\\). This routine is useful to evaluate observables in symmetrized blocks.

"},{"location":"documentation/operators/symmetrize/#usage-example","title":"Usage Example","text":"JuliaC++
let\n    N = 4\n    nup = 2\n    block = Spinhalf(N, nup)\n    p1 = Permutation([1, 2, 3, 4])\n    p2 = Permutation([2, 3, 4, 1])\n    p3 = Permutation([3, 4, 1, 2])\n    p4 = Permutation([4, 1, 2, 3])\n    group = PermutationGroup([p1, p2, p3, p4])\n    rep = Representation([1, 1, 1, 1])\n    block_sym = Spinhalf(N, group, rep)\n\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", 1.0, [i, mod1(i+1, N)])\n    end\n\n    e0, psi = eig0(ops, block);\n    e0, psi_sym = eig0(ops, block_sym);\n\n    corr = Op(\"HB\", 1.0, [1, 2])\n    nn_corr = inner(corr, psi)\n    corr_sym = symmetrize(corr, group)\n    nn_corr_sym = inner(corr_sym, psi_sym)\n    @show nn_corr, nn_corr_sym\nend\n
int N = 4;\nint nup = 2;\nauto block = Spinhalf(N, nup);\nauto p1 = Permutation({0, 1, 2, 3});\nauto p2 = Permutation({1, 2, 3, 0});\nauto p3 = Permutation({2, 3, 0, 1});\nauto p4 = Permutation({3, 0, 1, 2});\nauto group = PermutationGroup({p1, p2, p3, p4});\nauto rep = Representation({1, 1, 1, 1});\nauto block_sym = Spinhalf(N, group, rep);\n\nauto ops = OpSum();\nfor (int i=0; i<N; ++i) {\n  ops += Op(\"HB\", 1.0, {i, (i+1)%N});\n}\nauto [e0, psi] = eig0(ops, block);\nauto [e0s, psi_sym] = eig0(ops, block_sym);\n\nauto corr = Op(\"HB\", 1.0, {0, 1});\nauto nn_corr = inner(corr, psi);\nauto corr_sym = symmetrize(corr, group);\nauto nn_corr_sym = innerC(corr_sym, psi_sym);\nXDIAG_SHOW(nn_corr);\nXDIAG_SHOW(nn_corr_sym);\n
"},{"location":"documentation/states/create_state/","title":"Functions to create and modify states","text":"

Source create_state.hpp

"},{"location":"documentation/states/create_state/#product","title":"product","text":"

Creates a filled product state.

JuliaC++
product(block::Block, local_states::Vector{String}, real::Bool=true)\n
State product(Block const &block, std::vector<std::string> const &local_state, bool real = true);\n
"},{"location":"documentation/states/create_state/#parameters","title":"Parameters","text":"Name Description block block on which the state is defined local_states local configurations of the product state real flag whether real state is created"},{"location":"documentation/states/create_state/#rand","title":"rand","text":"

Create a filled random state with normal distributed coefficients.

JuliaC++
rand(block::Block, real::Bool=true, seed::Int64=42, normalized::Bool=true\n
State rand(Block const &block, bool real = true, int64_t seed = 42, bool normalized = true);\n
"},{"location":"documentation/states/create_state/#parameters_1","title":"Parameters","text":"Name Description block block on which the state is defined real flag whether real state is created seed random seed determining the precise random numbers normalized flag whether the state is normalized"},{"location":"documentation/states/create_state/#zeros","title":"zeros","text":"

Create a filled state with all zero entries.

JuliaC++
zeros(block::Block, real::Bool=true, n_col::Int64=1)\n
State zeros(Block const &block, bool real = true, int64_t n_cols = 1);\n
"},{"location":"documentation/states/create_state/#parameters_2","title":"Parameters","text":"Name Description block block on which the state is defined real flag whether real state is created n_col number of columns in the state"},{"location":"documentation/states/create_state/#zero","title":"zero","text":"

Set all coefficients of a given state to zero.

JuliaC++
zero(state::State)\n
void zero(State &state);\n
"},{"location":"documentation/states/create_state/#usage-example","title":"Usage Example","text":"JuliaC++
block = Spinhalf(2)\nstate = product(block, [\"Up\", \"Dn\"])\ndisplay(vector(state))\n\nzero(state)\ndisplay(vector(state))\n\nstate = rand(block, false, 1234, true)\ndisplay(vector(state))\n\nstate = zeros(block, true, 2)\ndisplay(matrix(state))\n
auto block = Spinhalf(2);\nauto state = product(block, {\"Up\", \"Dn\"});\nXDIAG_SHOW(state.vector());\n\nzero(state);\nXDIAG_SHOW(state.vector());\n\nstate = rand(block, false, 1234, true);\nXDIAG_SHOW(state.vectorC());\n\nstate = zeros(block, true, 2);\nXDIAG_SHOW(state.vector());\n
"},{"location":"documentation/states/fill/","title":"fill","text":"

Fills a State with a given model state, e.g. a ProductState or a RandomState.

Source fill.hpp

"},{"location":"documentation/states/fill/#definition","title":"Definition","text":"JuliaC++
fill(state::State, pstate::ProductState, ncol::Int64 = 1)\nfill(state::State, rstate::RandomState, ncol::Int64 = 1)\n
void fill(State &state, ProductState const &pstate, int64_t ncol = 0);\nvoid fill(State &state, RandomState const &rstate, int64_t ncol = 0);\n
"},{"location":"documentation/states/fill/#parameters","title":"Parameters","text":"Name Description state State object to be filled pstate ProductState object rstate RandomState object ncol integer deciding which column of the State is filled (default: 1/0 (Julia/C++))"},{"location":"documentation/states/fill/#usage-example","title":"Usage Example","text":"JuliaC++
block = Spinhalf(2)\nstate = State(block)\npstate = ProductState([\"Up\", \"Dn\"])\nfill(state, pstate)\ndisplay(vector(state))\n\nrstate = RandomState(1234)\nfill(state, rstate)\ndisplay(vector(state))\n
auto block = Spinhalf(2);\nauto state = State(block);  \nauto pstate = ProductState({\"Up\", \"Dn\"});\nfill(state, pstate);\nXDIAG_SHOW(state.vector());\n\nauto rstate = RandomState(1234);\nfill(state, rstate);\nXDIAG_SHOW(state.vector());\n
"},{"location":"documentation/states/product_state/","title":"ProductState","text":"

A product state of local configurations

Source product_state.hpp

"},{"location":"documentation/states/product_state/#constructors","title":"Constructors","text":"JuliaC++
ProductState(n_sites::Int64)\nProductState(local_states::Vector{String})\n
ProductState(int64_t n_sites);\nProductState(std::vector<std::string> const &local_states);\n
Parameter Description n_sites construct a product state on n_sites local_states the local configurations of the product state"},{"location":"documentation/states/product_state/#iteration","title":"Iteration","text":"

A Product state can be iterated over, where at each iteration the string of the local configuration is retured. Here is an example:

JuliaC++
pstate = ProductState([\"Up\", \"Dn\", \"Emp\", \"UpDn\"])\nfor s in pstate\n    @show s\nend\n
auto pstate = ProductState({\"Up\", \"Dn\", \"Emp\", \"UpDn\"});\nfor (auto s : pstate) {\n    Log(\"{}\", s);\n}\n
"},{"location":"documentation/states/product_state/#methods","title":"Methods","text":"

n_sites

Returns the number of sites of the product state

JuliaC++
n_sites(state::ProductState)\n
int64_t n_sites() const\n

size

Returns the number of sites of the product state. Same as \"n_sites\".

JuliaC++
size(state::ProductState)\n
int64_t size() const\n

setindex! / operator[]

Sets the local configuration at the given site index to the given string.

JuliaC++
setindex!(state::ProductState, local_state::String, idx::Int64)\n
std::string &operator[](int64_t i);\n

getindex / operator[]

Returns the string of the local configuration at the given site index.

JuliaC++
getindex(state::ProductState, idx::Int64)\n
std::string const &operator[](int64_t i) const;\n

push! / push_back

Adds a local configuration add the end of the product state.

JuliaC++
push!(state::ProductState, local_state::String\n
void push_back(std::string l);\n
"},{"location":"documentation/states/product_state/#usage-example","title":"Usage Example","text":"JuliaC++
pstate = ProductState([\"Up\", \"Dn\", \"Emp\", \"UpDn\"])\nfor s in pstate\n    @show s\nend\n@show pstate\n\npstate = ProductState()\npush!(pstate, \"Dn\")\npush!(pstate, \"Up\")\npush!(pstate, \"Dn\")\n@show n_sites(pstate)\nfor s in pstate\n    @show s\nend\n@show pstate\n
auto pstate = ProductState({\"Up\", \"Dn\", \"Emp\", \"UpDn\"});\nfor (auto s : pstate) {\n  Log(\"{}\", s);\n}\nXDIAG_SHOW(to_string(pstate));\n\npstate = ProductState();\npstate.push_back(\"Dn\");\npstate.push_back(\"Up\");\npstate.push_back(\"Dn\");\nXDIAG_SHOW(pstate.n_sites());\nfor (auto s : pstate) {\n  Log(\"{}\", s);\n}\nXDIAG_SHOW(to_string(pstate));\n
"},{"location":"documentation/states/random_state/","title":"RandomState","text":"

A random state with normal distributed coefficients

Source random_state.hpp

"},{"location":"documentation/states/random_state/#constructors","title":"Constructors","text":"JuliaC++
RandomState(seed::Int64 = 42, normalized::Bool = true)\n
RandomState(int64_t seed = 42, bool normalized = true);\n
Parameter Description seed random seed determining which random numbers are put normalized flag whether the State is normalized"},{"location":"documentation/states/random_state/#methods","title":"Methods","text":"

seed

Returns the seed of the random state

JuliaC++
seed(state::RandomState)\n
int64_t seed() const;\n

size

Returns whether the state is normalized.

JuliaC++
normalized(state::RandomState)\n
bool normalized() const;\n
"},{"location":"documentation/states/random_state/#usage-example","title":"Usage Example","text":"JuliaC++
block = Spinhalf(2)\nstate = State(block, real=false)  # complex State\nrstate1 = RandomState(1234)\nfill(state, rstate1)\ndisplay(vector(state))\n\nrstate2 = RandomState(4321)\nfill(state, rstate2)\ndisplay(vector(state))\n\nfill(state, rstate1)\ndisplay(vector(state))\n
auto block = Spinhalf(2);\nauto state = State(block, false);  // complex State\nauto rstate1 = RandomState(1234);\nfill(state, rstate1);\nXDIAG_SHOW(state.vectorC());\n\nauto rstate2 = RandomState(4321);\nfill(state, rstate2);\nXDIAG_SHOW(state.vectorC());\n\nfill(state, rstate1);\nXDIAG_SHOW(state.vectorC());\n
"},{"location":"documentation/states/state/","title":"State","text":"

A generic state describing a quantum wave function

Source state.hpp

"},{"location":"documentation/states/state/#constructors","title":"Constructors","text":"JuliaC++
State(block::Block; real::Bool = true, n_cols::Int64 = 1)\nState(block::Block, vec::Vector{Float64})\nState(block::Block, vec::Vector{ComplexF64})\nState(block::Block, mat::Matrix{Float64})\nState(block::Block, mat::Matrix{ComplexF64})\n
State(Block const &block, bool real = true, int64_t n_cols = 1);\n\ntemplate <typename block_t, typename coeff_t>\nState(block_t const &block, arma::Col<coeff_t> const &vector);\n\ntemplate <typename block_t, typename coeff_t>\nState(block_t const &block, arma::Mat<coeff_t> const &matrix);\n
Parameter Description block The block of a Hilbertspace on which the state is defined real Flag whether or not the state has real coefficients n_cols Number of columns of the state (default 1) vector A vector containing the coefficients of the state. Must be same size as block. matrix A matrix containing the coefficients of the state. Number of rows must be same as block size ."},{"location":"documentation/states/state/#methods","title":"Methods","text":"

n_sites

Returns the number of sites of the block the state is defined on.

JuliaC++
n_sites(state::State)\n
int64_t n_sites() const\n

isreal

Returns whether the state is real.

JuliaC++
isreal(state::State)\n
int64_t isreal() const;\n

real

Returns whether the real part of the State.

JuliaC++
real(state::State)\n
State real() const;\n

imag

Returns whether the imaginary part of the State.

JuliaC++
imag(state::State)\n
State imag() const;\n

make_complex! / make_complex

Turns a real State into a complex State. Does nothing if the state is already complex

JuliaC++
make_complex!(state::State)\n
void make_complex();\n

dim

Returns the dimension of the block the state is defined on.

JuliaC++
dim(block::Spinhalf)\n
int64_t dim() const;\n

size

Returns the size of the block the state is defined on. locally. Same as \"dim\" for non-distributed Blocks but different for distributed blocks.

JuliaC++
size(block::Spinhalf)\n
int64_t size() const;\n

n_rows

Returns number of rows of the local storage. Same as \"size\"

JuliaC++
n_rows(block::Spinhalf)\n
int64_t n_rows() const;\n

n_cols

Returns number of columns of the local storage.

JuliaC++
n_cols(block::Spinhalf)\n
int64_t n_cols() const;\n

col

Returns a state created from the n-th column of the storage. Whether or not the storage is copied can be specified by setting the flag \"copy\".

JuliaC++
col(state::State, n::Int64 = 1; copy::Bool = true)\n
State col(int64_t n, bool copy = true) const;\n

vector/vectorC

Returns a vector from the n-th column of the storage. In C++ use \"vector\"/\"vectorC\" to either get a real or complex vector.

JuliaC++
vector(state::State; n::Int64 = 1)\n# no vectorC method in julia\n
arma::vec vector(int64_t n = 0, bool copy = true) const;\narma::cx_vec vectorC(int64_t n = 0, bool copy = true) const;\n

matrix/matrixC

Returns matrix representing the storage. In C++ use \"matrix\"/\"matrixC\" to either get a real or complex matrix.

JuliaC++
matrix(state::State)\n# no matrixC method in julia\n
arma::vec matrix(bool copy = true) const;\narma::cx_vec matrixC(bool copy = true) const;\n
"},{"location":"documentation/states/state/#usage-example","title":"Usage Example","text":"JuliaC++
block = Spinhalf(2)\npsi1 = State(block, [1.0, 2.0, 3.0, 4.0])\n@show psi1\ndisplay(vector(psi1))\nmake_complex!(psi1)\ndisplay(vector(psi1))\n\npsi2 = State(block, real=false, n_cols=3)\n@show psi2\ndisplay(matrix(psi2))\n\npsi3 = State(block, [1.0+4.0im, 2.0+3.0im, 3.0+2.0im, 4.0+1.0im])\ndisplay(vector(psi3))\ndisplay(vector(real(psi3)))\ndisplay(vector(imag(psi3)))\n
auto block = Spinhalf(2);\nauto psi1 = State(block, arma::vec(\"1.0 2.0 3.0 4.0\"));\nXDIAG_SHOW(psi1);\nXDIAG_SHOW(psi1.vector());\npsi1.make_complex();\nXDIAG_SHOW(psi1.vectorC());\n\nauto psi2 = State(block, false, 3);\nXDIAG_SHOW(psi2);\nXDIAG_SHOW(psi2.matrixC());\n\nauto psi3 = State(block, arma::cx_vec(arma::vec(\"1.0 2.0 3.0 4.0\"),\n                      arma::vec(\"4.0 3.0 2.0 1.0\")));\nXDIAG_SHOW(psi3.vectorC());\nXDIAG_SHOW(psi3.real().vector());\nXDIAG_SHOW(psi3.imag().vector());\n
"},{"location":"documentation/symmetries/permutation/","title":"Permutation","text":"

Permutations of indices or lattice sites

Source permutation.hpp

"},{"location":"documentation/symmetries/permutation/#constructors","title":"Constructors","text":"

Creates an Permutation out of an array of integers, e.g. [0, 2, 1, 3]. If the input array is of size N then every number between 0 and N-1 must occur exactly once, otherwise the Permutation is invalid.

JuliaC++
Permutation(array::Vector{Int64})\n
Permutation(std::vector<int64_t> const &array);\n

1-indexing in Julia / 0-indexing in C++

To enumerate the sites of a Permutation, we start counting at 1 in Julia and 0 in C++.

"},{"location":"documentation/symmetries/permutation/#methods","title":"Methods","text":"

inverse

Computes the inverse permutation.

JuliaC++
inverse(perm::Permutation)\n
// As a member function\nPermutation inverse() const;\n\n// As a non-member function\nPermutation inverse(Permutation const &p);\n

\"*\" operator

Concatenates two permutations by overloading the * operator.

JuliaC++
Base.:*(p1::Permutation, p2::Permutation)\n
Permutation operator*(Permutation const &p1, Permutation const &p2);\n

size

Returns the size of the permutation, i.e. the number of indices being permuted.

JuliaC++
size(perm::Permutation)\n
// As a member function\nint64_t size() const;\n\n// As a non-member function\nint64_t size(Permutation const &p);\n
"},{"location":"documentation/symmetries/permutation/#usage-example","title":"Usage Example","text":"JuliaC++
p1 = Permutation([1, 3, 2, 4])\np2 = Permutation([3, 1, 2, 4])\n\n@show inverse(p1)\n@show p1 * p2\n
Permutation p1 = {0, 2, 1, 3};\nPermutation p2 = {2, 0, 1, 3};\n\nXDIAG_SHOW(inverse(p1));\nXDIAG_SHOW(p1*p2);\n
"},{"location":"documentation/symmetries/permutation_group/","title":"Permutation","text":"

A group of permutations

Source permutation_group.hpp

"},{"location":"documentation/symmetries/permutation_group/#constructor","title":"Constructor","text":"

Creates an PermutationGroup out of a vector of Permutation objects.

JuliaC++
PermutationGroup(permutations::Vector{Permutation})\n
PermutationGroup(std::vector<Permutation> const &permutations);\n
"},{"location":"documentation/symmetries/permutation_group/#methods","title":"Methods","text":"

n_sites

Returns the number of sites on which the permutations of the group acts.

JuliaC++
n_sites(group::PermutationGroup)\n
int64_t n_sites() const\n

size

Returns the size of the permutation group, i.e. the number permutations

JuliaC++
size(group::PermutationGroup)\n
int64_t size() const;\n

inverse

Given an index of a permutation, it returns the index of the inverse permutation.

JuliaC++
inverse(group::PermutationGroup, idx::Integer)\n
// As a member function\nint64_t inverse(int64_t sym) const;\n
"},{"location":"documentation/symmetries/permutation_group/#usage-example","title":"Usage Example","text":"JuliaC++
# Define a cyclic group of order 3\np1 = Permutation([1, 2, 3])\np2 = Permutation([2, 3, 1])\np3 = Permutation([3, 1, 2])\nC3 = PermutationGroup([p1, p2, p3])\n\n@show size(C3)\n@show n_sites(C3)\n@show inverse(C3, 1) # = 2\n
// Define a cyclic group of order 3\nPermutation p1 = {0, 1, 2};\nPermutation p2 = {1, 2, 0};\nPermutation p3 = {2, 0, 1};\nauto C3 = PermutationGroup({p1, p2, p3});\n\nXDIAG_SHOW(C3.size());\nXDIAG_SHOW(C3.n_sites());\nXDIAG_SHOW(C3.inverse(1)); // = 2\n
"},{"location":"documentation/symmetries/representation/","title":"Representation","text":"

A (1D) irreducible representation of a finite group.

Source representation.hpp

"},{"location":"documentation/symmetries/representation/#constructors","title":"Constructors","text":"

Creates a Representation from a vector of complex numbers

JuliaC++
Representation(characters::Vector{<:Number})\n
Representation(std::vector<complex> const &characters);\n
"},{"location":"documentation/symmetries/representation/#methods","title":"Methods","text":"

size

Returns the size of the Representation, i.e. the number of characters.

JuliaC++
size(irrep::Representation)\n
int64_t size() const;\n

isreal

Returns the whether or not the Representation is real, I.E. the characters are real numbers and do not have an imaginary part.

JuliaC++
isreal(irrep::Representation; precision::Real=1e-12)\n
bool isreal(double precision = 1e-12) const;\n

\"*\" operator

Multiplies two Representations by overloading the * operator.

JuliaC++
Base.:*(p1::Representation, p2::Representation)\n
Representation operator*(Representation const &p1, Representation const &p2);\n
"},{"location":"documentation/symmetries/representation/#usage-example","title":"Usage Example","text":"JuliaC++
r1 = Representation([1, -1, 1, -1])\nr2 = Representation([1, 1im, -1, -1im])\n\n@show r1 * r2\n
Representation r1 = {1, -1, 1, -1};\nRepresentation r2 = {1, 1i, -1, -1i};\n\nXDIAG_SHOW(r1 * r2);\n
"},{"location":"documentation/utilities/logging/","title":"Logging","text":""},{"location":"documentation/utilities/logging/#setting-the-verbosity","title":"Setting the verbosity","text":"

Algorithms implemented in XDiag do not output anything during their execution by default. However, it is typically useful to get some information on how the code is performing and even intermediary results at runtime. For this, the verbosity of the internal XDiag logging can be set using the function set_verbosity, which is defined as

JuliaC++
set_verbosity(level::Integer);\n
void set_verbosity(int64_t level);\n

There are several levels of verbosity, defining how much information is shown.

level outputed information 0 no information 1 some information 2 detailed information

For example, when computing a ground state energy using the eigval0 function, we can set a higher verbosity level using

JuliaC++
set_verbosity(2);\ne0 = eigval0(bonds, block);\n
set_verbosity(2);\ndouble e0 = eigval0(bonds, block);\n

This will print detailed information, which can look like this

Lanczos iteration 1\nMVM: 0.00289 secs\nalpha: -0.2756971549998545\nbeta: 1.7639347562074059\neigs: -0.2756971549998545\nLanczos iteration 2\nMVM: 0.00244 secs\nalpha: -0.7116140394927443\nbeta: 2.3044797637130743\neigs: -2.2710052270892791 1.2836940325966804\nLanczos iteration 3\nMVM: 0.00210 secs\nalpha: -1.2772539678430306\nbeta: 2.6627870395174456\neigs: -3.7522788386927637 -0.6474957945455240 2.1352094709026579\n
"},{"location":"documentation/utilities/logging/#log-mechanism-c-only","title":"Log mechanism (C++ only)","text":"

Producing nicely formatted output is unfortunately a bit cumbersome in standard C++. For this, the Log mechanism in XDiag can help. To simply write out a line of information you can call,

Log(\"hello from the logger\");\n

By default, a new line is added. It is also possible to set verbosity by handing the level as the first argument,

Log(2, \"hello from the logger only if global verbosity is set to >= 2\");\n

This message will only appear if the global verbosity level is set to a value \\(\\geq 2\\). Finally, XDiag also supports formatted output by using the fmtlib. For example, numbers can be formated this way

Log(\"pi is around {:.4f} and the answer is {}\", 3.141592, 42);\n
"},{"location":"documentation/utilities/logging/#source","title":"Source","text":"

logger.hpp

"},{"location":"documentation/utilities/timing/","title":"Timing","text":"

In standard C++ measuring time is a bit awkward. To quickly monitor the CPU time spent by XDiag by simple functions.

"},{"location":"documentation/utilities/timing/#simple-timing-using-tic-toc","title":"Simple timing using tic() / toc()","text":"

Similar as in Matlab one can use tic() and toc() to measure the time spent between two points in the code.

tic();\ndouble e0 = eigval0(bonds, block);\ntoc();\n

toc() will output the time spent since the last time tic() has been called.

"},{"location":"documentation/utilities/timing/#detailed-timing","title":"Detailed timing","text":"

To get the present time, simply call

auto time = rightnow();\n

A timing (in second) between two time points can be written to output using

timing(begin, end);\n

This can even be accompanied by a message about what is being timed and a verbosity level (see Logging) can also be set. The full call signature is

timing(begin, end, message, level);\n
Name Description Default begin starting time computed using rightnow() end end time computed using rightnow() message message string to be prepended to timing \"\" level verbosity level at which timing is printed 0"},{"location":"documentation/utilities/utils/","title":"Miscellaneous utility functions","text":""},{"location":"documentation/utilities/utils/#set_verbosity","title":"set_verbosity","text":"

Set how much logging is generated my XDiag to monitor the progress and behaviour of the code. There are three verbosity levels that can be set:

This can be useful, e.g. to monitor the progress of an iterative algorithm

JuliaC++
set_verbosity(level::Int64)\n
void set_verbosity(int64_t level);\n
"},{"location":"documentation/utilities/utils/#say_hello","title":"say_hello","text":"

Prints a nice welcome message containing the version number and git commit used.

JuliaC++
say_hello()\n
void say_hello()\n
"},{"location":"documentation/utilities/utils/#print_version","title":"print_version","text":"

If say_hello is too much flower power for you, one can also just have a boring print-out of the version number using this function.

JuliaC++
print_version()\n
void print_version()\n
"},{"location":"documentation/utilities/xdiag_show/","title":"Debug printing","text":"

For quick debugging in C++, XDiag features a simple macro which outputs the name and content of a variable calles XDIAG_SHOW(x). For example

Spinhalf block(16, 8);\nXDIAG_SHOW(block);\n

will write an output similar to

block:\n  n_sites  : 16\n  n_up     : 8\n  dimension: 12,870\n  ID       : 0xa9127434d66b9878\n

The XDIAG_SHOW(x) macro can be used on any XDiag object and several other standard C++ objects as well.

"},{"location":"examples/cmake_distributed/","title":"CMakeLists.txt for the distributed XDiag library","text":"
cmake_minimum_required(VERSION 3.19)\n\nproject(\n  tj_distributed_time_evolve\n)\n\nfind_package(xdiag_distributed REQUIRED HINTS ../../../install)\nadd_executable(main main.cpp)\ntarget_link_libraries(main PUBLIC xdiag::xdiag_distributed)\n
"},{"location":"examples/cmake_normal/","title":"CMakeLists.txt for the normal XDiag library","text":"
cmake_minimum_required(VERSION 3.19)\n\nproject(\n  hello_world\n)\n\nfind_package(xdiag REQUIRED HINTS \"../../install\")\nadd_executable(main main.cpp)\ntarget_link_libraries(main PRIVATE xdiag::xdiag)\n
"},{"location":"examples/hello_world/","title":"Hello world!","text":"JuliaC++
   using XDiag\n   say_hello()\n
   #include <xdiag/all.hpp>\n\n   using namespace xdiag;\n\n   int main() try {\n     say_hello();\n   } catch (Error e) {\n     error_trace(e);\n   }\n
"},{"location":"examples/spinhalf_chain_e0/","title":"Groundstate energy","text":"JuliaC++
using XDiag\n\nlet \n    N = 16\n    nup = N \u00f7 2\n    block = Spinhalf(N, nup)\n\n    # Define the nearest-neighbor Heisenberg model\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", \"J\", [i-1, i % N])\n    end\n    ops[\"J\"] = 1.0\n\n    set_verbosity(2)            # set verbosity for monitoring progress\n    e0 = eigval0(ops, block)    # compute ground state energy\n\n    println(\"Ground state energy: $e0\")\nend\n
#include <xdiag/all.hpp>\n\nusing namespace xdiag;\n\nint main() try {\n  int N = 16;\n  int nup = N / 2;\n  Spinhalf block(N, nup);\n\n  // Define the nearest-neighbor Heisenberg model\n  OpSum ops;\n  for (int i = 0; i < N; ++i) {\n    ops += Op(\"HB\", \"J\", {i, (i + 1) % N});\n  }\n  ops[\"J\"] = 1.0;\n\n  set_verbosity(2);                  // set verbosity for monitoring progress\n  double e0 = eigval0(ops, block); // compute ground state energy\n\n  Log(\"Ground state energy: {:.12f}\", e0);\n\n} catch (Error e) {\n  error_trace(e);\n}\n
"},{"location":"examples/tj_distributed_time_evolve/","title":"\\(t\\)-\\(J\\) distributed time evolution","text":"
#include <xdiag/all.hpp>\n\nusing namespace xdiag;\n\nvoid measure_density(int n_sites, State const &v) {\n  int rank;\n  MPI_Comm_rank(MPI_COMM_WORLD, &rank);\n  for (int i = 0; i < n_sites; ++i) {\n    complex sz = innerC(Bond(\"NUMBER\", i), v);\n    if (rank == 0) {\n      printf(\"%.6f \", std::real(sz));\n    }\n  }\n  if (rank == 0) {\n    printf(\"\\n\");\n  }\n}\n\nint main(int argc, char **argv) try {\n  MPI_Init(&argc, &argv);\n\n  int L = 6;\n  int W = 4;\n  double t = 1.0;\n  double J = 0.1;\n  double mu_0 = 10;\n\n  int n_sites = L * W;\n  double precision = 1e-12;\n\n  // Create square lattice t-J model\n  OpSum ops;\n  for (int x = 0; x < L-1; ++x) {\n    for (int y = 0; y < W; ++y) {\n      int nx = (x + 1) % L;\n      int ny = (y + 1) % W;\n\n      int site = x * W + y;\n      int right = nx * W + y;\n      int top = x * W + ny;\n      ops += Op(\"HOP\", \"T\", {site, right});\n      ops += Op(\"EXCHANGE\", \"J\", {site, right});\n      ops += Op(\"HOP\", \"T\", {site, top});\n      ops += Op(\"EXCHANGE\", \"J\", {site, top});\n\n\n\n      if (x < L / 2) {\n    Log(\"x {} y {} site {} t {} r {} +\", x, y, site, top, right);\n        ops += Op(\"NUMBER\", \"MUPLUS\", site);\n      } else {\n    Log(\"x {} y {} site {} t {} r {} -\", x, y, site, top, right);\n        ops += Op(\"NUMBER\", \"MUNEG\", site);\n      }\n    }\n  }\n  ops[\"T\"] = t;\n  ops[\"J\"] = J;\n  ops[\"MUPLUS\"] = mu_0;\n  ops[\"MUNEG\"] = mu_0;\n\n  auto block = tJDistributed(n_sites, n_sites / 2 - 1, n_sites / 2 - 1);\n\n  XDIAG_SHOW(block);\n\n  Log.set_verbosity(2);\n  tic();\n  auto [e0, v] = eig0(ops, block);\n  toc(\"gs\");\n\n  ops[\"MUPLUS\"] = 0;\n  ops[\"MUNEG\"] = 0;\n\n  measure_density(n_sites, v);\n\n  // Do the time evolution with a step size tau\n  double tau = 0.1;\n  for (int i = 0; i < 40; ++i) {\n    tic();\n    v = time_evolve(ops, v, tau, precision);\n    toc(\"time evolve\");\n    tic();\n    measure_density(n_sites, v);\n    toc(\"measure\");\n  }\n\n  MPI_Finalize();\n  return EXIT_SUCCESS;\n} catch (std::exception const &e) {\n  traceback(e);\n}\n
"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"

Quick Start Code on GitHub

"},{"location":"#overview","title":"Overview","text":"

XDiag is a library for performing Exact Diagonalizations of quantum many-body systems. Key features include optimized combinatorical algorithms for navigating Hilbert spaces, iterative linear algebra algorithms, shared and distributed memory parallelization. It consist of two packages:

"},{"location":"#citation","title":"Citation","text":"

Please support our work by citing XDiag and the implemented algorithms if it is used in your published research.

@article{Wietek2018,\n  title = {Sublattice coding algorithm and distributed memory parallelization for large-scale exact diagonalizations of quantum many-body systems},\n  author = {Wietek, Alexander and L\\\"auchli, Andreas M.},\n  journal = {Phys. Rev. E},\n  volume = {98},\n  issue = {3},\n  pages = {033309},\n  numpages = {10},\n  year = {2018},\n  month = {Sep},\n  publisher = {American Physical Society},\n  doi = {10.1103/PhysRevE.98.033309},\n  url = {https://link.aps.org/doi/10.1103/PhysRevE.98.033309}\n}\n
"},{"location":"#gallery","title":"Gallery","text":""},{"location":"installation/","title":"Installation","text":""},{"location":"installation/#julia-installation","title":"Julia Installation","text":"

Enter the package mode using ] in the Julia REPL and type:

add XDiag\n

That's it!

"},{"location":"installation/#c-compilation","title":"C++ Compilation","text":"

Using XDiag with C++ is a two-step process. First the xdiag library needs to be compiled and installed. Therafter, application codes are compiled in a second step. Here we explain how to compile the library.

"},{"location":"installation/#prerequisites","title":"Prerequisites","text":""},{"location":"installation/#basic-compilation","title":"Basic Compilation","text":""},{"location":"installation/#advanced-compilation","title":"Advanced Compilation","text":""},{"location":"installation/#building-documentation","title":"Building Documentation","text":"

The source files for the documentation can be found in the directory docs. The documentation is built using Material for MKDocs. To work on it locally, it can be served using

mkdocs serve\n

from the xdiag root source directory. A local build of the documentation can then be accessed in a webbrowser at the adress

127.0.0.1:8000\n
"},{"location":"quickstart/","title":"Quick start","text":""},{"location":"quickstart/#hello-world","title":"Hello World","text":"

Let us set up our first program using the xdiag library.

JuliaC++
using XDiag\nsay_hello()\n
#include <xdiag/all.hpp>\n\nusing namespace xdiag;\n\nint main() try {\n  say_hello();\n} catch (Error e) {\n  error_trace(e);\n}\n

The function say_hello() prints out a welcome message, which also contains information which exact XDiag version is used. In Julia this is all there is to it.

For the C++ code we need to create two files to compile the program. The first is the actual C++ code. What is maybe a bit unfamiliar is the try / catch block. XDiag implements a traceback mechanism for runtime errors, which is activated by this idiom. While not stricly necessary here, it is a good practice to make use of this.

Now that the application program is written, we next need to set up the compilation instructions using CMake. To do so we create a second file called CMakeLists.txt in the same directory.

cmake_minimum_required(VERSION 3.19)\n\nproject(\n  hello_world\n)\n\nfind_package(xdiag REQUIRED HINTS \"../../install\")\nadd_executable(main main.cpp)\ntarget_link_libraries(main PRIVATE xdiag::xdiag)\n

You should replace \"/path/to/xdiag/install\" with the appropriate directory where your XDiag library is installed after compilation. This exact CMakeLists.txt file can be used to compile any XDiag application.

Info

For using the distributed XDiag library the last line of the above CMakeLists.txt should be changed to

target_link_libraries(main PUBLIC xdiag::xdiag_distributed)\n

We then compile the application code,

cmake -S . -B build\ncmake --build build\n

and finally run our first xdiag application.

./build/main\n
"},{"location":"quickstart/#computing-the-ground-state-energy-of-a-spin-chain","title":"Computing the ground state energy of a spin chain","text":"

We compute the ground state energy of the \\(S=1/2\\) Heisenberg chain on a periodic chain lattice in one dimension. The Hamiltonian is given by

\\[ H = J\\sum_{\\langle i,j \\rangle} \\mathbf{S}_i \\cdot \\mathbf{S}_j\\]

where \\(\\mathbf{S}_i = (S_i^x, S_i^y, S_i^z)\\) are the spin \\(S=1/2\\) operators and \\(\\langle i,j \\rangle\\) denotes summation over nearest-meighbor sites \\(i\\) and \\(j\\).

The following code, sets up the Hilbert space, defines the Hamiltonian and finally calls an iterative eigenvalue solver to compute the ground state energy.

JuliaC++
using XDiag\n\nlet \n    N = 16\n    nup = N \u00f7 2\n    block = Spinhalf(N, nup)\n\n    # Define the nearest-neighbor Heisenberg model\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", \"J\", [i-1, i % N])\n    end\n    ops[\"J\"] = 1.0\n\n    set_verbosity(2)            # set verbosity for monitoring progress\n    e0 = eigval0(ops, block)    # compute ground state energy\n\n    println(\"Ground state energy: $e0\")\nend\n
#include <xdiag/all.hpp>\n\nusing namespace xdiag;\n\nint main() try {\n  int N = 16;\n  int nup = N / 2;\n  Spinhalf block(N, nup);\n\n  // Define the nearest-neighbor Heisenberg model\n  OpSum ops;\n  for (int i = 0; i < N; ++i) {\n    ops += Op(\"HB\", \"J\", {i, (i + 1) % N});\n  }\n  ops[\"J\"] = 1.0;\n\n  set_verbosity(2);                  // set verbosity for monitoring progress\n  double e0 = eigval0(ops, block); // compute ground state energy\n\n  Log(\"Ground state energy: {:.12f}\", e0);\n\n} catch (Error e) {\n  error_trace(e);\n}\n
"},{"location":"releases/","title":"Releases","text":""},{"location":"releases/#v023","title":"v0.2.3","text":"

Sep. 9, 2024

Introduced 1-indexing everywhere in Julia version

"},{"location":"releases/#v022","title":"v0.2.2","text":"

Aug. 27, 2024

Lanczos routines and multicolumn States

"},{"location":"releases/#v021","title":"v0.2.1","text":"

Aug. 16, 2024

Small patch release providing small utility functions

"},{"location":"releases/#v020","title":"v0.2.0","text":"

Aug. 15, 2024

Basic functionality for three Hilbert space types, Spinhalf, tJ, and Electron, has been implemented. Features are:

"},{"location":"tutorials/","title":"Tutorials","text":""},{"location":"tutorials/#introduction-to-exact-diagonalization-using-xdiag","title":"Introduction to Exact Diagonalization using XDiag","text":"

Supporting material for lecture held at Quant24 master's school at MPI PKS. Consists of a Jupyter notebook and a sample lattice file describing the \\(N=12\\) site triangular lattice Heisenberg model:

This notebook uses the Julia verision of XDiag and covers the basic functionality:

"},{"location":"tutorials/#basic-examples","title":"Basic examples","text":""},{"location":"tutorials/#distributed-examples","title":"Distributed examples","text":""},{"location":"tutorials/#cmakeliststxt-for-applications","title":"CMakeLists.txt for applications","text":""},{"location":"documentation/","title":"Documentation","text":""},{"location":"documentation/#algorithms","title":"Algorithms","text":"Name Description Language eigval0 Computes the lowest lying eigenvalue of an operator eig0 Computes the lowest lying eigenvalue and eigenvector of an operator eigvals_lanczos Performs an iterative eigenvalue calculation using the Lanczos algorithm eigs_lanczos Performs an iterative eigenvalue calculation building eigenvectors using the Lanczos algorithm"},{"location":"documentation/#algebra","title":"Algebra","text":"matrix Creates the full matrix representation of an operator on a block apply Applies an operator to a state \\(\\vert w \\rangle = O \\vert v\\rangle\\) norm Computes the 2-norm of a state norm1 Computes the 1-norm of a state norminf Computes the \\(\\infty\\)-norm of a state dot Computes the dot product between two states inner Computes an expectation value \\(\\langle v \\vert O \\vert v \\rangle\\)"},{"location":"documentation/#blocks","title":"Blocks","text":"Spinhalf Block of a spin \\(S=1/2\\) type Hilbert space tJ Block of a \\(t-J\\) type Hilbert space Electron Block of a Electron type Hilbert space"},{"location":"documentation/#operators","title":"Operators","text":"Op A local operator acting on several lattice sites OpSum Sum of local operators Coupling Describes the coupling of a local operator symmetrize Symmetrizes an operator with respect to a permutation symmetry group"},{"location":"documentation/#states","title":"States","text":"State A generic state describing a quantum wave function ProductState A product state of local configurations RandomState A random state with normal distributed coefficients fill Fill a state with a given model state product Creates a filled product state rand Create a filled random state with normal distributed coefficients zeros Create a filled state with all zero entries zero Set all coefficients of a given state to zero"},{"location":"documentation/#symmetries","title":"Symmetries","text":"Permutation Permutations of indices or lattice sites PermutationGroup A group of permutations Representation A (1D) irreducible representation of a finite group"},{"location":"documentation/#utilities","title":"Utilities","text":"set_verbosity Sets how much information is printed during computations say_hello Prints a nice welcome message with version number print_version Prints the plain version number Logging Controling what is written to standard output Timing Measurng wall time straightforwardly XDIAG_SHOW Macro for printing debugging information"},{"location":"documentation/algebra/algebra/","title":"Basic algebra routines","text":"

Source algebra.hpp

"},{"location":"documentation/algebra/algebra/#norm","title":"norm","text":"

Computes the 2-norm of a state

JuliaC++
norm(state::State)\n
double norm(State const &v);\n
"},{"location":"documentation/algebra/algebra/#norm1","title":"norm1","text":"

Computes the 1-norm of a state

JuliaC++
norm1(state::State)\n
double norm1(State const &v);\n
"},{"location":"documentation/algebra/algebra/#norminf","title":"norminf","text":"

Computes the \\(\\infty\\)-norm of a state

JuliaC++
norminf(state::State)\n
double norminf(State const &v);\n
"},{"location":"documentation/algebra/algebra/#dot","title":"dot","text":"

Computes the dot product between two states. In C++, please use the dotC function if one of the two states is expected to be complex.

JuliaC++
dot(v::State, w::State)\n
double dot(State const &v, State const &w);\ncomplex dotC(State const &v, State const &w);\n
"},{"location":"documentation/algebra/algebra/#inner","title":"inner","text":"

Computes the expectation value \\(\\langle v | O |v \\rangle\\) of an operator \\(O\\) and a state \\(|v\\rangle\\). The operator can either be an Op or an OpSum object. In C++, please use the innerC function if either the operator or the state are complex.

JuliaC++
inner(ops::OpSum, v::State)\ninner(op::Op, v::State)\n
double inner(OpSum const &ops, State const &v);\ndouble inner(Op const &op, State const &v);\ncomplex innerC(OpSum const &ops, State const &v);\ncomplex innerC(Op const &op, State const &v);\n
"},{"location":"documentation/algebra/algebra/#usage-examples","title":"Usage Examples","text":"JuliaC++
let \n    N = 8\n    block = Spinhalf(N,  N \u00f7 2)\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", 1.0, [i, mod1(i+1, N)])\n    end\n    e0, psi = eig0(ops, block);\n\n    @show norm(psi)\n    @show norm1(psi)\n    @show norminf(psi)\n\n    @show dot(psi, psi)\n    @show e0, inner(ops, psi)\n\n    phi = rand(block)\n    display(vector(phi))\n    display(vector(psi))\n    display(vector(psi + 2.0*phi))\n    display(vector(psi*3.0im + phi/2.0))\nend\n
int N = 8;\nauto block = Spinhalf(N,  N / 2);\nauto ops = OpSum();\nfor (int i=0; i<N; ++i) {\n  ops += Op(\"HB\", 1.0, {i, (i+1)%N});\n}\nauto [e0, psi] = eig0(ops, block);\n\nXDIAG_SHOW(norm(psi));\nXDIAG_SHOW(norm1(psi));\nXDIAG_SHOW(norminf(psi));\n\nXDIAG_SHOW(dot(psi, psi));\nXDIAG_SHOW(e0);\nXDIAG_SHOW(inner(ops, psi));\n\nauto phi = rand(block);\nXDIAG_SHOW(phi.vector());\nXDIAG_SHOW(psi.vector());\nXDIAG_SHOW((psi + 2.0*phi).vector());\nXDIAG_SHOW((psi*complex(0,3.0) + phi/2.0).vectorC());\n
"},{"location":"documentation/algebra/apply/","title":"apply","text":"

Applies an operator to a state \\(\\vert w \\rangle = O \\vert v\\rangle\\) or block of states \\(\\left( \\vert w_1 \\rangle \\dots \\vert w_M \\rangle \\right) = O \\left( \\vert v_1 \\rangle \\dots \\vert v_M \\rangle \\right)\\).

Source apply.hpp

JuliaC++
apply(op::Op, v::State, w::State, precision::Float64 = 1e-12)\napply(ops::OpSum, v::State, w::State, precision::Float64 = 1e-12)\n
void apply(Op const &op, State const &v, State &w, double precision = 1e-12);\nvoid apply(OpSum const &ops, State const &v, State &w, double precision = 1e-12);\n

The resulting state is handed as the third argument and is overwritten upon exit.

"},{"location":"documentation/algebra/apply/#parameters","title":"Parameters","text":"Name Description ops / op OpSum or Op defining the operator v input state $\\vert v\\rangle $ w output state \\(\\vert w \\rangle = O \\vert v\\rangle\\) precision precision with which checks for zero are performed (default \\(10^{-12}\\))"},{"location":"documentation/algebra/apply/#usage-example","title":"Usage Example","text":"JuliaC++
let \n    N = 8\n    block = Spinhalf(N,  N \u00f7 2)\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", 1.0, [i, mod1(i+1, N)])\n    end\n    e0, psi = eig0(ops, block);\n\n    blockp = Spinhalf(N,  N \u00f7 2 + 1)\n    phi = zeros(blockp)\n    apply(Op(\"S+\", 1.0, 2), psi, phi)\n    @show inner(ops, psi)\n    @show inner(ops, phi)\nend\n
int N = 8;\nauto block = Spinhalf(N,  N / 2);\nauto ops = OpSum();\nfor (int i=0; i<N; ++i){\n  ops += Op(\"HB\", 1.0, {i, (i+1)%N});\n}\nauto [e0, psi] = eig0(ops, block);\n\nauto blockp = Spinhalf(N,  N / 2 + 1);\nauto phi = zeros(blockp);\napply(Op(\"S+\", 1.0, 2), psi, phi);\nXDIAG_SHOW(inner(ops, psi));\nXDIAG_SHOW(inner(ops, phi));\n
"},{"location":"documentation/algebra/matrix/","title":"matrix","text":"
matrix(ops, block; force_complex=false)\nmatrixC(ops, block)  # c++ only\n

Creates the full matrix representation of a given OpSum on a block.

In Julia, depending on whether a real/complex matrix is generated also a real/complex matrix is returned. The C++ version has to return a fixed type. If a real matrix is desired, use the function matrix. If a complex matrix is desired, use the function matrixC.

Source matrix.hpp

"},{"location":"documentation/algebra/matrix/#parameters","title":"Parameters","text":"Name Description ops OpSum defining the operator block block on which the operator is defined force_complex flag to determine if returned matrix is forced to be complex (Julia only)"},{"location":"documentation/algebra/matrix/#returns","title":"Returns","text":"Type Description matrix matrix representation of opsum on block"},{"location":"documentation/algebra/matrix/#definition","title":"Definition","text":"JuliaC++
matrix(ops::Opsum, block::Block; force_complex::Bool=false)\n
template <typename block_t>\narma::mat matrix(OpSum const &ops, block_t const &block);\n\ntemplate <typename block_t>\narma::cx_mat matrixC(OpSum const &ops, block_t const &block);\n
"},{"location":"documentation/algebra/matrix/#usage-example","title":"Usage Example","text":"JuliaC++
let\n    # Creates matrix H_{k=2} in Eq (18.23) of https://link.springer.com/content/pdf/10.1007/978-3-540-74686-7_18.pdf\n    N = 4\n    nup = 3\n    ndn = 2\n\n    # Define a Hubbard chain model\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HOP\", \"T\", [i, mod1(i+1, N)])\n    end\n    ops[\"T\"] = 1.0;\n    ops[\"U\"] = 5.0;\n\n    # Create the a permutation group\n    p1 = Permutation([1, 2, 3, 4])\n    p2 = Permutation([2, 3, 4, 1])\n    p3 = Permutation([3, 4, 1, 2])\n    p4 = Permutation([4, 1, 2, 3])\n    group = PermutationGroup([p1, p2, p3, p4])\n    irrep = Representation([1, -1, 1, -1])\n    block = Electron(N, nup, ndn, group, irrep)\n\n    H = matrix(ops, block)\n    display(H)\nend\n
// Creates matrix H_{k=2} in Eq (18.23) of https://link.springer.com/content/pdf/10.1007/978-3-540-74686-7_18.pdf\nint N = 4;\nint nup = 3;\nint ndn = 2;\n\n// Define a Hubbard chain model\nauto ops = OpSum();\nfor (int i=0; i< N; ++i){\n  ops += Op(\"HOP\", \"T\", {i, (i+1) % N});\n}\nops[\"T\"] = 1.0;\nops[\"U\"] = 5.0;\n\n// Create the a permutation group\nauto p1 = Permutation({0, 1, 2, 3});\nauto p2 = Permutation({1, 2, 3, 0});\nauto p3 = Permutation({2, 3, 0, 1});\nauto p4 = Permutation({3, 0, 1, 2});\nauto group = PermutationGroup({p1, p2, p3, p4});\nauto irrep = Representation({1, -1, 1, -1});\nauto block = Electron(N, nup, ndn, group, irrep);\n\nauto H = matrix(ops, block);\nH.print();\n
"},{"location":"documentation/algorithms/eig0/","title":"eig0","text":"

Computes the groud state energy and the ground state of an operator on a block.

Source sparse_diag.hpp

JuliaC++
function eig0(\n    ops::OpSum,\n    block::Block;\n    precision::Real = 1e-12,\n    maxiter::Int64 = 1000,\n    force_complex::Bool = false,\n    seed::Int64 = 42,\n)\n
std::tuple<double, State> eig0(OpSum const &ops, Block const &block,\n    double precision = 1e-12,\n    int64_t max_iterations = 1000,\n    bool force_complex = false,\n    int64_t random_seed = 42);\n
"},{"location":"documentation/algorithms/eig0/#parameters","title":"Parameters","text":"Name Description Default ops OpSum defining the bonds of the operator block block on which the operator is defined precision accuracy of the computed ground state 1e-12 max_iterations maximum number of iterations 1000 force_complex whether or not computation should be forced to have complex arithmetic false random_seed random seed for setting up the initial vector 42"},{"location":"documentation/algorithms/eig0/#returns","title":"Returns","text":"Type Description real number lowest lying eigenvalue State groundstate"},{"location":"documentation/algorithms/eig0/#usage-example","title":"Usage Example","text":"JuliaC++
let \n    N = 8\n    nup = N \u00f7 2\n    block = Spinhalf(N, nup)\n\n    # Define the nearest-neighbor Heisenberg model\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", \"J\", [i, mod1(i+1, N)])\n    end\n    ops[\"J\"] = 1.0;\n\n    e0, gs = eig0(ops, block);\nend\n
int N = 8;\nint nup = N / 2;\nauto block = Spinhalf(N, nup);\n\n// Define the nearest-neighbor Heisenberg model\nauto ops = OpSum();\nfor (int i=0; i<N; ++i) {\n  ops += Op(\"HB\", \"J\", {i, (i+1) % N});\n}\nops[\"J\"] = 1.0;\nauto [e0, gs] = eig0(ops, block);\n
"},{"location":"documentation/algorithms/eigs_lanczos/","title":"eigs_lanczos","text":"

Performs an iterative eigenvalue calculation building eigenvectors using the Lanczos algorithm

Source eigs_lanczos.hpp

JuliaC++C++ (explicit state initialization)
function eigs_lanczos(\n    ops::OpSum,\n    block::Block;\n    neigvals::Int64 = 1,\n    precision::Float64 = 1e-12,\n    max_iterations::Int64 = 1000,\n    force_complex::Bool = false,\n    deflation_tol::Float64 = 1e-7,\n    random_seed::Int64 = 42,\n)\n
eigs_lanczos_result_t\neigs_lanczos(OpSum const &ops, Block const &block, int64_t neigvals = 1,\n            double precision = 1e-12, int64_t max_iterations = 1000,\n            bool force_complex = false, double deflation_tol = 1e-7,\n            int64_t random_seed = 42);\n
eigs_lanczos_result_t \neigs_lanczos(OpSum const &ops, Block const &block,\n            State const &state, int64_t neigenvalues = 1,\n            double precision = 1e-12, int64_t max_iterations = 1000,\n            bool force_complex = false);\n
"},{"location":"documentation/algorithms/eigs_lanczos/#parameters","title":"Parameters","text":"Name Description Default ops OpSum defining the bonds of the operator block block on which the operator is defined neigvals number of eigenvalues to converge 1 precision accuracy of the computed ground state 1e-12 max_iterations maximum number of iterations 1000 force_complex whether or not computation should be forced to have complex arithmetic false deflation_tol tolerance for deflation, i.e. breakdown of Lanczos due to Krylow space exhaustion 1e-7 random_seed random seed for setting up the initial vector 42"},{"location":"documentation/algorithms/eigs_lanczos/#returns","title":"Returns","text":"

A struct with the following entries

Entry Description alphas diagonal elements of the tridiagonal matrix betas off-diagonal elements of the tridiagonal matrix eigenvalues the computed Ritz eigenvalues of the tridiagonal matrix eigenvectors State of shape $D \\times $neigvals holding all low-lying eigenvalues up to neigvals niterations number of iterations performed criterion string denoting the reason why the algorithm stopped"},{"location":"documentation/algorithms/eigval0/","title":"eigval0","text":"

Computes the groud state energy of an operator on a block.

Source sparse_diag.hpp

JuliaC++
function eigval0(\n    ops::OpSum,\n    block::Block;\n    precision::Real = 1e-12,\n    maxiter::Integer = 1000,\n    force_complex::Bool = false,\n    seed::Integer = 42,\n)\n
double eigval0(OpSum const &ops, Block const &block, double precision = 1e-12,\n           int64_t max_iterations = 1000, bool force_complex = false,\n           int64_t random_seed = 42);\n
"},{"location":"documentation/algorithms/eigval0/#parameters","title":"Parameters","text":"Name Description Default ops OpSum defining the bonds of the operator block block on which the operator is defined precision accuracy of the computed ground state 1e-12 max_iterations maximum number of iterations 1000 force_complex whether or not computation should be forced to have complex arithmetic false random_seed random seed for setting up the initial vector 42"},{"location":"documentation/algorithms/eigval0/#returns","title":"Returns","text":"Type Description real number lowest lying eigenvalue"},{"location":"documentation/algorithms/eigval0/#definition","title":"Definition","text":""},{"location":"documentation/algorithms/eigval0/#usage-example","title":"Usage Example","text":"JuliaC++
let \n    N = 8\n    nup = N \u00f7 2\n    block = Spinhalf(N, nup)\n\n    # Define the nearest-neighbor Heisenberg model\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", \"J\", [i, mod1(i+1, N)])\n    end\n    ops[\"J\"] = 1.0\n\n    e0 = eigval0(ops, block);\nend\n
int N = 8;\nint nup = N / 2;\nauto block = Spinhalf(N, nup);\n\n// Define the nearest-neighbor Heisenberg model\nauto ops = OpSum();\nfor (int i=0; i<N; ++i) {\n  ops += Op(\"HB\", \"J\", {i, (i+1) % N});\n}\nops[\"J\"] = 1.0;\ndouble e0 = eigval0(ops, block);\n
"},{"location":"documentation/algorithms/eigvals_lanczos/","title":"eigvals_lanczos","text":"

Performs an iterative eigenvalue calculation using the Lanczos algorithm.

Source eigvals_lanczos.hpp

JuliaC++C++ (explicit state initialization)
function eigvals_lanczos(\n    ops::OpSum,\n    block::Block;\n    neigvals::Int64 = 1,\n    precision::Float64 = 1e-12,\n    max_iterations::Int64 = 1000,\n    force_complex::Bool = false,\n    deflation_tol::Float64 = 1e-7,\n    random_seed::Int64 = 42,\n)\n
eigvals_lanczos_result_t\neigvals_lanczos(OpSum const &ops, Block const &block, int64_t neigvals = 1,\n            double precision = 1e-12, int64_t max_iterations = 1000,\n            bool force_complex = false, double deflation_tol = 1e-7,\n            int64_t random_seed = 42);\n
eigvals_lanczos_result_t\neigvals_lanczos(OpSum const &ops, Block const &block, \n            State const &state, int64_t neigvals = 1,\n            double precision = 1e-12, int64_t max_iterations = 1000,\n            bool force_complex = false);\n
"},{"location":"documentation/algorithms/eigvals_lanczos/#parameters","title":"Parameters","text":"Name Description Default ops OpSum defining the bonds of the operator block block on which the operator is defined neigvals number of eigenvalues to converge 1 precision accuracy of the computed ground state 1e-12 max_iterations maximum number of iterations 1000 force_complex whether or not computation should be forced to have complex arithmetic false deflation_tol tolerance for deflation, i.e. breakdown of Lanczos due to Krylow space exhaustion 1e-7 random_seed random seed for setting up the initial vector 42"},{"location":"documentation/algorithms/eigvals_lanczos/#returns","title":"Returns","text":"

A struct with the following entries

Entry Description alphas diagonal elements of the tridiagonal matrix betas off-diagonal elements of the tridiagonal matrix eigenvalues the computed Ritz eigenvalues of the tridiagonal matrix niterations number of iterations performed criterion string denoting the reason why the algorithm stopped"},{"location":"documentation/blocks/electron/","title":"Electron","text":"

Representation of a block in a Electron (spinful fermion) Hilbert space.

Source electron.hpp

"},{"location":"documentation/blocks/electron/#constructors","title":"Constructors","text":"JuliaC++
Electron(n_sites::Integer)\nElectron(n_sites::Integer, n_up::Integer, n_dn::Integer)\nElectron(n_sites::Integer, group::PermutationGroup, irrep::Representation)\nElectron(n_sites::Integer, n_up::Integer, n_dn::Integer, \n         group::PermutationGroup, irrep::Representation)\n
Electron(int64_t n_sites);\nElectron(int64_t n_sites, int64_t n_up, int64_t n_dn);\nElectron(int64_t n_sites, PermutationGroup permutation_group,\n         Representation irrep);\nElectron(int64_t n_sites, int64_t n_up, int64_t n_dn, \n         PermutationGroup group, Representation irrep);\n
Name Description n_sites number of sites (integer) n_up number of \"up\" electrons (integer) n_dn number of \"dn\" electrons (integer) group PermutationGroup defining the permutation symmetries irrep Irreducible Representation of the symmetry group"},{"location":"documentation/blocks/electron/#iteration","title":"Iteration","text":"

An Electron block can be iterated over, where at each iteration a ProductState representing the corresponding basis state is returned.

JuliaC++
block = Electron(4, 2, 2)\nfor pstate in block\n    @show pstate, index(block, pstate) \nend\n
auto block = Electron(4, 2, 2);\nfor (auto pstate : block) {\n    Log(\"{} {}\", to_string(pstate), block.index(pstate));\n}\n
"},{"location":"documentation/blocks/electron/#methods","title":"Methods","text":"

index

Returns the index of a given ProductState in the basis of the Electron block.

JuliaC++
index(block::Electron, pstate::ProductState)\n
int64_t index(ProductState const &pstate) const;\n

1-indexing

In the C++ version, the index count starts from \"0\" whereas in Julia the index count starts from \"1\".

n_sites

Returns the number of sites of the block.

JuliaC++
n_sites(block::Electron)\n
int64_t n_sites() const;\n

n_up

Returns the number of \"up\" electrons.

JuliaC++
n_up(block::Electron)\n
int64_t n_up() const;\n

n_dn

Returns the number of \"down\" electrons.

JuliaC++
n_dn(block::Electron)\n
int64_t n_dn() const;\n

permutation_group

Returns the PermutationGroup of the block, if defined.

JuliaC++
permutation_group(block::Electron)\n
PermutationGroup permutation_group() const;\n

irrep

Returns the Representation of the block, if defined.

JuliaC++
irrep(block::Electron)\n
Representation irrep() const;\n

size

Returns the size of the block, i.e. its dimension.

JuliaC++
size(block::Electron)\n
int64_t size() const;\n

dim

Returns the dimension of the block, same as \"size\" for non-distributed blocks.

JuliaC++
dim(block::Electron)\n
int64_tdim() const;\n

isreal

Returns whether the block can be used with real arithmetic. Complex arithmetic is needed when a Representation is genuinely complex.

JuliaC++
isreal(block::Electron; precision::Real=1e-12)\n
int64_t isreal(double precision = 1e-12) const;\n
"},{"location":"documentation/blocks/electron/#usage-example","title":"Usage Example","text":"JuliaC++
N = 4\nnup = 2\nndn = 1\n\n# without number conservation\nblock = Electron(N)\n@show block\n\n# with number conservation\nblock_np = Electron(N, nup, ndn)\n@show block_np\n\n# with symmetries, without number conservation\np1 = Permutation([1, 2, 3, 4])\np2 = Permutation([2, 3, 4, 1])\np3 = Permutation([3, 4, 1, 2])\np4 = Permutation([4, 1, 2, 3])\ngroup = PermutationGroup([p1, p2, p3, p4])\nrep = Representation([1, -1, 1, -1])\nblock_sym = Electron(N, group, rep)\n@show block_sym\n\n# with symmetries and number conservation\nblock_sym_np = Electron(N, nup, ndn, group, rep)\n@show block_sym_np\n\n@show n_sites(block_sym_np)\n@show size(block_sym_np)\n\n# Iteration\nfor pstate in block_sym_np\n    @show pstate, index(block_sym_np, pstate)\nend\n@show permutation_group(block_sym_np)\n@show irrep(block_sym_np)\n
int N = 4;\nint nup = 2;\nint ndn = 1;\n\n// without number conservation\nauto block = Electron(N);\nXDIAG_SHOW(block);\n\n// with number conservation\nauto block_np = Electron(N, nup, ndn);\nXDIAG_SHOW(block_np);\n\n// with symmetries, without number conservation\nauto p1 = Permutation({0, 1, 2, 3});\nauto p2 = Permutation({1, 2, 3, 0});\nauto p3 = Permutation({2, 3, 0, 1});\nauto p4 = Permutation({3, 0, 1, 2});\nauto group = PermutationGroup({p1, p2, p3, p4});\nauto irrep = Representation({1, -1, 1, -1});\nauto block_sym = Electron(N, group, irrep);\nXDIAG_SHOW(block_sym);\n\n// with symmetries and number conservation\nauto block_sym_np = Electron(N, nup, ndn, group, irrep);\nXDIAG_SHOW(block_sym_np);\n\nXDIAG_SHOW(block_sym_np.n_sites());\nXDIAG_SHOW(block_sym_np.size());\n\n// Iteration\nfor (auto pstate : block_sym_np) {\n  Log(\"{} {}\", to_string(pstate), block_sym_np.index(pstate));\n}\nXDIAG_SHOW(block_sym_np.permutation_group());\nXDIAG_SHOW(block_sym_np.irrep());\n
"},{"location":"documentation/blocks/spinhalf/","title":"Spinhalf","text":"

Representation of a block in a spin \\(S=1/2\\) Hilbert space.

Source spinhalf.hpp

"},{"location":"documentation/blocks/spinhalf/#constructors","title":"Constructors","text":"JuliaC++
Spinhalf(n_sites::Integer)\nSpinhalf(n_sites::Integer, n_up::Integer)\nSpinhalf(n_sites::Integer, group::PermutationGroup, irrep::Representation)\nSpinhalf(n_sites::Integer, n_up::Integer, group::PermutationGroup, \n         irrep::Representation)\n
Spinhalf(int64_t n_sites);\nSpinhalf(int64_t n_sites, int64_t n_up);\nSpinhalf(int64_t n_sites, PermutationGroup permutation_group,\n         Representation irrep);\nSpinhalf(int64_t n_sites, int64_t n_up, PermutationGroup group,\n         Representation irrep);\n
Name Description n_sites number of sites (integer) n_up number of \"up\" spin setting spin (integer) group PermutationGroup defining the permutation symmetries irrep Irreducible Representation of the symmetry group"},{"location":"documentation/blocks/spinhalf/#iteration","title":"Iteration","text":"

An Spinhalf block can be iterated over, where at each iteration a ProductState representing the corresponding basis state is returned.

JuliaC++
block = Spinhalf(4, 2)\nfor pstate in block\n    @show pstate, index(block, pstate) \nend\n
auto block = Spinhalf(4, 2);\nfor (auto pstate : block) {\n    Log(\"{} {}\", to_string(pstate), block.index(pstate));\n}\n
"},{"location":"documentation/blocks/spinhalf/#methods","title":"Methods","text":"

index

Returns the index of a given ProductState in the basis of the Spinhalf block.

JuliaC++
index(block::Spinhalf, pstate::ProductState)\n
int64_t index(ProductState const &pstate) const;\n

1-indexing

In the C++ version, the index count starts from \"0\" whereas in Julia the index count starts from \"1\".

n_sites

Returns the number of sites of the block.

JuliaC++
n_sites(block::Spinhalf)\n
int64_t n_sites() const;\n

n_up

Returns the number of \"up\" spins.

JuliaC++
n_up(block::Spinhalf)\n
int64_t n_up() const;\n

permutation_group

Returns the PermutationGroup of the block, if defined.

JuliaC++
permutation_group(block::Spinhalf)\n
PermutationGroup permutation_group() const;\n

irrep

Returns the Representation of the block, if defined.

JuliaC++
irrep(block::Spinhalf)\n
Representation irrep() const;\n

size

Returns the size of the block, i.e. its dimension.

JuliaC++
size(block::Spinhalf)\n
int64_t size() const;\n

dim

Returns the dimension of the block, same as \"size\" for non-distributed blocks.

JuliaC++
dim(block::Spinhalf)\n
int64_tdim() const;\n

isreal

Returns whether the block can be used with real arithmetic. Complex arithmetic is needed when a Representation is genuinely complex.

JuliaC++
isreal(block::Spinhalf; precision::Real=1e-12)\n
int64_t isreal(double precision = 1e-12) const;\n
"},{"location":"documentation/blocks/spinhalf/#usage-example","title":"Usage Example","text":"JuliaC++
N = 4\nnup = 2\n\n# without Sz conservation\nblock = Spinhalf(N)\n@show block\n\n\n# with Sz conservation\nblock_sz = Spinhalf(N, nup)\n@show block_sz\n\n# with symmetries, without Sz\np1 = Permutation([1, 2, 3, 4])\np2 = Permutation([2, 3, 4, 1])\np3 = Permutation([3, 4, 1, 2])\np4 = Permutation([4, 1, 2, 3])\ngroup = PermutationGroup([p1, p2, p3, p4])\nrep = Representation([1, -1, 1, -1])\nblock_sym = Spinhalf(N, group, rep)\n@show block_sym\n\n# with symmetries and Sz\nblock_sym_sz = Spinhalf(N, nup, group, rep)\n@show block_sym_sz\n\n@show n_sites(block_sym_sz)\n@show size(block_sym_sz)\n\n# Iteration\nfor pstate in block_sym_sz\n    @show pstate, index(block_sym_sz, pstate)\nend\n@show permutation_group(block_sym_sz)\n@show irrep(block_sym_sz)\n
int N = 4;\nint nup = 2;\n\n// without Sz conservation\nauto block = Spinhalf(N);\nXDIAG_SHOW(block);\n\n// with Sz conservation\nauto block_sz = Spinhalf(N, nup);\nXDIAG_SHOW(block_sz);\n\n// with symmetries, without Sz\nPermutation p1 = {0, 1, 2, 3};\nPermutation p2 = {1, 2, 3, 0};\nPermutation p3 = {2, 3, 0, 1};\nPermutation p4 = {3, 0, 1, 2};\nauto group = PermutationGroup({p1, p2, p3, p4});\nauto irrep = Representation({1, -1, 1, -1});\nauto block_sym = Spinhalf(N, group, irrep);\nXDIAG_SHOW(block_sym);\n\n// with symmetries and Sz\nauto block_sym_sz = Spinhalf(N, nup, group, irrep);\nXDIAG_SHOW(block_sym_sz);\n\nXDIAG_SHOW(block_sym_sz.n_sites());\nXDIAG_SHOW(block_sym_sz.size());\n\n// Iteration\nfor (auto pstate : block_sym_sz) {\n  Log(\"{} {}\", to_string(pstate), block_sym_sz.index(pstate));\n}\nXDIAG_SHOW(block_sym_sz.permutation_group());\nXDIAG_SHOW(block_sym_sz.irrep());\n
"},{"location":"documentation/blocks/tJ/","title":"tJ","text":"

Representation of a block in a \\(t-J\\) type Hilbert space.

Source tj.hpp

"},{"location":"documentation/blocks/tJ/#constructors","title":"Constructors","text":"JuliaC++
tJ(n_sites::Integer, n_up::Integer, n_dn::Integer)\ntJ(n_sites::Integer, n_up::Integer, n_dn::Integer, \n   group::PermutationGroup, irrep::Representation)\n
tJ(int64_t n_sites, int64_t n_up, int64_t n_dn);\ntJ(int64_t n_sites, int64_t n_up, int64_t n_dn, \n   PermutationGroup group, Representation irrep);\n
Name Description n_sites number of sites (integer) n_up number of \"up\" electrons (integer) n_dn number of \"dn\" electrons (integer) group PermutationGroup defining the permutation symmetries irrep Irreducible Representation of the symmetry group"},{"location":"documentation/blocks/tJ/#iteration","title":"Iteration","text":"

An tJ block can be iterated over, where at each iteration a ProductState representing the corresponding basis state is returned.

JuliaC++
block = tJ(4, 2, 1)\nfor pstate in block\n    @show pstate, index(block, pstate) \nend\n
auto block = tJ(4, 2, 1);\nfor (auto pstate : block) {\n    Log(\"{} {}\", to_string(pstate), block.index(pstate));\n}\n
"},{"location":"documentation/blocks/tJ/#methods","title":"Methods","text":"

index

Returns the index of a given ProductState in the basis of the tJ block.

JuliaC++
index(block::tJ, pstate::ProductState)\n
int64_t index(ProductState const &pstate) const;\n

1-indexing

In the C++ version, the index count starts from \"0\" whereas in Julia the index count starts from \"1\".

n_sites

Returns the number of sites of the block.

JuliaC++
n_sites(block::tJ)\n
int64_t n_sites() const;\n

n_up

Returns the number of \"up\" electrons.

JuliaC++
n_up(block::tJ)\n
int64_t n_up() const;\n

n_dn

Returns the number of \"down\" electrons.

JuliaC++
n_dn(block::tJ)\n
int64_t n_dn() const;\n

permutation_group

Returns the PermutationGroup of the block, if defined.

JuliaC++
permutation_group(block::tJ)\n
PermutationGroup permutation_group() const;\n

irrep

Returns the Representation of the block, if defined.

JuliaC++
irrep(block::tJ)\n
Representation irrep() const;\n

size

Returns the size of the block, i.e. its dimension.

JuliaC++
size(block::tJ)\n
int64_t size() const;\n

dim

Returns the dimension of the block, same as \"size\" for non-distributed blocks.

JuliaC++
dim(block::tJ)\n
int64_tdim() const;\n

isreal

Returns whether the block can be used with real arithmetic. Complex arithmetic is needed when a Representation is genuinely complex.

JuliaC++
isreal(block::tJ; precision::Real=1e-12)\n
int64_t isreal(double precision = 1e-12) const;\n
"},{"location":"documentation/blocks/tJ/#usage-example","title":"Usage Example","text":"JuliaC++
N = 4\nnup = 2\nndn = 1\n\n# without permutation symmetries\nblock = tJ(N, nup, ndn)\n@show block\n\n# with permutation symmetries\np1 = Permutation([1, 2, 3, 4])\np2 = Permutation([2, 3, 4, 1])\np3 = Permutation([3, 4, 1, 2])\np4 = Permutation([4, 1, 2, 3])\ngroup = PermutationGroup([p1, p2, p3, p4])\nrep = Representation([1, -1, 1, -1])\nblock_sym = tJ(N, nup, ndn, group, rep)\n@show block_sym\n\n@show n_sites(block_sym)\n@show size(block_sym)\n\n# Iteration\nfor pstate in block_sym\n    @show pstate, index(block_sym, pstate)\nend\n@show permutation_group(block_sym)\n@show irrep(block_sym)\n
int N = 4;\nint nup = 2;\nint ndn = 1;\n\n// without permutation symmetries\nauto block = tJ(N, nup, ndn);\nXDIAG_SHOW(block);\n\n// with permutation symmetries\nauto p1 = Permutation({0, 1, 2, 3});\nauto p2 = Permutation({1, 2, 3, 0});\nauto p3 = Permutation({2, 3, 0, 1});\nauto p4 = Permutation({3, 0, 1, 2});\nauto group = PermutationGroup({p1, p2, p3, p4});\nauto irrep = Representation({1, -1, 1, -1});\nauto block_sym = tJ(N, nup, ndn, group, irrep);\nXDIAG_SHOW(block_sym);\n\nXDIAG_SHOW(block_sym.n_sites());\nXDIAG_SHOW(block_sym.size());\n\n// Iteration\nfor (auto pstate : block_sym) {\n  Log(\"{} {}\", to_string(pstate), block_sym.index(pstate));\n}\nXDIAG_SHOW(block_sym.permutation_group());\nXDIAG_SHOW(block_sym.irrep());\n
"},{"location":"documentation/operators/coupling/","title":"Coupling","text":"

Describes the coupling of a local operator. A coupling can either be a string, a real/complex number or even a real/complex matrix. It allows for converting to real/complex numbers or matrices as well as strings, whenever this conversion is sensible.

Source coupling.hpp

"},{"location":"documentation/operators/coupling/#constructors","title":"Constructors","text":"JuliaC++
Coupling(name::String)\nCoupling(val::Float64)\nCoupling(val::ComplexF64)\nCoupling(mat::Matrix{Float64})\nCoupling(mat::Matrix{ComplexF64})\n
Coupling(std::string value);\nCoupling(double value);\nCoupling(complex value);\nCoupling(arma::mat const &value);\nCoupling(arma::cx_mat const &value);\n
"},{"location":"documentation/operators/coupling/#methods","title":"Methods","text":"

type

Returns the type of the Coupling, i.e. a string which either reads \"string\", \"double\", \"complex\", \"mat\", or \"cx_mat\"

JuliaC++
type(cpl::Coupling)\n
std::string type() const;\n

isreal

Returns whether or not the coupling is real. Throws an error if the coupling is given as a string, since then it cannot be determined whether the operator is real.

JuliaC++
isreal(cpl::Coupling)\n
bool isreal() const;\n

ismatrix

Returns whether or not the coupling is defined as a matrix. Throws an error if the coupling is given as a string, since then it cannot be determined whether the operator is real.

JuliaC++
ismatrix(cpl::Coupling)\n
bool ismatrix() const;\n

isexplicit

Returns false if the coupling is defined as a string, otherwise true

JuliaC++
isexplicit(cpl::Coupling)\n
bool isexplicit() const;\n
"},{"location":"documentation/operators/coupling/#conversions","title":"Conversions","text":"

A Coupling can be converted to the values it represents, so a string, real/complex number or a real/complex matrix. Initially real values can be cast to complex.

JuliaC++
convert(::Type{String}, cpl::Coupling)\nconvert(::Type{Float64}, cpl::Coupling)\nconvert(::Type{ComplexF64}, cpl::Coupling)\nconvert(::Type{Matrix{Float64}}, cpl::Coupling)\nconvert(::Type{Matrix{ComplexF64}}, cpl::Coupling)\n
template <typename coeff_t> coeff_t as() const;\n
"},{"location":"documentation/operators/coupling/#usage-example","title":"Usage Example","text":"JuliaC++
cpl = Coupling(\"J\")\n@show type(cpl)\n@show isexplicit(cpl)\n\ncpl = Coupling(1.23)\n@show ismatrix(cpl)\n@show convert(Float64, cpl)\n@show convert(ComplexF64, cpl)\n\ncpl = Coupling([1 2; -2 1])\n@show ismatrix(cpl)\n@show isreal(cpl)\n@show convert(Matrix{Float64}, cpl)\n@show convert(Matrix{ComplexF64}, cpl)\n
auto cpl = Coupling(\"J\");\nXDIAG_SHOW(cpl.type());\nXDIAG_SHOW(cpl.isexplicit());\n\ncpl = Coupling(1.23);\nXDIAG_SHOW(cpl.ismatrix());\nXDIAG_SHOW(cpl.as<double>());\nXDIAG_SHOW(cpl.as<complex>());\n\ncpl = Coupling(arma::mat(\"1 2; -2 1\"));\nXDIAG_SHOW(cpl.ismatrix());\nXDIAG_SHOW(cpl.isreal());\nXDIAG_SHOW(cpl.as<arma::mat>());\nXDIAG_SHOW(cpl.as<arma::cx_mat>());\n
"},{"location":"documentation/operators/op/","title":"Op","text":"

A local operator acting on several lattice sites.

Source op.hpp

"},{"location":"documentation/operators/op/#constructors","title":"Constructors","text":"JuliaC++
Op(type::String, coupling::String, sites::Vector{Int64})\nOp(type::String, coupling::String, site::Int64)\n\nOp(type::String, coupling::Float64, sites::Vector{Int64})\nOp(type::String, coupling::Float64, site::Int64)\n\nOp(type::String, coupling::ComplexF64, sites::Vector{Int64})\nOp(type::String, coupling::ComplexF64, site::Int64)\n\nOp(type::String, coupling::Matrix{Float64}, sites::Vector{Int64})\nOp(type::String, coupling::Matrix{Float64}, site::Int64)\n\nOp(type::String, coupling::Matrix{ComplexF64}, sites::Vector{Int64})\nOp(type::String, coupling::Matrix{ComplexF64}, site::Int64)\n
Op(std::string type, std::string coupling, std::vector<int64_t> const &sites)\nOp(std::string type, std::string coupling, int64_t site)\n\nOp(std::string type, double coupling, std::vector<int64_t> const &sites)\nOp(std::string type, double coupling, int64_t site)\n\nOp(std::string type, complex coupling, std::vector<int64_t> const &sites)\nOp(std::string type, complex coupling, int64_t site)\n\nOp(std::string type, arma::mat const &coupling, std::vector<int64_t> const &sites)\nOp(std::string type, arma::mat const &coupling, int64_t site)\n\nOp(std::string type, arma::cx_mat const &coupling, std::vector<int64_t> const &sites)\nOp(std::string type, arma::cx_mat const &coupling, int64_t site)\n
Parameter Description type a string which denotes what kind of operator is represented coupling sets the coefficients neded to specify the coupling. Further details below sites defines on which site(s) of the lattice the operator acts on.

1-indexing in Julia / 0-indexing in C++

To enumerate the sites of an Op, we start counting at 1 in Julia and 0 in C++.

The coupling can take on several types and allow some flexibility in defining operators.

type Description string the coupling is represented as a string, e.g. \"\\(t\\)\" or \"\\(J\\)\" in a \\(t-J\\) model real/cplx number the actual numerical value of the coupling real/cplx matrix more generic interactions can be specified as matrices"},{"location":"documentation/operators/op/#methods","title":"Methods","text":"

type

Returns the type of the operator

JuliaC++
type(op::Op)\n
std::string type() const;\n

coupling

Returns the coupling of the operator

JuliaC++
coupling(op::Op)\n
Coupling const &coupling() const;\n

This returns an object of type Coupling, which can then be converted to an appropriate type.

size

Returns how many sites the operator is defined on

JuliaC++
size(op::Op)\n
int64_t size() const;\n

getindex / operator[]

Returns the site with the given index.

JuliaC++
getindex(op::Op, idx::Int64)\n
int64_t operator[](int64_t idx) const;\n

sites

Returns all the sites the operator is defined on

JuliaC++
sites(op::Op)\n
std::vector<int64_t> const &sites() const;\n

isreal

Returns whether or not the coupling is real. Throws an error if the coupling is given as a string, since then it cannot be determined whether the operator is real.

JuliaC++
isreal(op::Op)\n
bool isreal() const;\n

ismatrix

Returns whether or not the coupling is defined as a matrix. Throws an error if the coupling is given as a string, since then it cannot be determined whether the operator is real.

JuliaC++
ismatrix(op::Op)\n
bool ismatrix() const;\n

isexplicit

Returns false if the coupling is defined as a string, otherwise true

JuliaC++
isexplicit(op::Op)\n
bool isexplicit() const;\n
"},{"location":"documentation/operators/op/#usage-example","title":"Usage Example","text":"JuliaC++
op = Op(\"HOP\", \"T\", [1, 2])\n@show op\n@show type(op)\n@show convert(String, coupling(op))\n@show size(op), op[1], op[2]\n@show sites(op) == [1, 2]\n@show isexplicit(op)\n\nop = Op(\"HOP\", 1.23, [1, 2])\n@show op\n@show isreal(op)\n@show ismatrix(op)\n@show isexplicit(op)\n\nop = Op(\"SY\", [0 -im; im 0], 1)\n@show op\n@show isreal(op)\n@show ismatrix(op)\n@show isexplicit(op)\n
auto op = Op(\"HOP\", \"T\", {0, 1});\nXDIAG_SHOW(op);\nXDIAG_SHOW(op.type());\nXDIAG_SHOW(op.coupling().as<std::string>());\nXDIAG_SHOW(op.size());\nXDIAG_SHOW(op[0]);\nXDIAG_SHOW(op[1]);\nXDIAG_SHOW(op.isexplicit());\n\n op = Op(\"HOP\", 1.23, {0, 1});\nXDIAG_SHOW(op);\nXDIAG_SHOW(op.isreal());\nXDIAG_SHOW(op.ismatrix());\nXDIAG_SHOW(op.isexplicit());\n\narma::cx_mat m(arma::mat(\"0 0; 0 0\"), arma::mat(\"0 -1; 1 0\"));\nop = Op(\"SY\", m, 0);\nXDIAG_SHOW(op);\nXDIAG_SHOW(op.isreal());\nXDIAG_SHOW(op.ismatrix());\nXDIAG_SHOW(op.isexplicit());\n
"},{"location":"documentation/operators/opsum/","title":"OpSum","text":"

A sum of local operators acting on several lattice sites.

Source opsum.hpp

"},{"location":"documentation/operators/opsum/#constructor","title":"Constructor","text":"JuliaC++
OpSum()\nOpSum(ops::Vector{Op})\n
OpSum() = default;\nOpSum(std::vector<Op> const &ops);\n
Parameter Description ops a vector of Op objects describing the operators summed over"},{"location":"documentation/operators/opsum/#methods","title":"Methods","text":"

size

Returns the number of local Op operators.

JuliaC++
size(ops::OpSum)\n
int64_t size() const;\n

defined

Returns bool whether a coupling (of type string) is defined

JuliaC++
defined(ops::OpSum, name::String)\n
bool defined(std::string name) const;\n

setindex! / operator[]

Sets a coupling given as a string to a certain numerical value or matrix

JuliaC++
Base.setindex!(ops::OpSum, cpl, name::String)\n
Coupling &operator[](std::string name);\n

getindex / operator[]

Returns the value of a Coupling defined as a string.

JuliaC++
getindex(ops::OpSum, name::String)\n
Coupling const &operator[](std::string name) const;\n

couplings

Returns all the possible names of Coupling as a vector of strings

JuliaC++
couplings(ops::OpSum)\n
std::vector<std::string> couplings() const;\n

isreal

Returns whether or not the OpSum is real. This will throw an error if some Coupling are only defined as a string.

JuliaC++
isreal(ops::OpSum)\n
bool isreal() const;\n

isexplicit

Returns false if there exist a Coupling which is defined as a string, otherwise true.

JuliaC++
isexplicit(ops::OpSum)\n
bool isexplicit() const;\n

operator +

Adds a single Op or a full OpSum

JuliaC++
+(ops::OpSum, op2::Op) = OpSum(ops.cxx_opsum + op2.cxx_op)\n+(ops::OpSum, ops2::OpSum) = OpSum(ops.cxx_opsum + ops2.cxx_opsum)\n
void operator+=(Op const &op);\nvoid operator+=(OpSum const &ops);\nOpSum operator+(Op const &op) const;\nOpSum operator+(OpSum const &ops) const;\n
"},{"location":"documentation/operators/opsum/#usage-example","title":"Usage Example","text":"JuliaC++
# Define the 1D transverse-field Ising chain\nlet \n    N = 12\n    J = 1.0\n    h = 0.5\n    Sx = [0 1; 1 0]\n\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"ISING\", \"J\", [i, mod1(i+1, N)])\n        ops += Op(\"SX\", h * Sx, i)\n    end\n\n    ops[\"J\"] = 1.0;\n    @show ops\n    @show defined(ops, \"J\")\n    @show isreal(ops)\n    @show isexplicit(ops)\nend\n
// Define the 1D transverse-field Ising chain\nint N = 12;\ndouble J = 1.0;\ndouble h = 0.5;\nauto Sx = arma::mat(\"0 1; 1 0\");\n\nauto ops = OpSum();\nfor (int i = 0; i<N; ++i) {\n  ops += Op(\"ISING\", \"J\", {i, (i+1)%N});\n  ops += Op(\"SX\", arma::mat(h*Sx), i);\n}\nops[\"J\"] = 1.0;\nXDIAG_SHOW(ops);\nXDIAG_SHOW(ops.defined(\"J\"));\nXDIAG_SHOW(ops.isreal());\nXDIAG_SHOW(ops.isexplicit());\n
"},{"location":"documentation/operators/symmetrize/","title":"symmetrize","text":"

Symmetrizes an operator with respect to a permutation symmetry group.

Source symmetrize.hpp

JuliaC++
symmetrize(op::Op, group::PermutationGroup)\nsymmetrize(op::Op, group::PermutationGroup, irrep::Representation)\nsymmetrize(ops::OpSum, group::PermutationGroup)\nsymmetrize(ops::OpSum, group::PermutationGroup, irrep::Representation)\n
OpSum symmetrize(Op const &op, PermutationGroup const &group);\nOpSum symmetrize(Op const &op, PermutationGroup const &group, Representation const &irrep);\nOpSum symmetrize(OpSum const &ops, PermutationGroup const &group);\nOpSum symmetrize(OpSum const &ops, PermutationGroup const &group, Representation const &irrep);\n
"},{"location":"documentation/operators/symmetrize/#parameters","title":"Parameters","text":"Name Description ops / op OpSum or Op defining the operator to be symmetrized group PermutationGroup defining the permutation symmetries irrep Irreducible Representation of the symmetry group

Symmetrization in this context means the following. In general, we are given an OpSum of the form,

\\[ O = \\sum_{A\\subseteq \\mathcal{L}} O_A,\\]

where \\(O_A\\) denotes a local operator acting on sites \\(A=\\{a_1, \\ldots, a_{l_A}\\}\\) and \\(L\\) denotes the lattice. A PermutationGroup \\(\\mathcal{G}\\) is defined through its permutations \\(\\pi_1, \\ldots, \\pi_M\\). The symmetrized operator returned by this function is then

\\[ O^\\mathcal{G} = \\frac{1}{M}\\sum_{A\\subseteq \\mathcal{L}} \\sum_{\\pi \\in \\mathcal{G}} O_{\\pi(A)},\\]

where \\(\\pi(A) = \\{\\pi(a_1), \\ldots,\\pi(a_{l_A})\\}\\) denotes the permutated set of sites of the local operator \\(O_A\\). If a Representation called \\(\\rho\\) is given in addition, the following operator is constructed,

\\[ O^\\mathcal{G, \\rho} = \\frac{1}{M}\\sum_{A\\subseteq \\mathcal{L}} \\sum_{\\pi \\in \\mathcal{G}} \\chi_\\rho(\\pi) O_{\\pi(A)},\\]

where \\(\\chi_\\rho(\\pi)\\) denotes the characters of the representation \\(\\rho\\). This routine is useful to evaluate observables in symmetrized blocks.

"},{"location":"documentation/operators/symmetrize/#usage-example","title":"Usage Example","text":"JuliaC++
let\n    N = 4\n    nup = 2\n    block = Spinhalf(N, nup)\n    p1 = Permutation([1, 2, 3, 4])\n    p2 = Permutation([2, 3, 4, 1])\n    p3 = Permutation([3, 4, 1, 2])\n    p4 = Permutation([4, 1, 2, 3])\n    group = PermutationGroup([p1, p2, p3, p4])\n    rep = Representation([1, 1, 1, 1])\n    block_sym = Spinhalf(N, group, rep)\n\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", 1.0, [i, mod1(i+1, N)])\n    end\n\n    e0, psi = eig0(ops, block);\n    e0, psi_sym = eig0(ops, block_sym);\n\n    corr = Op(\"HB\", 1.0, [1, 2])\n    nn_corr = inner(corr, psi)\n    corr_sym = symmetrize(corr, group)\n    nn_corr_sym = inner(corr_sym, psi_sym)\n    @show nn_corr, nn_corr_sym\nend\n
int N = 4;\nint nup = 2;\nauto block = Spinhalf(N, nup);\nauto p1 = Permutation({0, 1, 2, 3});\nauto p2 = Permutation({1, 2, 3, 0});\nauto p3 = Permutation({2, 3, 0, 1});\nauto p4 = Permutation({3, 0, 1, 2});\nauto group = PermutationGroup({p1, p2, p3, p4});\nauto rep = Representation({1, 1, 1, 1});\nauto block_sym = Spinhalf(N, group, rep);\n\nauto ops = OpSum();\nfor (int i=0; i<N; ++i) {\n  ops += Op(\"HB\", 1.0, {i, (i+1)%N});\n}\nauto [e0, psi] = eig0(ops, block);\nauto [e0s, psi_sym] = eig0(ops, block_sym);\n\nauto corr = Op(\"HB\", 1.0, {0, 1});\nauto nn_corr = inner(corr, psi);\nauto corr_sym = symmetrize(corr, group);\nauto nn_corr_sym = innerC(corr_sym, psi_sym);\nXDIAG_SHOW(nn_corr);\nXDIAG_SHOW(nn_corr_sym);\n
"},{"location":"documentation/states/create_state/","title":"Functions to create and modify states","text":"

Source create_state.hpp

"},{"location":"documentation/states/create_state/#product","title":"product","text":"

Creates a filled product state.

JuliaC++
product(block::Block, local_states::Vector{String}, real::Bool=true)\n
State product(Block const &block, std::vector<std::string> const &local_state, bool real = true);\n
"},{"location":"documentation/states/create_state/#parameters","title":"Parameters","text":"Name Description block block on which the state is defined local_states local configurations of the product state real flag whether real state is created"},{"location":"documentation/states/create_state/#rand","title":"rand","text":"

Create a filled random state with normal distributed coefficients.

JuliaC++
rand(block::Block, real::Bool=true, seed::Int64=42, normalized::Bool=true\n
State rand(Block const &block, bool real = true, int64_t seed = 42, bool normalized = true);\n
"},{"location":"documentation/states/create_state/#parameters_1","title":"Parameters","text":"Name Description block block on which the state is defined real flag whether real state is created seed random seed determining the precise random numbers normalized flag whether the state is normalized"},{"location":"documentation/states/create_state/#zeros","title":"zeros","text":"

Create a filled state with all zero entries.

JuliaC++
zeros(block::Block, real::Bool=true, n_col::Int64=1)\n
State zeros(Block const &block, bool real = true, int64_t n_cols = 1);\n
"},{"location":"documentation/states/create_state/#parameters_2","title":"Parameters","text":"Name Description block block on which the state is defined real flag whether real state is created n_col number of columns in the state"},{"location":"documentation/states/create_state/#zero","title":"zero","text":"

Set all coefficients of a given state to zero.

JuliaC++
zero(state::State)\n
void zero(State &state);\n
"},{"location":"documentation/states/create_state/#usage-example","title":"Usage Example","text":"JuliaC++
block = Spinhalf(2)\nstate = product(block, [\"Up\", \"Dn\"])\ndisplay(vector(state))\n\nzero(state)\ndisplay(vector(state))\n\nstate = rand(block, false, 1234, true)\ndisplay(vector(state))\n\nstate = zeros(block, true, 2)\ndisplay(matrix(state))\n
auto block = Spinhalf(2);\nauto state = product(block, {\"Up\", \"Dn\"});\nXDIAG_SHOW(state.vector());\n\nzero(state);\nXDIAG_SHOW(state.vector());\n\nstate = rand(block, false, 1234, true);\nXDIAG_SHOW(state.vectorC());\n\nstate = zeros(block, true, 2);\nXDIAG_SHOW(state.vector());\n
"},{"location":"documentation/states/fill/","title":"fill","text":"

Fills a State with a given model state, e.g. a ProductState or a RandomState.

Source fill.hpp

"},{"location":"documentation/states/fill/#definition","title":"Definition","text":"JuliaC++
fill(state::State, pstate::ProductState, ncol::Int64 = 1)\nfill(state::State, rstate::RandomState, ncol::Int64 = 1)\n
void fill(State &state, ProductState const &pstate, int64_t ncol = 0);\nvoid fill(State &state, RandomState const &rstate, int64_t ncol = 0);\n
"},{"location":"documentation/states/fill/#parameters","title":"Parameters","text":"Name Description state State object to be filled pstate ProductState object rstate RandomState object ncol integer deciding which column of the State is filled (default: 1/0 (Julia/C++))"},{"location":"documentation/states/fill/#usage-example","title":"Usage Example","text":"JuliaC++
block = Spinhalf(2)\nstate = State(block)\npstate = ProductState([\"Up\", \"Dn\"])\nfill(state, pstate)\ndisplay(vector(state))\n\nrstate = RandomState(1234)\nfill(state, rstate)\ndisplay(vector(state))\n
auto block = Spinhalf(2);\nauto state = State(block);  \nauto pstate = ProductState({\"Up\", \"Dn\"});\nfill(state, pstate);\nXDIAG_SHOW(state.vector());\n\nauto rstate = RandomState(1234);\nfill(state, rstate);\nXDIAG_SHOW(state.vector());\n
"},{"location":"documentation/states/product_state/","title":"ProductState","text":"

A product state of local configurations

Source product_state.hpp

"},{"location":"documentation/states/product_state/#constructors","title":"Constructors","text":"JuliaC++
ProductState(n_sites::Int64)\nProductState(local_states::Vector{String})\n
ProductState(int64_t n_sites);\nProductState(std::vector<std::string> const &local_states);\n
Parameter Description n_sites construct a product state on n_sites local_states the local configurations of the product state"},{"location":"documentation/states/product_state/#iteration","title":"Iteration","text":"

A Product state can be iterated over, where at each iteration the string of the local configuration is retured. Here is an example:

JuliaC++
pstate = ProductState([\"Up\", \"Dn\", \"Emp\", \"UpDn\"])\nfor s in pstate\n    @show s\nend\n
auto pstate = ProductState({\"Up\", \"Dn\", \"Emp\", \"UpDn\"});\nfor (auto s : pstate) {\n    Log(\"{}\", s);\n}\n
"},{"location":"documentation/states/product_state/#methods","title":"Methods","text":"

n_sites

Returns the number of sites of the product state

JuliaC++
n_sites(state::ProductState)\n
int64_t n_sites() const\n

size

Returns the number of sites of the product state. Same as \"n_sites\".

JuliaC++
size(state::ProductState)\n
int64_t size() const\n

setindex! / operator[]

Sets the local configuration at the given site index to the given string.

JuliaC++
setindex!(state::ProductState, local_state::String, idx::Int64)\n
std::string &operator[](int64_t i);\n

getindex / operator[]

Returns the string of the local configuration at the given site index.

JuliaC++
getindex(state::ProductState, idx::Int64)\n
std::string const &operator[](int64_t i) const;\n

push! / push_back

Adds a local configuration add the end of the product state.

JuliaC++
push!(state::ProductState, local_state::String\n
void push_back(std::string l);\n
"},{"location":"documentation/states/product_state/#usage-example","title":"Usage Example","text":"JuliaC++
pstate = ProductState([\"Up\", \"Dn\", \"Emp\", \"UpDn\"])\nfor s in pstate\n    @show s\nend\n@show pstate\n\npstate = ProductState()\npush!(pstate, \"Dn\")\npush!(pstate, \"Up\")\npush!(pstate, \"Dn\")\n@show n_sites(pstate)\nfor s in pstate\n    @show s\nend\n@show pstate\n
auto pstate = ProductState({\"Up\", \"Dn\", \"Emp\", \"UpDn\"});\nfor (auto s : pstate) {\n  Log(\"{}\", s);\n}\nXDIAG_SHOW(to_string(pstate));\n\npstate = ProductState();\npstate.push_back(\"Dn\");\npstate.push_back(\"Up\");\npstate.push_back(\"Dn\");\nXDIAG_SHOW(pstate.n_sites());\nfor (auto s : pstate) {\n  Log(\"{}\", s);\n}\nXDIAG_SHOW(to_string(pstate));\n
"},{"location":"documentation/states/random_state/","title":"RandomState","text":"

A random state with normal distributed coefficients

Source random_state.hpp

"},{"location":"documentation/states/random_state/#constructors","title":"Constructors","text":"JuliaC++
RandomState(seed::Int64 = 42, normalized::Bool = true)\n
RandomState(int64_t seed = 42, bool normalized = true);\n
Parameter Description seed random seed determining which random numbers are put normalized flag whether the State is normalized"},{"location":"documentation/states/random_state/#methods","title":"Methods","text":"

seed

Returns the seed of the random state

JuliaC++
seed(state::RandomState)\n
int64_t seed() const;\n

size

Returns whether the state is normalized.

JuliaC++
normalized(state::RandomState)\n
bool normalized() const;\n
"},{"location":"documentation/states/random_state/#usage-example","title":"Usage Example","text":"JuliaC++
block = Spinhalf(2)\nstate = State(block, real=false)  # complex State\nrstate1 = RandomState(1234)\nfill(state, rstate1)\ndisplay(vector(state))\n\nrstate2 = RandomState(4321)\nfill(state, rstate2)\ndisplay(vector(state))\n\nfill(state, rstate1)\ndisplay(vector(state))\n
auto block = Spinhalf(2);\nauto state = State(block, false);  // complex State\nauto rstate1 = RandomState(1234);\nfill(state, rstate1);\nXDIAG_SHOW(state.vectorC());\n\nauto rstate2 = RandomState(4321);\nfill(state, rstate2);\nXDIAG_SHOW(state.vectorC());\n\nfill(state, rstate1);\nXDIAG_SHOW(state.vectorC());\n
"},{"location":"documentation/states/state/","title":"State","text":"

A generic state describing a quantum wave function

Source state.hpp

"},{"location":"documentation/states/state/#constructors","title":"Constructors","text":"JuliaC++
State(block::Block; real::Bool = true, n_cols::Int64 = 1)\nState(block::Block, vec::Vector{Float64})\nState(block::Block, vec::Vector{ComplexF64})\nState(block::Block, mat::Matrix{Float64})\nState(block::Block, mat::Matrix{ComplexF64})\n
State(Block const &block, bool real = true, int64_t n_cols = 1);\n\ntemplate <typename block_t, typename coeff_t>\nState(block_t const &block, arma::Col<coeff_t> const &vector);\n\ntemplate <typename block_t, typename coeff_t>\nState(block_t const &block, arma::Mat<coeff_t> const &matrix);\n
Parameter Description block The block of a Hilbertspace on which the state is defined real Flag whether or not the state has real coefficients n_cols Number of columns of the state (default 1) vector A vector containing the coefficients of the state. Must be same size as block. matrix A matrix containing the coefficients of the state. Number of rows must be same as block size ."},{"location":"documentation/states/state/#methods","title":"Methods","text":"

n_sites

Returns the number of sites of the block the state is defined on.

JuliaC++
n_sites(state::State)\n
int64_t n_sites() const\n

isreal

Returns whether the state is real.

JuliaC++
isreal(state::State)\n
int64_t isreal() const;\n

real

Returns whether the real part of the State.

JuliaC++
real(state::State)\n
State real() const;\n

imag

Returns whether the imaginary part of the State.

JuliaC++
imag(state::State)\n
State imag() const;\n

make_complex! / make_complex

Turns a real State into a complex State. Does nothing if the state is already complex

JuliaC++
make_complex!(state::State)\n
void make_complex();\n

dim

Returns the dimension of the block the state is defined on.

JuliaC++
dim(block::Spinhalf)\n
int64_t dim() const;\n

size

Returns the size of the block the state is defined on. locally. Same as \"dim\" for non-distributed Blocks but different for distributed blocks.

JuliaC++
size(block::Spinhalf)\n
int64_t size() const;\n

n_rows

Returns number of rows of the local storage. Same as \"size\"

JuliaC++
n_rows(block::Spinhalf)\n
int64_t n_rows() const;\n

n_cols

Returns number of columns of the local storage.

JuliaC++
n_cols(block::Spinhalf)\n
int64_t n_cols() const;\n

col

Returns a state created from the n-th column of the storage. Whether or not the storage is copied can be specified by setting the flag \"copy\".

JuliaC++
col(state::State, n::Int64 = 1; copy::Bool = true)\n
State col(int64_t n, bool copy = true) const;\n

vector/vectorC

Returns a vector from the n-th column of the storage. In C++ use \"vector\"/\"vectorC\" to either get a real or complex vector.

JuliaC++
vector(state::State; n::Int64 = 1)\n# no vectorC method in julia\n
arma::vec vector(int64_t n = 0, bool copy = true) const;\narma::cx_vec vectorC(int64_t n = 0, bool copy = true) const;\n

matrix/matrixC

Returns matrix representing the storage. In C++ use \"matrix\"/\"matrixC\" to either get a real or complex matrix.

JuliaC++
matrix(state::State)\n# no matrixC method in julia\n
arma::vec matrix(bool copy = true) const;\narma::cx_vec matrixC(bool copy = true) const;\n
"},{"location":"documentation/states/state/#usage-example","title":"Usage Example","text":"JuliaC++
block = Spinhalf(2)\npsi1 = State(block, [1.0, 2.0, 3.0, 4.0])\n@show psi1\ndisplay(vector(psi1))\nmake_complex!(psi1)\ndisplay(vector(psi1))\n\npsi2 = State(block, real=false, n_cols=3)\n@show psi2\ndisplay(matrix(psi2))\n\npsi3 = State(block, [1.0+4.0im, 2.0+3.0im, 3.0+2.0im, 4.0+1.0im])\ndisplay(vector(psi3))\ndisplay(vector(real(psi3)))\ndisplay(vector(imag(psi3)))\n
auto block = Spinhalf(2);\nauto psi1 = State(block, arma::vec(\"1.0 2.0 3.0 4.0\"));\nXDIAG_SHOW(psi1);\nXDIAG_SHOW(psi1.vector());\npsi1.make_complex();\nXDIAG_SHOW(psi1.vectorC());\n\nauto psi2 = State(block, false, 3);\nXDIAG_SHOW(psi2);\nXDIAG_SHOW(psi2.matrixC());\n\nauto psi3 = State(block, arma::cx_vec(arma::vec(\"1.0 2.0 3.0 4.0\"),\n                      arma::vec(\"4.0 3.0 2.0 1.0\")));\nXDIAG_SHOW(psi3.vectorC());\nXDIAG_SHOW(psi3.real().vector());\nXDIAG_SHOW(psi3.imag().vector());\n
"},{"location":"documentation/symmetries/permutation/","title":"Permutation","text":"

Permutations of indices or lattice sites

Source permutation.hpp

"},{"location":"documentation/symmetries/permutation/#constructors","title":"Constructors","text":"

Creates an Permutation out of an array of integers, e.g. [0, 2, 1, 3]. If the input array is of size N then every number between 0 and N-1 must occur exactly once, otherwise the Permutation is invalid.

JuliaC++
Permutation(array::Vector{Int64})\n
Permutation(std::vector<int64_t> const &array);\n

1-indexing in Julia / 0-indexing in C++

To enumerate the sites of a Permutation, we start counting at 1 in Julia and 0 in C++.

"},{"location":"documentation/symmetries/permutation/#methods","title":"Methods","text":"

inverse

Computes the inverse permutation.

JuliaC++
inverse(perm::Permutation)\n
// As a member function\nPermutation inverse() const;\n\n// As a non-member function\nPermutation inverse(Permutation const &p);\n

\"*\" operator

Concatenates two permutations by overloading the * operator.

JuliaC++
Base.:*(p1::Permutation, p2::Permutation)\n
Permutation operator*(Permutation const &p1, Permutation const &p2);\n

size

Returns the size of the permutation, i.e. the number of indices being permuted.

JuliaC++
size(perm::Permutation)\n
// As a member function\nint64_t size() const;\n\n// As a non-member function\nint64_t size(Permutation const &p);\n
"},{"location":"documentation/symmetries/permutation/#usage-example","title":"Usage Example","text":"JuliaC++
p1 = Permutation([1, 3, 2, 4])\np2 = Permutation([3, 1, 2, 4])\n\n@show inverse(p1)\n@show p1 * p2\n
Permutation p1 = {0, 2, 1, 3};\nPermutation p2 = {2, 0, 1, 3};\n\nXDIAG_SHOW(inverse(p1));\nXDIAG_SHOW(p1*p2);\n
"},{"location":"documentation/symmetries/permutation_group/","title":"Permutation","text":"

A group of permutations

Source permutation_group.hpp

"},{"location":"documentation/symmetries/permutation_group/#constructor","title":"Constructor","text":"

Creates an PermutationGroup out of a vector of Permutation objects.

JuliaC++
PermutationGroup(permutations::Vector{Permutation})\n
PermutationGroup(std::vector<Permutation> const &permutations);\n
"},{"location":"documentation/symmetries/permutation_group/#methods","title":"Methods","text":"

n_sites

Returns the number of sites on which the permutations of the group acts.

JuliaC++
n_sites(group::PermutationGroup)\n
int64_t n_sites() const\n

size

Returns the size of the permutation group, i.e. the number permutations

JuliaC++
size(group::PermutationGroup)\n
int64_t size() const;\n

inverse

Given an index of a permutation, it returns the index of the inverse permutation.

JuliaC++
inverse(group::PermutationGroup, idx::Integer)\n
// As a member function\nint64_t inverse(int64_t sym) const;\n
"},{"location":"documentation/symmetries/permutation_group/#usage-example","title":"Usage Example","text":"JuliaC++
# Define a cyclic group of order 3\np1 = Permutation([1, 2, 3])\np2 = Permutation([2, 3, 1])\np3 = Permutation([3, 1, 2])\nC3 = PermutationGroup([p1, p2, p3])\n\n@show size(C3)\n@show n_sites(C3)\n@show inverse(C3, 1) # = 2\n
// Define a cyclic group of order 3\nPermutation p1 = {0, 1, 2};\nPermutation p2 = {1, 2, 0};\nPermutation p3 = {2, 0, 1};\nauto C3 = PermutationGroup({p1, p2, p3});\n\nXDIAG_SHOW(C3.size());\nXDIAG_SHOW(C3.n_sites());\nXDIAG_SHOW(C3.inverse(1)); // = 2\n
"},{"location":"documentation/symmetries/representation/","title":"Representation","text":"

A (1D) irreducible representation of a finite group.

Source representation.hpp

"},{"location":"documentation/symmetries/representation/#constructors","title":"Constructors","text":"

Creates a Representation from a vector of complex numbers

JuliaC++
Representation(characters::Vector{<:Number})\n
Representation(std::vector<complex> const &characters);\n
"},{"location":"documentation/symmetries/representation/#methods","title":"Methods","text":"

size

Returns the size of the Representation, i.e. the number of characters.

JuliaC++
size(irrep::Representation)\n
int64_t size() const;\n

isreal

Returns the whether or not the Representation is real, I.E. the characters are real numbers and do not have an imaginary part.

JuliaC++
isreal(irrep::Representation; precision::Real=1e-12)\n
bool isreal(double precision = 1e-12) const;\n

\"*\" operator

Multiplies two Representations by overloading the * operator.

JuliaC++
Base.:*(p1::Representation, p2::Representation)\n
Representation operator*(Representation const &p1, Representation const &p2);\n
"},{"location":"documentation/symmetries/representation/#usage-example","title":"Usage Example","text":"JuliaC++
r1 = Representation([1, -1, 1, -1])\nr2 = Representation([1, 1im, -1, -1im])\n\n@show r1 * r2\n
Representation r1 = {1, -1, 1, -1};\nRepresentation r2 = {1, 1i, -1, -1i};\n\nXDIAG_SHOW(r1 * r2);\n
"},{"location":"documentation/utilities/logging/","title":"Logging","text":""},{"location":"documentation/utilities/logging/#setting-the-verbosity","title":"Setting the verbosity","text":"

Algorithms implemented in XDiag do not output anything during their execution by default. However, it is typically useful to get some information on how the code is performing and even intermediary results at runtime. For this, the verbosity of the internal XDiag logging can be set using the function set_verbosity, which is defined as

JuliaC++
set_verbosity(level::Integer);\n
void set_verbosity(int64_t level);\n

There are several levels of verbosity, defining how much information is shown.

level outputed information 0 no information 1 some information 2 detailed information

For example, when computing a ground state energy using the eigval0 function, we can set a higher verbosity level using

JuliaC++
set_verbosity(2);\ne0 = eigval0(bonds, block);\n
set_verbosity(2);\ndouble e0 = eigval0(bonds, block);\n

This will print detailed information, which can look like this

Lanczos iteration 1\nMVM: 0.00289 secs\nalpha: -0.2756971549998545\nbeta: 1.7639347562074059\neigs: -0.2756971549998545\nLanczos iteration 2\nMVM: 0.00244 secs\nalpha: -0.7116140394927443\nbeta: 2.3044797637130743\neigs: -2.2710052270892791 1.2836940325966804\nLanczos iteration 3\nMVM: 0.00210 secs\nalpha: -1.2772539678430306\nbeta: 2.6627870395174456\neigs: -3.7522788386927637 -0.6474957945455240 2.1352094709026579\n
"},{"location":"documentation/utilities/logging/#log-mechanism-c-only","title":"Log mechanism (C++ only)","text":"

Producing nicely formatted output is unfortunately a bit cumbersome in standard C++. For this, the Log mechanism in XDiag can help. To simply write out a line of information you can call,

Log(\"hello from the logger\");\n

By default, a new line is added. It is also possible to set verbosity by handing the level as the first argument,

Log(2, \"hello from the logger only if global verbosity is set to >= 2\");\n

This message will only appear if the global verbosity level is set to a value \\(\\geq 2\\). Finally, XDiag also supports formatted output by using the fmtlib. For example, numbers can be formated this way

Log(\"pi is around {:.4f} and the answer is {}\", 3.141592, 42);\n
"},{"location":"documentation/utilities/logging/#source","title":"Source","text":"

logger.hpp

"},{"location":"documentation/utilities/timing/","title":"Timing","text":"

In standard C++ measuring time is a bit awkward. To quickly monitor the CPU time spent by XDiag by simple functions.

"},{"location":"documentation/utilities/timing/#simple-timing-using-tic-toc","title":"Simple timing using tic() / toc()","text":"

Similar as in Matlab one can use tic() and toc() to measure the time spent between two points in the code.

tic();\ndouble e0 = eigval0(bonds, block);\ntoc();\n

toc() will output the time spent since the last time tic() has been called.

"},{"location":"documentation/utilities/timing/#detailed-timing","title":"Detailed timing","text":"

To get the present time, simply call

auto time = rightnow();\n

A timing (in second) between two time points can be written to output using

timing(begin, end);\n

This can even be accompanied by a message about what is being timed and a verbosity level (see Logging) can also be set. The full call signature is

timing(begin, end, message, level);\n
Name Description Default begin starting time computed using rightnow() end end time computed using rightnow() message message string to be prepended to timing \"\" level verbosity level at which timing is printed 0"},{"location":"documentation/utilities/utils/","title":"Miscellaneous utility functions","text":""},{"location":"documentation/utilities/utils/#set_verbosity","title":"set_verbosity","text":"

Set how much logging is generated my XDiag to monitor the progress and behaviour of the code. There are three verbosity levels that can be set:

This can be useful, e.g. to monitor the progress of an iterative algorithm

JuliaC++
set_verbosity(level::Int64)\n
void set_verbosity(int64_t level);\n
"},{"location":"documentation/utilities/utils/#say_hello","title":"say_hello","text":"

Prints a nice welcome message containing the version number and git commit used.

JuliaC++
say_hello()\n
void say_hello()\n
"},{"location":"documentation/utilities/utils/#print_version","title":"print_version","text":"

If say_hello is too much flower power for you, one can also just have a boring print-out of the version number using this function.

JuliaC++
print_version()\n
void print_version()\n
"},{"location":"documentation/utilities/xdiag_show/","title":"Debug printing","text":"

For quick debugging in C++, XDiag features a simple macro which outputs the name and content of a variable calles XDIAG_SHOW(x). For example

Spinhalf block(16, 8);\nXDIAG_SHOW(block);\n

will write an output similar to

block:\n  n_sites  : 16\n  n_up     : 8\n  dimension: 12,870\n  ID       : 0xa9127434d66b9878\n

The XDIAG_SHOW(x) macro can be used on any XDiag object and several other standard C++ objects as well.

"},{"location":"examples/cmake_distributed/","title":"CMakeLists.txt for the distributed XDiag library","text":"
cmake_minimum_required(VERSION 3.19)\n\nproject(\n  tj_distributed_time_evolve\n)\n\nfind_package(xdiag_distributed REQUIRED HINTS ../../../install)\nadd_executable(main main.cpp)\ntarget_link_libraries(main PUBLIC xdiag::xdiag_distributed)\n
"},{"location":"examples/cmake_normal/","title":"CMakeLists.txt for the normal XDiag library","text":"
cmake_minimum_required(VERSION 3.19)\n\nproject(\n  hello_world\n)\n\nfind_package(xdiag REQUIRED HINTS \"../../install\")\nadd_executable(main main.cpp)\ntarget_link_libraries(main PRIVATE xdiag::xdiag)\n
"},{"location":"examples/hello_world/","title":"Hello world!","text":"JuliaC++
   using XDiag\n   say_hello()\n
   #include <xdiag/all.hpp>\n\n   using namespace xdiag;\n\n   int main() try {\n     say_hello();\n   } catch (Error e) {\n     error_trace(e);\n   }\n
"},{"location":"examples/spinhalf_chain_e0/","title":"Groundstate energy","text":"JuliaC++
using XDiag\n\nlet \n    N = 16\n    nup = N \u00f7 2\n    block = Spinhalf(N, nup)\n\n    # Define the nearest-neighbor Heisenberg model\n    ops = OpSum()\n    for i in 1:N\n        ops += Op(\"HB\", \"J\", [i-1, i % N])\n    end\n    ops[\"J\"] = 1.0\n\n    set_verbosity(2)            # set verbosity for monitoring progress\n    e0 = eigval0(ops, block)    # compute ground state energy\n\n    println(\"Ground state energy: $e0\")\nend\n
#include <xdiag/all.hpp>\n\nusing namespace xdiag;\n\nint main() try {\n  int N = 16;\n  int nup = N / 2;\n  Spinhalf block(N, nup);\n\n  // Define the nearest-neighbor Heisenberg model\n  OpSum ops;\n  for (int i = 0; i < N; ++i) {\n    ops += Op(\"HB\", \"J\", {i, (i + 1) % N});\n  }\n  ops[\"J\"] = 1.0;\n\n  set_verbosity(2);                  // set verbosity for monitoring progress\n  double e0 = eigval0(ops, block); // compute ground state energy\n\n  Log(\"Ground state energy: {:.12f}\", e0);\n\n} catch (Error e) {\n  error_trace(e);\n}\n
"},{"location":"examples/tj_distributed_time_evolve/","title":"\\(t\\)-\\(J\\) distributed time evolution","text":"
#include <xdiag/all.hpp>\n\nusing namespace xdiag;\n\nvoid measure_density(int n_sites, State const &v) {\n  int rank;\n  MPI_Comm_rank(MPI_COMM_WORLD, &rank);\n  for (int i = 0; i < n_sites; ++i) {\n    complex sz = innerC(Bond(\"NUMBER\", i), v);\n    if (rank == 0) {\n      printf(\"%.6f \", std::real(sz));\n    }\n  }\n  if (rank == 0) {\n    printf(\"\\n\");\n  }\n}\n\nint main(int argc, char **argv) try {\n  MPI_Init(&argc, &argv);\n\n  int L = 6;\n  int W = 4;\n  double t = 1.0;\n  double J = 0.1;\n  double mu_0 = 10;\n\n  int n_sites = L * W;\n  double precision = 1e-12;\n\n  // Create square lattice t-J model\n  OpSum ops;\n  for (int x = 0; x < L-1; ++x) {\n    for (int y = 0; y < W; ++y) {\n      int nx = (x + 1) % L;\n      int ny = (y + 1) % W;\n\n      int site = x * W + y;\n      int right = nx * W + y;\n      int top = x * W + ny;\n      ops += Op(\"HOP\", \"T\", {site, right});\n      ops += Op(\"EXCHANGE\", \"J\", {site, right});\n      ops += Op(\"HOP\", \"T\", {site, top});\n      ops += Op(\"EXCHANGE\", \"J\", {site, top});\n\n\n\n      if (x < L / 2) {\n    Log(\"x {} y {} site {} t {} r {} +\", x, y, site, top, right);\n        ops += Op(\"NUMBER\", \"MUPLUS\", site);\n      } else {\n    Log(\"x {} y {} site {} t {} r {} -\", x, y, site, top, right);\n        ops += Op(\"NUMBER\", \"MUNEG\", site);\n      }\n    }\n  }\n  ops[\"T\"] = t;\n  ops[\"J\"] = J;\n  ops[\"MUPLUS\"] = mu_0;\n  ops[\"MUNEG\"] = mu_0;\n\n  auto block = tJDistributed(n_sites, n_sites / 2 - 1, n_sites / 2 - 1);\n\n  XDIAG_SHOW(block);\n\n  Log.set_verbosity(2);\n  tic();\n  auto [e0, v] = eig0(ops, block);\n  toc(\"gs\");\n\n  ops[\"MUPLUS\"] = 0;\n  ops[\"MUNEG\"] = 0;\n\n  measure_density(n_sites, v);\n\n  // Do the time evolution with a step size tau\n  double tau = 0.1;\n  for (int i = 0; i < 40; ++i) {\n    tic();\n    v = time_evolve(ops, v, tau, precision);\n    toc(\"time evolve\");\n    tic();\n    measure_density(n_sites, v);\n    toc(\"measure\");\n  }\n\n  MPI_Finalize();\n  return EXIT_SUCCESS;\n} catch (std::exception const &e) {\n  traceback(e);\n}\n
"}]} \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 72539c02..8e0f781c 100644 Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ diff --git a/tutorials/index.html b/tutorials/index.html index b1aa4b13..8de826e7 100644 --- a/tutorials/index.html +++ b/tutorials/index.html @@ -72,7 +72,7 @@
- + Skip to content @@ -302,6 +302,15 @@