Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Documentation

permissions:
contents: write
pages: write

on:
push:
branches:
- 'master'
- 'main'
- 'release-'
tags: '*'
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
version:
- '1' # automatically expands to the latest stable 1.x release of Julia
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v5
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
run: julia --project=docs/ docs/make.jl
33 changes: 33 additions & 0 deletions .github/workflows/DocumentationPreviewCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Documentation Preview Cleanup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen this workflow before. Is this something standard now? Where did you find this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have it in MPSKit.jl and PEPSKit.jl. It deletes the documentation preview for a PR that is pushed to the gh-pages branch if you run Documenter.deploydocs with push_preview = true. Just so the files don't pile up there if you have many PRs I think.


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@v5
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 "[email protected]"
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 }}
17 changes: 17 additions & 0 deletions .github/workflows/DocumentationPreviewComment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Documentation 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/TensorKitSectors.jl/previews/PR${{ github.event.number }}/)'
comment-tag: 'preview-doc'
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.jl.*.cov
*.jl.cov
*.jl.mem
/Manifest.toml
.DS_Store
Manifest.toml
.DS_Store
build
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

A Julia package for working with objects in fusion categories.

| **Build Status** | **PkgEval** | **Coverage** | **Quality assurance** |
|:----------------:|:------------:|:------------:|:---------------------:|
| [![CI][ci-img]][ci-url] | [![PkgEval][pkgeval-img]][pkgeval-url] | [![Codecov][codecov-img]][codecov-url] | [![Aqua QA][aqua-img]][aqua-url] |
| **Documentation** | **Build Status** | **PkgEval** | **Coverage** | **Quality assurance** |
|:-----------------:|:----------------:|:-----------:|:------------:|:---------------------:|
| [![][docs-stable-img]][docs-stable-url] [![][docs-dev-img]][docs-dev-url] | [![CI][ci-img]][ci-url] | [![PkgEval][pkgeval-img]][pkgeval-url] | [![Codecov][codecov-img]][codecov-url] | [![Aqua QA][aqua-img]][aqua-url] |

[docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg
[docs-stable-url]: https://QuantumKitHub.github.io/TensorKitSectors.jl/stable

[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg
[docs-dev-url]: https://QuantumKitHub.github.io/TensorKitSectors.jl/latest

[ci-img]: https://github.com/QuantumKitHub/TensorKitSectors.jl/actions/workflows/CI.yml/badge.svg
[ci-url]: https://github.com/QuantumKitHub/TensorKitSectors.jl/actions/workflows/CI.yml
Expand Down
6 changes: 6 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
TensorKitSectors = "13a9c161-d5da-41f0-bcbd-e1a08ae0647f"

[compat]
Documenter = "1"
27 changes: 27 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using TensorKitSectors
using Documenter

mathengine = MathJax3(
Dict(
:loader => Dict("load" => ["[tex]/physics"]),
:tex => Dict(
"inlineMath" => [["\$", "\$"], ["\\(", "\\)"]],
"tags" => "ams",
"packages" => ["base", "ams", "autoload", "physics"]
)
)
)
makedocs(;
sitename = "TensorKitSectors.jl",
format = Documenter.HTML(;
prettyurls = true,
mathengine,
),
pages = [
"Home" => "index.md",
"Library" => "lib.md",
],
checkdocs = :exports,
)

deploydocs(; repo = "github.com/QuantumKitHub/TensorKitSectors.jl.git", push_preview = true)
12 changes: 12 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# TensorKitSectors.jl

A Julia package for working with objects in fusion categories.

This package provides functionality for defining objects in fusion categories, along with
their topological data. This includes the fusion rules, the associators, and the braiding.
In particular, this is the data that is needed to define (symmetric) tensors, which are
defined over vector spaces graded by these objects. For the full functionality, we refer to
[TensorKit.jl](https://github.com/QuantumKitHub/TensorKit.jl) and [its
documentation](https://quantumkithub.github.io/TensorKit.jl/stable/).

Install via the package manager.
5 changes: 5 additions & 0 deletions docs/src/lib.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Library documentation

```@autodocs
Modules = [TensorKitSectors]
```
4 changes: 2 additions & 2 deletions src/irreps/znirrep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const SMALL_ZN_CUTOFF = (typemax(UInt8) + 1) ÷ 2
Irrep[ℤ{N}](n::Integer)

Represents irreps of the group ``ℤ_N`` for some value of `N`.
For `N` equals `2`, `3` or `4`, `ℤ{N}` can be replaced by [`ℤ₂`](@ref), [`ℤ₃`](@ref), and [`ℤ₄`](@ref).
For `N` equals `2`, `3` or `4`, `ℤ{N}` can be replaced by `ℤ₂`, `ℤ₃`, and `ℤ₄`.
An arbitrary `Integer` `n` can be provided to the constructor, but only the value `mod(n, N)` is relevant.

The type of the stored integer (`UInt8`) requires `N ≤ $SMALL_ZN_CUTOFF`.
Expand All @@ -33,7 +33,7 @@ end
Irrep[ℤ{N}](n::Integer)

Represents irreps of the group ``ℤ_N`` for some value of `N`, which is typically larger than $SMALL_ZN_CUTOFF.
For smaller values of `N`, the [`ZNIrrep}`](@ref) sector type should be used instead.
For smaller values of `N`, the [`ZNIrrep`](@ref) sector type should be used instead.
An arbitrary `Integer` `n` can be provided to the constructor, but only the value `mod(n, N)` is relevant.

The constructor `Irrep[ℤ{N}]` should be preferred, as it will automatically select the most efficient storage type for a given value of `N`.
Expand Down
2 changes: 1 addition & 1 deletion src/product.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const SectorTuple = Tuple{Vararg{Sector}}

Represents the Deligne tensor product of sectors. The type parameter `T` is a tuple of the
component sectors. The recommended way to construct a `ProductSector` is using the
[`deligneproduct`](@ref) (`⊠`) operator on the components.
[`deligneproduct`](@ref) (`⊠`) operator on the components.
"""
struct ProductSector{T <: SectorTuple} <: Sector
sectors::T
Expand Down