Skip to main content

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:

  • plotly
  • matplotlib

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-plots depends on qten.
  • The extension is loaded dynamically through Python package entry points.
  • If qten-plots is not installed, .plot(...) calls will fail with a backend registration error.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qten_plots-0.3.0.tar.gz (28.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qten_plots-0.3.0-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file qten_plots-0.3.0.tar.gz.

File metadata

  • Download URL: qten_plots-0.3.0.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for qten_plots-0.3.0.tar.gz
Algorithm Hash digest
SHA256 47465a4e0482aaaefc4d7c63e841620e6863d0598f8e9a5187cc8f5d2982e375
MD5 f7d865c72834465e40467fb2884938bc
BLAKE2b-256 47f4673b2a71ef3189e61b80cb25f73cf166204ddcf0ec19ce77416a923c05ef

See more details on using hashes here.

File details

Details for the file qten_plots-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: qten_plots-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for qten_plots-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e598150fee6da093bfe1836687a9b3f894264178b347fafd29e6cd8dc91cdac4
MD5 407babd20eb5e3af830662d80c608095
BLAKE2b-256 b5b36270cca7f56c5e9de3be2973424b7777c45827d6547d8adcd05fc4898ec3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page