Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
82a96fc
Add mkdocs config and github workflow to deploy mkdocs
tdrwenski Jun 12, 2025
55eb325
Start from latex document
tdrwenski Jun 13, 2025
83b6fbf
Remove latex new package and commands and start/end doc
tdrwenski Jun 13, 2025
4849861
Convert sections and subsections to md
tdrwenski Jun 13, 2025
5d16aec
Fix itemize, enumerate, bold, italic formatting for md
tdrwenski Jun 13, 2025
e520605
Add whitespace around equations
tdrwenski Jun 13, 2025
dbe9f6e
Whitespace cleanups, avoid indentation
tdrwenski Jun 13, 2025
b7ba9d9
Fix title and authors
tdrwenski Jun 13, 2025
b6c79ac
Fix itemize list
tdrwenski Jun 13, 2025
d7fc0e1
Fix itemize
tdrwenski Jun 13, 2025
13e184d
Fix \textt for markdown
tdrwenski Jun 13, 2025
d52ee2d
Fix eqref
tdrwenski Jun 13, 2025
ac72e49
Fix comments
tdrwenski Jun 13, 2025
36c97fc
Fix citations
tdrwenski Jun 13, 2025
1d5b728
Whitespace fixes
tdrwenski Jun 13, 2025
9e03d10
Fix latex tildes
tdrwenski Jun 13, 2025
7867083
Remove unneeded \appendix and \bib
tdrwenski Jun 13, 2025
772e7aa
Whitespace fixes
tdrwenski Jun 13, 2025
25d4320
Add code snippet macro
tdrwenski Jun 13, 2025
7039718
Whitespace fixes
tdrwenski Jun 13, 2025
c3e77d3
Fix mathds R
tdrwenski Jun 13, 2025
e33d89a
Fix section references
tdrwenski Jun 13, 2025
43e3041
Add brackets around dot
tdrwenski Jun 13, 2025
c436d2d
Rename userguide and move bibtex file
tdrwenski Jun 13, 2025
aa5fe70
Fix verbatim blocks
tdrwenski Jun 13, 2025
cd1457f
Use mathbb instead of mathds
tdrwenski Jun 13, 2025
0f99b9a
WIP deploy docs on this branch
tdrwenski Jun 13, 2025
31303aa
Don't accidentally remove other gh-pages artifacts
tdrwenski Jun 13, 2025
c43f9bc
Link to doxygen on mkdocs
tdrwenski Jun 16, 2025
ab7f1af
Improve code block formating
tdrwenski Jun 16, 2025
3c5189b
Improve reference formatting
tdrwenski Jun 16, 2025
e1aa0ff
Fix quotes
tdrwenski Jun 16, 2025
5cf51fc
Fix itemize with whitespace
tdrwenski Jun 16, 2025
e30ac48
Fix whitespace around equations
tdrwenski Jun 16, 2025
95e745e
Fix bold in markdown
tdrwenski Jun 16, 2025
9327dc0
Add footnote
tdrwenski Jun 16, 2025
2ae5081
Fix tabular in markdown
tdrwenski Jun 16, 2025
11683a8
Fix url
tdrwenski Jun 16, 2025
b1cb8d9
Remove authors from user guid
tdrwenski Jun 16, 2025
156c65f
Rearrange documentation
tdrwenski Jun 16, 2025
383a8a7
Remove user_guide.pdf
tdrwenski Jun 16, 2025
6e389c0
Update Readme to point to docs
tdrwenski Jun 16, 2025
d1d705c
Remove no longer needed mathjax config
tdrwenski Jun 16, 2025
af06672
Add Jupyter notebook plugin and symlink jupyter notebook file
tdrwenski Jun 16, 2025
f7b6bbf
Add checkout recursive to mkdocs GitHub workflow
tdrwenski Jun 16, 2025
f9426f3
Update getting started
tdrwenski Jun 17, 2025
a7bf1f2
Add back a few details to getting started
tdrwenski Jun 17, 2025
ec617f2
Update user guide.
steffi7574 Jun 27, 2025
3293e60
Update C++ reference header.
steffi7574 Jun 27, 2025
5f83b52
Update index.md
steffi7574 Jun 27, 2025
97f98ed
Update examples for Jupyter notebook.
steffi7574 Jun 27, 2025
d0246a6
Fix doxygen link
tdrwenski Jun 30, 2025
2ee416c
Remove no longer used macro plugin
tdrwenski Jun 30, 2025
00223a8
Fix typos
tdrwenski Jun 30, 2025
8139fff
Fix broken section links
tdrwenski Jun 30, 2025
0b1e5b9
Remove deploy on this branch workaround
tdrwenski Jun 30, 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
35 changes: 35 additions & 0 deletions .github/workflows/deploy-mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy MkDocs to GitHub Pages

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
pip install mkdocs pymdown-extensions mkdocs-bibtex mkdocs-macros-plugin mkdocs-jupyter

- name: Build MkDocs site
run: mkdocs build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
keep_files: true # Preserves existing files
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ realize a logical quantum operation, or state preparation that aims to drive the

Quandary targets deployment on High-Performance Computing platforms, offering various levels for parallelization using the message passing paradigm. Quandary is written in C++ and executed by providing a text-based configuration file. Further, a Python interface is available to call the underlying C++ code from within a python interpreter, to ease usage.

It is advised to look at the user guide in `doc/`, describing the underlying mathematical models, their implementation and usage in Quandary.

Feel free to reach out to Stefanie Guenther [guenther5@llnl.gov] for any question you may have.

# Documentation
Both user and code documentation is available [here](https://software.llnl.gov/quandary).

# Building
Quandary uses CMake and [BLT](https://github.com/LLNL/blt) to handle builds. Since BLT is included as a
submodule, first make sure you run:
Expand Down Expand Up @@ -152,8 +153,6 @@ See `tests/performance/README.md` for more information.

Quandary is an open source project that is under heavy development. Contributions in all forms are very welcome, and can be anything from new features to bugfixes, documentation, or even discussions. Contributing is easy, work on your branch, create a pull request to `main` when you're good to go and the regression tests pass.

Developer documentation is made with [Doxygen](https://www.doxygen.org) and is viewable [here](https://software.llnl.gov/quandary/doxygen).

# Publications
* S. Guenther, N.A. Petersson, J.L. DuBois: "Quantum Optimal Control for Pure-State Preparation Using One Initial State", AVS Quantum Science, vol. 3, arXiv preprint <https://arxiv.org/abs/2106.09148> (2021)
* S. Guenther, N.A. Petersson, J.L. DuBois: "Quandary: An open-source C++ package for High-Performance Optimal Control of Open Quantum Systems", submitted to IEEE Supercomputing 2021, arXiv preprint <https://arxiv.org/abs/2110.10310> (2021)
Expand Down
1 change: 1 addition & 0 deletions docs/mkdocs/QuandaryWithPython_HowTo.ipynb
6 changes: 6 additions & 0 deletions docs/mkdocs/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Summary of all C++ configuration options
Here is a list of all options available to the C++ Quandary code, this is the same as in `config_template.cfg`.

```cfg
--8<-- "config_template.cfg"
```
78 changes: 78 additions & 0 deletions docs/mkdocs/getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Getting Started

## Installation

You have two options to install the Quandary binary:

### Option 1: Install via Spack (Recommended)

If you have [Spack](https://spack.readthedocs.io/en/latest/getting_started.html#installation) installed:
```console
spack install quandary
```

This automatically handles all dependencies including PETSc and MPI.

### Option 2: Build from Source

**Prerequisites for building from source:**

- **PETSc** (Portable, Extensible Toolkit for Scientific Computation)
- **MPI** implementation for parallel execution
- **CMake** 3.23 or later
- **C++ compiler** with C++14 support

**Steps:**

- Clone the repository:

```console
git clone https://github.com/LLNL/quandary.git
cd quandary
```

- Follow the detailed build instructions in the [README.md](https://github.com/LLNL/quandary/blob/main/README.md)

## Running

### C++ Interface

Test your installation with the provided template:
```console
./quandary config_template.cfg # Serial execution
mpirun -np 4 ./quandary config_template.cfg # Parallel execution
```

Results are written as column-based text files in the output directory `data_out/`. The `config_template.cfg` is currently set to run a CNOT optimization test case. It lists all available options and configurations, and is filled with comments that should help users to set up new simulation and optimization runs, and match the input options to the equations found in this document.

You can silence Quandary by adding the `--quiet` command line argument.

### Python Interface

For Python interface, after cloning quandary:
```console
pip install -e .
```

Test the Python interface with a working example:
```console
cd examples
python example_cnot.py
```

This example demonstrates:

- Setting up a 2-qubit system
- Defining a CNOT gate target
- Running optimization
- Plotting results

The output will show optimization progress and generate control pulse plots.

## Next Steps

- **[Examples](https://github.com/LLNL/quandary-examples/)**: Check out the quandary-examples repo
- **[Jupyter Example](QuandaryWithPython_HowTo.ipynb)**: Check out the Jupyter Notebook Tutorial in these docs or in the above repo
- **[User Guide](user_guide.md)**: Comprehensive documentation of Quandary's capabilities and details
- **[C++ Config Reference](config.md)**: Reference listing configuration files in detail
- **[Python API Reference](python_api.md)**: Reference listing the Python interface in detail
15 changes: 15 additions & 0 deletions docs/mkdocs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Quandary: Optimal Control for Open and Closed Quantum Systems

Quandary numerically simulates and optimizes the time evolution of closed and open quantum systems.

## Basics

- [Getting Started](getting_started.md)
- [User Guide](user_guide.md)
- [Jupyter Notebook Tutorial](QuandaryWithPython_HowTo.ipynb)

## Reference

- [Python API Reference](python_api.md)
- [C++ Config Reference](config.md)
- [C++ Doxygen Documentation](https://software.llnl.gov/quandary/doxygen/)
26 changes: 26 additions & 0 deletions docs/mkdocs/javascripts/mathjax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
window.MathJax = {
tex: {
tags: 'ams', // Enable automatic equation numbering
processEscapes: true,
processEnvironments: true,
macros: {
Tr: "\\operatorname{Tr}",
Ell: "\\mathcal{L}",
R: "\\mathbb{R}",
N: "\\mathbb{N}",
C: "\\mathbb{C}",
bfa: "\\boldsymbol{\\alpha}",
bs: ["\\boldsymbol{#1}", 1]
}
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
},
startup: {
ready: () => {
MathJax.startup.defaultReady();
console.log('MathJax is loaded and ready.');
}
}
};
26 changes: 26 additions & 0 deletions docs/mkdocs/python_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

# Interfacing to Python environment
The python interface eases the use of the C++ Quandary code, and adds additional functionality:

* Automatic estimation of the required time-step size based on eigenvalue decomposition of the system Hamiltonian
* Automatic computation of carrier frequencies based on system transition frequencies (Hamiltonian eigenvalue differences)
* Simulate and optimize with **custom system and control Hamiltonian operators**, other than the default model for superconducting quantum devices defined in [User Guide](user_guide.md).

All interface functions are defined in `./quandary.py`, which defines the `Quandary` dataclass that gathers all configuration options and sets default values. Default values are overwritten by user input either through the constructor call through `Quandary(<membervar>=<value>)` directly, or by accessing the member variables after construction and calling `update()` afterwards. A good place to get started is to look at the example `example_swap02.py`, or jump start with the [Jupyter Notebook Tutorial](QuandaryWithPython_HowTo.ipynb)

Under the hood, the python interface dumps all configuration options to file and evokes (multiple) subprocesses that execute the C++ code on this configuration file. The C++ output files are loaded back into the python interpreter.
It is therefore recommended to utilize the python interface only for smaller system sizes (fewer qubits), and switch to operate the C++ code directly when larger systems are considered (e.g. when parallel linear algebra is required.)

### Custom Hamiltonian models
To enable custom Hamiltonians, pass the option `standardmodel=False` to the Quandary object and provide the complex-valued system Hamiltonian $H_d$ with `Hsys=<yourSystemHamiltonian>` as well as the real and imaginary parts of the custom control Hamiltonians per oscillator with `Hc_real=[<HcReal oscillator1, HcReal oscillator2, ...]` (will be multiplied by controls $p^k(t)$) `Hc_imag=[<HcImag oscillator1, HcImag oscillator2, ...]` (will be multiplied by controls $iq^k(t)$).

* The units of the system Hamiltonian should be angular frequency (multiply $2\pi$), whereas the control Hamiltonian operators should be 'unit-free', since those units come in through the multiplied control pulses $p$ and $q$.
* The control Hamiltonian operators are optional, but the system Hamiltonian is always required if `standardmodel=False`.
* The matrix-free solver can not be used when custom Hamiltonians are provided. The code will therefore be slower.

# Summary of all python interface options
Here is a list of all options available to the python interface, including their default values. Use `help(Quandary)` to get additional information on available interface functions, such as `quandary.simulate(...)`, `quandary.optimize(...)`.

```python
--8<-- "quandary.py:13:100"
```
File renamed without changes.
Loading
Loading