Skip to content

Commit

Permalink
Merge pull request #23 from Quantum-Many-Body/RefineOfOperatorSystem
Browse files Browse the repository at this point in the history
Refine of operator system
  • Loading branch information
waltergu authored Sep 20, 2022
2 parents abb58a7 + 2e9f1a6 commit 94fca69
Show file tree
Hide file tree
Showing 84 changed files with 9,590 additions and 10,063 deletions.
15 changes: 11 additions & 4 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ git-tree-sha1 = "f2355693d6778a178ade15952b7ac47a4ff97996"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.3.0"

[[Latexify]]
deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"]
git-tree-sha1 = "1a43be956d433b5d0321197150c2f94e16c0aaa0"
uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
version = "0.15.16"

[[LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
Expand Down Expand Up @@ -144,10 +150,11 @@ git-tree-sha1 = "6bf3f380ff52ce0832ddd3a2a7b9538ed1bcca7d"
uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
version = "1.2.1"

[[Reexport]]
git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "1.2.2"
[[Requires]]
deps = ["UUIDs"]
git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.3.0"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Expand Down
9 changes: 4 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
name = "QuantumLattices"
uuid = "78ae1a1f-1d5d-5174-b61c-66e31b2346dc"
authors = ["waltergu <[email protected]>"]
version = "0.8.15"
version = "0.9.0"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Formatting = "59287772-0a20-5a39-b81b-1366585eb4c0"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
NearestNeighbors = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"

[compat]
DataStructures = "0.18"
Formatting = "0.4"
LaTeXStrings = "1.3"
MacroTools = "0.5"
Latexify = "0.15"
NearestNeighbors = "0.4"
RecipesBase = "1.2"
Reexport = "1.2"
StaticArrays = "1.4"
TimerOutputs = "0.5"
julia = "1.6"
92 changes: 1 addition & 91 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1 @@
# QuantumLattices.jl

[![CI][main-ci-img]][main-ci-url]
[![codecov][codecov-img]][codecov-url]
[![][docs-latest-img]][docs-latest-url]
[![][docs-stable-img]][docs-stable-url]
[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)
[![LICENSE](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)

*Julia package for the construction of quantum lattice systems.*

Welcome to [QuantumLattices](https://github.com/Quantum-Many-Body/QuantumLattices.jl). Here we provide a general framework to construct the **second-quantized operator-formed Hamiltonian of any quantum lattice system**, with the inputs as simple as its description by the natural language. Combined with [SymPy](https://github.com/JuliaPy/SymPy.jl), this operator-formed Hamiltonian supports **complete symbolic computations**, making it a convenient "frontend" of quantum many-body algorithms, such as **TBA**(tight-bind approximation), **LSWT**(linear spin wave theory), **SCMF**(self-consistent mean field theory), **ED**(exact diagonalization), **CPT/VCA**(cluster perturbation theory and variational cluster approach), **DMRG**(density matrix renormalization group), etc. Generic interfaces are defined to provide a unified access to these algorithms which would be implemented in separate packages. Only minor modifications need be made when users alter from one algorithm to another.

## Installation

In Julia **v1.6+**, please type `]` in the REPL to use the package mode, then type this command:

```julia
pkg> add QuantumLattices
```

## Introduction

The core of the package is the construction of the **operator representation of a lattice Hamiltonian**. This is based on the following mathematical observations that the operators in a lattice Hamiltonian:
* **act on local Hilbert spaces**, and
* **form an algebra over the complex field**.

The first observation is the starting point of our [**unitcell description framework**](https://quantum-many-body.github.io/QuantumLattices.jl/dev/tutorials/UnitcellDescription/Introduction/) and the second is the mathematical foundation of our **symbolic computing system**.

It is noted that our implementation of the symbolic computation only involves
* the mathematical operations between a scalar and an operator, and
* the mathematical operations between two operators.

The symbolic operations between two scalars are **not** implemented because:
* in condensed matter physics, for many cases, only the numerical values of operators are relevant because the analytical expressions could be too complicated to analyze or they may even not exist;
* our construction process of the operators and their mathematical operations are **compatible with the [SymPy](https://github.com/JuliaPy/SymPy.jl) package**, therefore, a fully symbolic computation can be achieved by a simple combination of both.

The major aim of this package is to provide **unified "frontend" to access all quantum many-body algorithms**. Much of the job can be done by the construction of the operator-formed Hamiltonian, which serves as a common input for different algorithms. Utilities are also provided to deal with the project management, such as result recording, data caching, parameter updating, code logging, dependency managing, etc.

## Package Features

* **Unitcell Description Framework**: by telling the information of the quantum lattice system within a unitcell, the construction of the symbolic representation of the Hamiltonian is just as simple as describing the system in a usual research paper.
* **Complete Symbolic Computation**: with only this package, symbolic computation between operators is realized whereas the coefficient of any operator remains numeric; by integrating it with [SymPy](https://github.com/JuliaPy/SymPy.jl), complete symbolic computation can be achieved and no modifications need be made on the methods in this package.
* **Generic Frontend of Many-Body Algorithms**: quantum many-body algorithms can be initialized in quite similar ways with only minor modifications needed. Moreover, automatic project management is realized, including that of result recording, data caching, parameter updating, code logging, dependency managing, etc.

## Supported Systems

Four common kinds of systems in condensed matter physics are supported:
* **canonical fermionic systems**
* **canonical/hard-core bosonic systems**
* **SU(2) spin systems**
* **Phononic systems**

Furthermore, other systems can be supported easily by extending the generic "protocols" provided in this package.

## Supported Algorithms

Concrete algorithms could be considered as the "backend" of quantum lattice systems. They are developed in separate packages (still in progress):
* **[TBA](https://github.com/Quantum-Many-Body/TightBindingApproximation.jl)**: tight-binding approximation for fermionic/bosonic systems;
* **SCMF**: self-consistent mean field theory for fermionic systems;
* **[ED](https://github.com/Quantum-Many-Body/ExactDiagonalization.jl)**: exact diagonalization for fermionic/hard-core-bosonic/spin systems;
* **CPT/VCA**: cluster perturbation theory and variational cluster approach for fermionic systems;
* **DMRG**: density matrix renormalization group for fermionic/hard-core-bosonic/spin systems;
* **[SWT](https://github.com/Quantum-Many-Body/SpinWaveTheory.jl)**: spin wave theory for local spin systems.

## Getting Started
[Tutorials: unitcell description](https://quantum-many-body.github.io/QuantumLattices.jl/dev/tutorials/UnitcellDescription/Introduction/)

## Documentation
- [**LATEST**][docs-latest-url] &mdash; **documentation of the latest version.**
- [**STABLE**][docs-stable-url] &mdash; **documentation of the stable version.**

## Note

Due to the fast development of this package, releases with different minor version numbers are **not** guaranteed to be compatible with previous ones **before** the release of v1.0.0. Comments are welcomed in the GitHub issues.

## Contact
[email protected]

## Python counterpart
[HamiltonianPy](https://github.com/waltergu/HamiltonianPy): in fact, the authors of this Julia package worked on the python package at first and only turned to Julia later.

[main-ci-img]: https://github.com/Quantum-Many-Body/QuantumLattices.jl/actions/workflows/CI.yml/badge.svg
[main-ci-url]: https://github.com/Quantum-Many-Body/QuantumLattices.jl/actions/workflows/CI.yml
[codecov-img]: https://codecov.io/gh/Quantum-Many-Body/QuantumLattices.jl/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/Quantum-Many-Body/QuantumLattices.jl
[docs-latest-img]: https://img.shields.io/badge/docs-latest-blue.svg
[docs-latest-url]: https://quantum-many-body.github.io/QuantumLattices.jl/latest/
[docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg
[docs-stable-url]: https://quantum-many-body.github.io/QuantumLattices.jl/stable/
docs/src/index.md
61 changes: 25 additions & 36 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,38 @@ using QuantumLattices

makedocs(
format= Documenter.HTML(
prettyurls= !("local" in ARGS),
prettyurls= get(ENV, "CI", "false") == "true",
canonical= "https://quantum-many-body.github.io/QuantumLattices.jl/latest/",
assets= ["assets/favicon.ico"],
analytics= "UA-89508993-1",
),
),
sitename= "QuantumLattices.jl",
pages= [
"Home" => "index.md",
"Tutorials" => [
"Unitcell Description" => [
"tutorials/UnitcellDescription/Introduction.md",
"tutorials/UnitcellDescription/SpatialInfoOfAUnitcell.md",
"tutorials/UnitcellDescription/InternalDegreesOfFreedom.md",
"tutorials/UnitcellDescription/CouplingsAmongDifferentDegreesOfFreedom.md",
"tutorials/UnitcellDescription/GeneratorOfOperators.md",
"Home" => "index.md",
"Unitcell Description Framework" => [
"unitcell description framework/Introduction.md",
"unitcell description framework/SpatialInfoOfAUnitcell.md",
"unitcell description framework/InternalDegreesOfFreedom.md",
"unitcell description framework/CouplingsAmongDifferentDegreesOfFreedom.md",
"unitcell description framework/GeneratorOfOperators.md",
],
"Engine App Interface" => [
"tutorials/EngineAppInterface/Introduction.md",
]
],
"Manual" => [
"man/Interfaces.md",
"Prerequisites" => [
"man/Prerequisites/Introduction.md",
"man/Prerequisites/Combinatorics.md",
"man/Prerequisites/Traits.md",
"man/Prerequisites/CompositeStructures.md",
"man/Prerequisites/SimpleTrees.md",
"man/Prerequisites/NamedVectors.md",
"man/Prerequisites/VectorSpaces.md",
],
"Essentials" => [
"man/Essentials/Introduction.md",
"man/Essentials/QuantumOperators.md",
"man/Essentials/QuantumNumbers.md",
"man/Essentials/Spatials.md",
"man/Essentials/DegreesOfFreedom.md",
"man/Essentials/QuantumSystems.md",
"man/Essentials/Frameworks.md",
],
"Advanced Topics" => [
"advanced topics/Introduction.md",
"advanced topics/LaTeXFormattedOutputs.md",
"advanced topics/IndexOrders.md",
"advanced topics/BoundaryConditions.md",
"advanced topics/HybridSystems.md",
"advanced topics/Transformations.md",
"advanced topics/ManageProjects.md",
],
"Developer Documentation" => [
"developer/CodeStyle.md",
"Manual" => [
"man/Toolkit.md",
"man/QuantumOperators.md",
"man/QuantumNumbers.md",
"man/Spatials.md",
"man/DegreesOfFreedom.md",
"man/QuantumSystems.md",
"man/Frameworks.md",
]
]
)
Expand Down
10 changes: 10 additions & 0 deletions docs/src/advanced topics/BoundaryConditions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```@meta
CurrentModule = QuantumLattices
DocTestFilters = [r"im +[-\+]0\.0[-\+]"]
DocTestSetup = quote
push!(LOAD_PATH, "../../../src/")
using QuantumLattices
end
```

# Boundary conditions
10 changes: 10 additions & 0 deletions docs/src/advanced topics/HybridSystems.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```@meta
CurrentModule = QuantumLattices
DocTestFilters = [r"im +[-\+]0\.0[-\+]"]
DocTestSetup = quote
push!(LOAD_PATH, "../../../src/")
using QuantumLattices
end
```

# Hybrid systems
10 changes: 10 additions & 0 deletions docs/src/advanced topics/IndexOrders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```@meta
CurrentModule = QuantumLattices
DocTestFilters = [r"im +[-\+]0\.0[-\+]"]
DocTestSetup = quote
push!(LOAD_PATH, "../../../src/")
using QuantumLattices
end
```

# Index orders
19 changes: 19 additions & 0 deletions docs/src/advanced topics/Introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```@meta
CurrentModule = QuantumLattices
```

# [Introduction](@id AdvancedTopicsIntroduction)

The unitcell description framework is the basics of this package, which completes the goal of describing a quantum lattice system and obtaining its Hamiltonian in the operator form. Here, we introduce some advanced utilities provided in this package that will be useful for the compiling, debugging and applying of quantum many-body algorithms.

```@contents
Pages = [
"LaTeXFormattedOutputs.md",
"IndexOrders.md",
"BoundaryConditions.md",
"HybridSystems.md",
"Transformations.md",
"ManageProjects.md",
]
Depth = 2
```
10 changes: 10 additions & 0 deletions docs/src/advanced topics/LaTeXFormattedOutputs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```@meta
CurrentModule = QuantumLattices
DocTestFilters = [r"im +[-\+]0\.0[-\+]"]
DocTestSetup = quote
push!(LOAD_PATH, "../../../src/")
using QuantumLattices
end
```

# LaTeX formatted outputs
10 changes: 10 additions & 0 deletions docs/src/advanced topics/ManageProjects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```@meta
CurrentModule = QuantumLattices
DocTestFilters = [r"im +[-\+]0\.0[-\+]"]
DocTestSetup = quote
push!(LOAD_PATH, "../../../src/")
using QuantumLattices
end
```

# Manage projects
10 changes: 10 additions & 0 deletions docs/src/advanced topics/Transformations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```@meta
CurrentModule = QuantumLattices
DocTestFilters = [r"im +[-\+]0\.0[-\+]"]
DocTestSetup = quote
push!(LOAD_PATH, "../../../src/")
using QuantumLattices
end
```

# Transformations
15 changes: 0 additions & 15 deletions docs/src/developer/CodeStyle.md

This file was deleted.

Loading

0 comments on commit 94fca69

Please sign in to comment.