https://github.com/harmoniqs/piccoloquantumobjects.jl
Common quantum objects, isomophisms, and indexing used across the Piccolo.jl ecosystem
https://github.com/harmoniqs/piccoloquantumobjects.jl
Last synced: 4 months ago
JSON representation
Common quantum objects, isomophisms, and indexing used across the Piccolo.jl ecosystem
- Host: GitHub
- URL: https://github.com/harmoniqs/piccoloquantumobjects.jl
- Owner: harmoniqs
- License: mit
- Created: 2024-11-06T20:18:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-16T22:48:36.000Z (5 months ago)
- Last Synced: 2026-01-16T23:37:04.796Z (5 months ago)
- Language: Julia
- Homepage:
- Size: 1.81 MB
- Stars: 4
- Watchers: 3
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Make simple transformation of complex objects for quantum numerics
# PiccoloQuantumObjects
**PiccoloQuantumObjects.jl** is a Julia package for working with quantum objects. It provides tools for constructing and manipulating quantum states and operators. It is designed to be used with other packages in the [Piccolo.jl](https://github.com/harmoniqs/Piccolo.jl) ecosystem, such as [QuantumCollocation.jl](https://github.com/harmoniqs/QuantumCollocation.jl) and [NamedTrajectories.jl](https://github.com/harmoniqs/NamedTrajectories.jl).
### Installation
This package is registered! To install, enter the Julia REPL, type `]` to enter pkg mode, and then run:
```julia
pkg> add PiccoloQuantumObjects
```
### Usage
The following example demonstrates how to create a quantum state, create a quantum operator, and apply the operator to the state:
```Julia
using PiccoloQuantumObjects
# Create a quantum state
state = ket_from_string("g", [2])
# Create a quantum operator
operator = PAULIS.X
# Apply the operator to the state
new_state = operator * state
# Transform the state to its real representation
new_iso_state = ket_to_iso(new_state)
# Transform back
iso_to_ket(new_iso_state)
```
### Building Documentation
This package uses a Documenter config that is shared with many of our other repositories. To build the docs, you will need to run the docs setup script to clone and pull down the utility.
```
# first time only
./docs/get_docs_utils.sh # or ./get_docs_utils.sh if cwd is in ./docs/
```
To build the docs pages:
```
julia --project=docs docs/make.jl
```
or editing the docs live:
```
julia --project=docs
> using LiveServer, PiccoloQuantumObjects, Revise
> servedocs(literate_dir="docs/literate", skip_dirs=["docs/src/generated", "docs/src/assets/"], skip_files=["docs/src/index.md"])
```
> **Note:** `servedocs` needs to watch a subset of the files in the `docs/` folder. If it watches files that are generated on a docs build/re-build, `servedocs` will continuously try to re-serve the pages.
>
> To prevent this, ensure all generated files are included in the skip dirs or skip files args for `servedocs`.
For example, if we forget index.md like so:
```
julia --project=docs
> using LiveServer, PiccoloQuantumObjects, Revise
> servedocs(literate_dir="docs/literate", skip_dirs=["docs/src/generated", "docs/src/assets/"])
```
it will not build and serve.
-----
*"It seems that perfection is attained not when there is nothing more to add, but when there is nothing more to take away." - Antoine de Saint-Exupéry*