Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
0229ed0
add workflow
hunghaoti Nov 10, 2025
87b02bc
Create docs.yml
hunghaoti Nov 10, 2025
66b9abb
Update docs.yml
hunghaoti Nov 10, 2025
6a46da7
Update docs.yml
hunghaoti Nov 10, 2025
1ac12b0
Update docs.yml
hunghaoti Nov 10, 2025
449bac8
Update docs.yml
hunghaoti Nov 10, 2025
3d2cb00
Update docs.yml
hunghaoti Nov 10, 2025
578ca2f
Update docs.yml
hunghaoti Nov 10, 2025
bc36d15
Update docs.yml
hunghaoti Nov 11, 2025
c01d9a6
Update docs.yml
hunghaoti Nov 11, 2025
27e23b5
Update docs.yml
hunghaoti Nov 11, 2025
d809170
Update redirect.py
hunghaoti Nov 11, 2025
8213724
Update .gitignore
hunghaoti Nov 11, 2025
515820f
Fix conflict
hunghaoti Nov 19, 2025
267bdbc
Merge api documentation.
hunghaoti Nov 19, 2025
7d77ac8
Fix script to generate api docs.
hunghaoti Nov 19, 2025
ab513a3
remove versions folder.
hunghaoti Nov 19, 2025
c88b0bc
Update docs.yml
hunghaoti Nov 19, 2025
ca6a021
Update docs.yml
hunghaoti Nov 19, 2025
a8032ff
Update docs.yml
hunghaoti Nov 19, 2025
8fb918f
Update docs.yml
hunghaoti Nov 19, 2025
ef15289
Update docs.yml
hunghaoti Nov 19, 2025
3328e17
test pwd
hunghaoti Nov 19, 2025
407f9d8
test pwd
hunghaoti Nov 19, 2025
842708e
Fix script.
hunghaoti Nov 19, 2025
433c333
Use bash.
hunghaoti Nov 19, 2025
3f764b8
Update docs.yml
hunghaoti Nov 19, 2025
82b15ac
remove make html tmp.
hunghaoti Nov 20, 2025
bde9348
Merge branch 'haoti/doc_update' of https://github.com/Cytnx-dev/Cytnx…
hunghaoti Nov 20, 2025
b3d71fa
add back make html.
hunghaoti Nov 20, 2025
9978bfd
Update docs.yml
hunghaoti Nov 20, 2025
b1b0701
Update docs.yml
hunghaoti Nov 20, 2025
521e152
edit pyproject.toml
hunghaoti Nov 20, 2025
03d7a59
update api build.
hunghaoti Nov 20, 2025
64c1cdb
Update docs.yml
hunghaoti Nov 20, 2025
f17a47e
update script and conf.py
hunghaoti Nov 20, 2025
975a9c8
Update docs.yml
hunghaoti Nov 20, 2025
0622283
Update Readme.md
hunghaoti Nov 20, 2025
6d90b00
Update gihub link and user guide link.
hunghaoti Nov 20, 2025
59873f8
Update docs.yml
hunghaoti Nov 20, 2025
6e8b4f6
update user guide link.
hunghaoti Nov 20, 2025
5ffb5ab
Update installation guide.
hunghaoti Nov 21, 2025
4c77556
update linke and add generate latex code for user guilde.
hunghaoti Nov 21, 2025
d66c250
Fix linalg link error.
hunghaoti Nov 21, 2025
083f91f
Fix link to local files.
hunghaoti Nov 22, 2025
e7a1dfb
Fix link.
hunghaoti Nov 22, 2025
b76d10b
Update python version in docs.
hunghaoti Nov 22, 2025
14ad688
updated developers list
manuschneider Nov 24, 2025
aab740b
improved API documentation
manuschneider Nov 24, 2025
acf4366
updated create UniTensor and print_diagram to include new generators …
manuschneider Nov 24, 2025
a60c799
updated code examples to include UniTensor generators
manuschneider Nov 24, 2025
ce9e440
fixed broken reference
manuschneider Nov 24, 2025
0189195
changed relabels to relabel
manuschneider Nov 24, 2025
f1ed932
added arange to the UniTensor generators
manuschneider Nov 24, 2025
8e56071
clang format
manuschneider Nov 24, 2025
443a0e8
replaced relabels by relabel everywhere
manuschneider Nov 24, 2025
85ece18
updated UniTensor manipulations
manuschneider Nov 24, 2025
f680c31
updated behaviour of Transpose and Dagger, added (dummy) chapter on f…
manuschneider Dec 5, 2025
dec28fa
Merge remote-tracking branch 'origin/master' into manuel/doc_update
manuschneider Dec 5, 2025
fcbb71e
use .set_rowrank_() instead of initializer argument (rowrank=...)
manuschneider Dec 5, 2025
9ae0c21
updates in UniTensor section
manuschneider Dec 11, 2025
ce9f442
updated userguide
manuschneider Dec 11, 2025
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
47 changes: 47 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Sphinx Documentation

on:
push:
branches:
- haoti/doc_update

jobs:
publish_sphinx_docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.5.1"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install dependencies
working-directory: docs
run: |
uv sync --python 3.10
sudo apt-get update && sudo apt-get install -y doxygen graphviz
- name: Build api documentation
working-directory: docs
run: |
uv run bash api_doc_script.sh
- name: Sphinx build
working-directory: docs
run: |
uv run just doc
- name: Create index.html
working-directory: docs
run: |
uv run python redirect.py ${{ github.ref_name }} > build/index.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
personal_token: ${{ secrets.PAGES_PAT }}
external_repository: Cytnx-dev/Cytnx_doc
publish_dir: docs/build/
force_orphan: true
2 changes: 1 addition & 1 deletion DoxygenLayout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
<tab type="user" visible="yes" title="version log" url="@ref version_log"/>
<tab type="user" visible="yes" title="User Guide" url="https://kaihsinwu.gitlab.io/Cytnx_doc"/>
<tab type="user" visible="yes" title="User Guide" url="../build/html/index.html"/>
</navindex>

<!-- Layout definition for a class page -->
Expand Down
32 changes: 16 additions & 16 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Cytnx is a tensor network library designed for quantum physics simulations using
**See also**
[Release Note](misc_doc/version.log).

## API Documentation:

[https://kaihsinwu.gitlab.io/cytnx_api/](https://kaihsinwu.gitlab.io/cytnx_api/)

## User Guide [under construction]:

[Cytnx User Guide](https://kaihsinwu.gitlab.io/Cytnx_doc/)
[Cytnx User Guide](https://cytnx-dev.github.io/Cytnx_doc)

## API Documentation:

[API Documentation](https://cytnx-dev.github.io/Cytnx_doc/api_build/html)


## Objects:
Expand Down Expand Up @@ -243,25 +243,25 @@ You can contact us by:
* Email, see below

## Developers & Maintainers
Creator and Project manager | Affiliation | Email
----------------------------|-----------------|---------
Kai-Hsin Wu |Boston Univ., USA|kaihsinwu@gmail.com
Creator | Affiliation | Email
------------|--------------------|--------------------
Kai-Hsin Wu | QuEra, Boston, USA | kaihsinwu@gmail.com

Developers | Affiliation | Roles
----------------|-----------------|---------
Chang-Teng Lin |NTU, Taiwan |major maintainer and developer
Ke Hsu |NTU, Taiwan |major maintainer and developer
Ivana Gyro |NTU, Taiwan |major maintainer and developer
Hao-Ti Hung |NTU, Taiwan |documentation and linalg
Ying-Jer Kao |NTU, Taiwan |setuptool, cmake
Chang-Teng Lin | NTU, Taiwan | major maintainer and developer
Ke Hsu | NTU, Taiwan | major maintainer and developer
Ivana Gyro | NTU, Taiwan | major maintainer and developer
Hao-Ti Hung | NTU, Taiwan | documentation and linalg
Manuel Schneider| NYCU, Taiwan | developer, fermions, documentation
Ying-Jer Kao | NTU, Taiwan | project manager, setuptool, cmake

## Contributors
Contributors | Affiliation
----------------|-----------------
PoChung Chen | NTHU, Taiwan
Chia-Min Chung | NSYSU, Taiwan
Ian McCulloch | NTHU, Taiwan
Manuel Schneider| NYCU, Taiwan
Yen-Hsin Wu | NTU, Taiwan
Po-Kwan Wu | OSU, USA
Wen-Han Kao | UMN, USA
Expand All @@ -271,10 +271,10 @@ Yu-Cheng Lin | NTU, Taiwan

## References
* Paper:
[https://arxiv.org/abs/2401.01921](https://arxiv.org/abs/2401.01921)
https://scipost.org/10.21468/SciPostPhysCodeb.53

* Example/DMRG:
[https://www.tensors.net/dmrg](https://www.tensors.net/dmrg)
https://www.tensors.net/dmrg

* hptt library:
[https://github.com/springer13/hptt](https://github.com/springer13/hptt)
https://github.com/springer13/hptt
1 change: 0 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
source/__pycache__/*
tests/__pycache__/*
tests/build/*
build/
*.swp
75 changes: 75 additions & 0 deletions docs/api_doc_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/usr/bin/bash

doxygen_build()
{
VTAG=$1
echo $VTAG
git checkout $VTAG || {
echo "Failed to checkout tag $VTAG";
exit 1;
}
doxygen docs.doxygen > /dev/null 2>&1
if [ "$VTAG" = master ]; then
mkdir -p docs/api_docs/versions
VTAG=latest
fi
mv docs/html docs/api_docs/versions/$VTAG
}

# get current branch
branch=$(git rev-parse --abbrev-ref HEAD)

mkdir build
cd ../

# Build latest version
doxygen_build master

smallest_ver=0.7.3
# Get all version latest than smallest_ver
versions=($(git tag \
| sed 's/^v//' \
| sed 's/[A-Za-z].*$//' \
| sort -V \
| awk -F. -v cv="$smallest_ver" '
BEGIN { split(cv,c,"."); min=c[1]*10000+c[2]*100+c[3] }
{ val=$1*10000+$2*100+$3; if(val>=min) print }
'))

# Build older version latest from smallest_ver
for i in "${!versions[@]}"; do
ver="v${versions[i]}"
doxygen_build $ver
done

# checkout original version
git checkout $branch

# Create index.rst
cd ./docs/api_docs/home_source
cat > index.rst <<'EOF'
.. image:: Icon_small.png
:width: 350

Cytnx API
=================================
Cytnx is a library design for Quantum physics simulation using GPUs and CPUs.

* `Latest version <versions/latest/index.html>`__.

Older versions:

EOF

for ((i=${#versions[@]}-1; i>=0; i--)); do
ver="v${versions[i]}"
echo ' * `'$ver' <versions/'$ver'/index.html>`__.' >> index.rst
done

# build API documentation index.
cd ../
make html

# move the api_build under build
mv versions ./build_home/html/
mv build_home ../build/api_build
3 changes: 3 additions & 0 deletions docs/api_docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build_home/*
home_source/index.rst
*.swp
22 changes: 22 additions & 0 deletions docs/api_docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = home_source
BUILDDIR = build_home

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)



.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Binary file added docs/api_docs/home_source/Icon_i.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/api_docs/home_source/Icon_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
127 changes: 127 additions & 0 deletions docs/api_docs/home_source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
import os,sys
sys.path.append('.')



html_theme = 'sphinxbootstrap4theme'
import sphinxbootstrap4theme
html_theme_path = [sphinxbootstrap4theme.get_path()]

# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = 'Cytnx API'
copyright = '2019-, Kai-Hsin Wu'
author = 'Kai-Hsin Wu'

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
# https://sublime-and-sphinx-guide.readthedocs.io/en/latest/references.html
extensions = ['sphinx.ext.autosectionlabel']
extensions.append('sphinx.ext.extlinks')
extensions.append('sphinxcontrib.jquery')
#extensions.append('sphinx.ext.imgmath')
#extensions.append('ablog')
extensions.append('sphinx.ext.mathjax')

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

html_logo = 'Icon_i.png'

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'pyramid'
#html_theme = 'sphinx'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']




html_theme_options = {
# Navbar style.
# Values: 'fixed-top', 'full' (Default: 'fixed-top')
'navbar_style' : 'fixed-top',

# Navbar link color modifier class.
# Values: 'dark', 'light' (Default: 'dark')
'navbar_color_class' : 'dark',

# Navbar background color class.
# Values: 'inverse', 'primary', 'faded', 'success',
# 'info', 'warning', 'danger' (Default: 'inverse')
#'navbar_bg_class' : 'inverse',

# Show global TOC in navbar.
# To display up to 4 tier in the drop-down menu.
# Values: True, False (Default: True)
'navbar_show_pages' : False,

# Link name for global TOC in navbar.
# (Default: 'Pages')
#'navbar_pages_title' : 'Pages',

# Specify a list of menu in navbar.
# Tuples forms:
# ('Name', 'external url or path of pages in the document', boolean)
# Third argument:
# True indicates an external link.
# False indicates path of pages in the document.
'navbar_links' : [
("User Guide", "../../html/index.html", True),
("Github", "https://github.com/Cytnx-dev/Cytnx", True)
],

# Total width(%) of the document and the sidebar.
# (Default: 80%)
'main_width' : '80%',

# Render sidebar.
# Values: True, False (Default: True)
'show_sidebar' : False,

# Render sidebar in the right of the document.
# Values:True, False (Default: False)
'sidebar_right': False,

# Fix sidebar.
# Values: True, False (Default: True)
'sidebar_fixed': False,

# Html table header class.
# Values: 'inverse', 'light' (Deafult: 'inverse')
'table_thead_class' : 'inverse',

}
8 changes: 4 additions & 4 deletions docs/code/CytnxGuide_PythonCodeExamples_2023_06_30.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@
"metadata": {},
"outputs": [],
"source": [
"Tsymm_diff=T-cytnx.Contracts([U,S,Vt]);\n",
"Tsymm_diff=T-cytnx.Contract([U,S,Vt]);\n",
"\n",
"Tsymm_diff.Norm()/T.Norm()"
]
Expand Down Expand Up @@ -1937,7 +1937,7 @@
"id": "be4e27d5",
"metadata": {},
"source": [
"8.2. Contract(s)"
"8.2. Contract"
]
},
{
Expand Down Expand Up @@ -2025,9 +2025,9 @@
"A2.relabels_([\"phy2\",\"v5\",\"v6\"])\n",
"\n",
"\n",
"# Use Contracts\n",
"# Use Contract\n",
"\n",
"res = cytnx.Contracts(TNs = [A1,M,A2], order = \"(M,(A1,A2))\", optimal = False)\n",
"res = cytnx.Contract(TNs = [A1,M,A2], order = \"(M,(A1,A2))\", optimal = False)\n",
"\n",
"res.print_diagram()"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
auto A = cytnx::Storage(4);
A.fill(6);
A.Save("S1");
A.Save("S1.cyst");
Loading
Loading