Package Information
- Last Updated
- Authors
- Yannick Lapointe
- Dependencies
- @preview/cetz:0.5.2@preview/physica:0.9.8
1. Get the package
Download the package using the TPIX CLI:
tpix get @preview/tybloch:0.1.02. Import in your Typst file
Add this to your .typ file:
#import "@preview/tybloch:0.1.0": *tybloch
Draw Bloch spheres using cetz in Typst.
Usage
The bloch-from-spherical function plots a single state vector at the given spherical coordinates.
#import "@preview/tybloch:0.1.0": bloch-from-spherical
#bloch-from-spherical(
45deg,
45deg,
state-color: purple,
show-projections: true,
)

The bloch-state-linear-evolution functions shows the evolution between an initial state vector and a final state vector.
#import "@preview/tybloch:0.1.0": bloch-state-linear-evolution
#bloch-state-linear-evolution(
(1, 0deg, 0deg),
(1, 90deg, 90deg),
number-of-shadows: 9,
state-color: purple,
)

The bloch-state-rotation-evolution functions shows the evolution for an initial state vector rotating around a given
rotation axis for a total rotation angle.
#import "@preview/tybloch:0.1.0": bloch-state-rotation-evolution
#bloch-state-rotation-evolution(
(1, 25deg, 90deg),
(0deg, 0deg),
360deg,
number-of-shadows: 11,
)

Changelog
0.1.0
Initial release