From 26114fa704f25877ebfd9004a003c55d4e24ab74 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Thu, 10 Apr 2025 10:30:05 -0400 Subject: [PATCH 1/4] Update Readme --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a1b7876..8129fd3 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,14 @@ This is a small package that aims to provide several commonly used tensors for TensorKit, with various symmetries. For a full list of implemented tensors, see the [documentation](https://QuantumKitHub.github.io/TensorKitTensors.jl/stable/). +If there are any tensors you would like to see added, feel free to open an issue or a pull request. ## Installation +Installation is done via the Julia package manager. +You can install it by running the following command in the Julia REPL: + ```julia -julia> import Pkg -julia> Pkg.add("https://github.com/QuantumKitHub/TensorKitTensors.jl") +julia> ] +pkg> add TensorKitTensors ``` From ffd6cf167eea613ce2333e76eab19b0f0e35edc5 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Thu, 10 Apr 2025 10:42:52 -0400 Subject: [PATCH 2/4] Clean up docs --- docs/make.jl | 4 +++- docs/src/bosonoperators.md | 9 +++++++++ docs/src/fermionoperators.md | 9 +++++++++ docs/src/hubbardoperators.md | 9 +++++++++ docs/src/index.md | 8 +++----- docs/src/spinoperators.md | 9 +++++++++ docs/src/tjoperators.md | 9 +++++++++ 7 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 docs/src/bosonoperators.md create mode 100644 docs/src/fermionoperators.md create mode 100644 docs/src/hubbardoperators.md create mode 100644 docs/src/spinoperators.md create mode 100644 docs/src/tjoperators.md diff --git a/docs/make.jl b/docs/make.jl index 22f6338..49abccf 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -4,6 +4,8 @@ using Documenter DocMeta.setdocmeta!(TensorKitTensors, :DocTestSetup, :(using TensorKitTensors); recursive=true) +operatorpages = ["spinoperators.md", "bosonoperators.md", "fermionoperators.md", + "tjoperators.md", "hubbardoperators.md"] makedocs(; modules=[TensorKitTensors], authors="QuantumKitHub", @@ -12,6 +14,6 @@ makedocs(; canonical="https://QuantumKitHub.github.io/TensorKitTensors.jl", edit_link="main", assets=String[],), - pages=["Home" => "index.md"],) + pages=["Home" => "index.md", "Operators" => operatorpages],) deploydocs(; repo="github.com/QuantumKitHub/TensorKitTensors.jl", devbranch="main") diff --git a/docs/src/bosonoperators.md b/docs/src/bosonoperators.md new file mode 100644 index 0000000..0152d1f --- /dev/null +++ b/docs/src/bosonoperators.md @@ -0,0 +1,9 @@ +```@meta +CollapsedDocStrings = true +``` + +# Boson operators + +```@autodocs +Modules = [TensorKitTensors.BosonOperators] +``` diff --git a/docs/src/fermionoperators.md b/docs/src/fermionoperators.md new file mode 100644 index 0000000..57995a6 --- /dev/null +++ b/docs/src/fermionoperators.md @@ -0,0 +1,9 @@ +```@meta +CollapsedDocStrings = true +``` + +# Fermion operators + +```@autodocs +Modules = [TensorKitTensors.FermionOperators] +``` diff --git a/docs/src/hubbardoperators.md b/docs/src/hubbardoperators.md new file mode 100644 index 0000000..a58fbcc --- /dev/null +++ b/docs/src/hubbardoperators.md @@ -0,0 +1,9 @@ +```@meta +CollapsedDocStrings = true +``` + +# Hubbard operators + +```@autodocs +Modules = [TensorKitTensors.HubbardOperators] +``` diff --git a/docs/src/index.md b/docs/src/index.md index e536830..bf97782 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -5,10 +5,8 @@ CurrentModule = TensorKitTensors # TensorKitTensors Documentation for [TensorKitTensors](https://github.com/QuantumKitHub/TensorKitTensors.jl). +This is a lightweight package that defines several commonly used tensors for TensorKit, with various symmetries. -```@index -``` - -```@autodocs -Modules = [TensorKitTensors, TensorKitTensors.SpinOperators, TensorKitTensors.BosonOperators, TensorKitTensors.HubbardOperators, TensorKitTensors.TJOperators, TensorKitTensors.FermionOperators] +```@contents +Pages = Main.operatorpages ``` diff --git a/docs/src/spinoperators.md b/docs/src/spinoperators.md new file mode 100644 index 0000000..05c36e0 --- /dev/null +++ b/docs/src/spinoperators.md @@ -0,0 +1,9 @@ +```@meta +CollapsedDocStrings = true +``` + +# Spin operators + +```@autodocs +Modules = [TensorKitTensors.SpinOperators] +``` diff --git a/docs/src/tjoperators.md b/docs/src/tjoperators.md new file mode 100644 index 0000000..b90a4c2 --- /dev/null +++ b/docs/src/tjoperators.md @@ -0,0 +1,9 @@ +```@meta +CollapsedDocStrings = true +``` + +# TJ operators + +```@autodocs +Modules = [TensorKitTensors.TJOperators] +``` From 23f4ba959d3310a200f3b7aac389abf1133d408a Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Thu, 10 Apr 2025 10:44:57 -0400 Subject: [PATCH 3/4] Add documentation actions --- .github/workflows/DocumentationCleanup.yml | 33 ++++++++++++++++++++++ .github/workflows/DocumentationPreview.yml | 17 +++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/DocumentationCleanup.yml create mode 100644 .github/workflows/DocumentationPreview.yml diff --git a/.github/workflows/DocumentationCleanup.yml b/.github/workflows/DocumentationCleanup.yml new file mode 100644 index 0000000..5be23b9 --- /dev/null +++ b/.github/workflows/DocumentationCleanup.yml @@ -0,0 +1,33 @@ +name: Doc Preview Cleanup + +on: + pull_request: + types: [closed] + +# Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time +concurrency: + group: doc-preview-cleanup + cancel-in-progress: false + +jobs: + doc-preview-cleanup: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v4 + with: + ref: gh-pages + - name: Delete preview and history + push changes + run: | + if [ -d "${preview_dir}" ]; then + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf "${preview_dir}" + git commit -m "delete preview" + git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + git push --force origin gh-pages-new:gh-pages + fi + env: + preview_dir: previews/PR${{ github.event.number }} diff --git a/.github/workflows/DocumentationPreview.yml b/.github/workflows/DocumentationPreview.yml new file mode 100644 index 0000000..b83a38e --- /dev/null +++ b/.github/workflows/DocumentationPreview.yml @@ -0,0 +1,17 @@ +name: Docs preview comment +on: + pull_request: + types: [labeled] + +permissions: + pull-requests: write +jobs: + pr_comment: + runs-on: ubuntu-latest + steps: + - name: Create PR comment + if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name && github.event.label.name == 'documentation' + uses: thollander/actions-comment-pull-request@v3 + with: + message: 'After the build completes, the updated documentation will be available [here](https://quantumkithub.github.io/TensorKitTensors.jl/previews/PR${{ github.event.number }}/)' + comment-tag: 'preview-doc' From d88c3c0f41746fe19f61bf8744216862d9b3aa3b Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Thu, 10 Apr 2025 11:40:29 -0400 Subject: [PATCH 4/4] enable docs preview --- docs/make.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index 49abccf..6f8a5b7 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -16,4 +16,6 @@ makedocs(; assets=String[],), pages=["Home" => "index.md", "Operators" => operatorpages],) -deploydocs(; repo="github.com/QuantumKitHub/TensorKitTensors.jl", devbranch="main") +deploydocs(; repo="github.com/QuantumKitHub/TensorKitTensors.jl", + devbranch="main", + push_preview=true)