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.1.1.tar.gz (15.1 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.1.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qten_plots-0.1.1.tar.gz
  • Upload date:
  • Size: 15.1 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.1.1.tar.gz
Algorithm Hash digest
SHA256 6d269c0188547df96084efb97c33c60d53374565b1febfa08a5758f1f62d42e2
MD5 065a045f98033b4877979bb3f58aa842
BLAKE2b-256 512b9fe097fbb13c9fb68fb94f74a7c0bb8b428bb83e3ffc58412bdd5bdcbb71

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qten_plots-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.9 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4372e7da733ae3f2365a0efca62fcd765fae573774a1fa52a3986cd950d34272
MD5 aab188ada35b26e42003dd5f0dd72db2
BLAKE2b-256 8d1f56bdb8ff97aa804a783ab817bbdefa10034028df1a388729d069e5886e3b

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