Plotting extension for qten
Project description
qten-plots
qten-plots is the plotting extension package for qten.
It provides concrete plotting backends and registers them through the
qten.plottings entry-point group so qten objects can expose a uniform
.plot(...) API without forcing plotting dependencies into the core package.
What It Adds
This extension currently provides plotting implementations for:
Lattice.plot("structure")Tensor.plot("heatmap")Tensor.plot("spectrum")Tensor.plot("column_scatter")Tensor.plot("bandstructure")PointCloud.plot("scatter")
Backends currently included:
plotlymatplotlib
Installation
Install the core package first, then install the plotting extension:
pip install qten
pip install qten-plots
If you use uv from the repository workspace:
uv sync --group dev
How It Works
qten defines the Plottable dispatch mechanism in qten.plottings.
When .plot(...) is called, qten loads all installed entry points in the
qten.plottings group and registers the plotting implementations provided by
extension packages like qten-plots.
This keeps the main qten package focused on tensor and geometry logic while
allowing plotting support to evolve independently.
Example
import sympy as sy
from qten.geometries import Lattice, PeriodicBoundary
lattice = Lattice(
basis=sy.ImmutableDenseMatrix([[1, 0], [0, 1]]),
boundaries=PeriodicBoundary(sy.ImmutableDenseMatrix.diag(4, 4)),
unit_cell={"r": sy.ImmutableDenseMatrix([0, 0])},
)
fig = lattice.plot("structure", backend="plotly", show=False)
fig.show()
To switch backend:
fig = lattice.plot("structure", backend="matplotlib", show=False)
Notes
qten-plotsdepends onqten.- The extension is loaded dynamically through Python package entry points.
- If
qten-plotsis not installed,.plot(...)calls will fail with a backend registration error.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qten_plots-0.2.0.tar.gz.
File metadata
- Download URL: qten_plots-0.2.0.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18c5b22abc61da416e50a0549dd843925149c3634f144eaee18720092d697208
|
|
| MD5 |
412e1d195bcbca2f534bf88d75165f97
|
|
| BLAKE2b-256 |
4c0fbb94e0dc6ddc193bce287d0b4d60fdc30f84af7041eba81d2ddd56e2c0c1
|
File details
Details for the file qten_plots-0.2.0-py3-none-any.whl.
File metadata
- Download URL: qten_plots-0.2.0-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74c68b2816320742c2e3e3dbc89cb3a942c0ace48715bda06ee67c0603b17ece
|
|
| MD5 |
92c6702b9557fd8f5e420d7f49dc8d48
|
|
| BLAKE2b-256 |
b283d21a6a0288aee54c1e76519a4e79afeb76250d6df0f8037fec5b6f31decd
|