Skip to main content

bohrpy

Librería en Python del modelo atómico de Bohr para el hidrógeno y átomos hidrogenoides. Calcula niveles de energía, radios de órbita y transiciones electrónicas, y dibuja esos resultados.

Instalación

Desde la raíz del repositorio:

python -m venv venv
source venv/bin/activate
pip install -e ".[test]"

El paquete pide estas versiones, que son las usadas en el proyecto:

  • numpy==1.26.4
  • matplotlib==3.6.3
  • pytest==9.2.0 para las pruebas

Uso básico

from bohrpy import BohrAtom

hidrogeno = BohrAtom(Z=1)

print(hidrogeno.energy_level(1))    # energía del nivel n, en eV
print(hidrogeno.orbit_radius(1))    # radio de la órbita, en metros

transicion = hidrogeno.transition(3, 2)
print(transicion["delta_E_eV"])
print(transicion["frequency_Hz"])
print(transicion["wavelength_m"])
print(transicion["type"])           # "emisión" o "absorción"

hidrogeno.plot_energy_levels(max_n=5)
hidrogeno.plot_orbits(max_n=4)

Z es el número atómico. Con Z=1 se obtiene el hidrógeno y con Z=2 el He+.

Para guardar una figura sin abrir una ventana:

hidrogeno.plot_energy_levels(max_n=5, show=False, save_path="niveles.png")
hidrogeno.plot_orbits(max_n=4, show=False, save_path="orbitas.png")

Ejemplo

python examples/ejemplo_uso.py

Imprime los niveles del hidrógeno, la línea de Balmer n = 3 → n = 2 y una absorción n = 1 → n = 2. También guarda las figuras en examples/figuras/.

Pruebas

pytest

Autores

  • Isabel Nieto
  • Kevin Osorio

Metadata

Release files for bohrpy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bohrpy 0.1.0
File Size Uploaded Provenance Actions
bohrpy-0.1.0.tar.gz 7.6 kB Without provenance Details for bohrpy-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bohrpy 0.1.0
File Interpreter ABI Platform Actions
bohrpy-0.1.0-py3-none-any.whl Python 3 none any Details for bohrpy-0.1.0-py3-none-any.whl

Total release size: 15.2 kB

Release files / bohrpy-0.1.0.tar.gz

Download URL bohrpy-0.1.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
90fca2cf170d7629511bed7628213be93f581aff8a7f2996b4d3fbdf48de73ec
BLAKE2b-256 checksum
How to use checksums
acc51b8c3e389fefea5035742512e6bc30a59404c4b30d580770cca5e01a89be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / bohrpy-0.1.0-py3-none-any.whl

Download URL bohrpy-0.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1aefdd3642366a8cbf86578687e175b0efe4d4ea17768793482562f5510e2e6d
BLAKE2b-256 checksum
How to use checksums
92c7de955e004d854371fb48d4c9de96c9278c6d47f8be173c65c016449203c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for bohrpy 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page