Skip to main content

bruma_quantum

Entropia, teoria da informação e descritores de emaranhamento a partir de cálculos DFT do CASTEP. Só numpy. Pensado como módulo para o BruMaRe (cada função é pura e devolve dict/ndarray; o I/O fica em io_castep.py e weights.py).

python -m bruma_quantum <comando> ...        # testes: python test_bruma_quantum.py

Comandos

Comando Entrada Saída
density .den_fmt (+ --cell --center --radius, --ref) Shannon, Rényi-2, Onicescu, Fisher por canal (total/up/down), JS(up,down), região esférica, KL/JS contra o puro
shells .cell, --center Ni, --target H cascas de H por distância ao dopante + multiplicidade g; gera CSV-modelo
hsites CSV de cascas com E_eV P_i de Boltzmann, S configuracional (famílias e sítios), levantamento da degenerescência, vs T
orbital .bands + pesos de projeção .dat (+ --region) S de emaranhamento (cota diagonal), entropia por banda, localização (S_loc, N_eff, IPR), espaço ativo/qubits
fermi .bands entropia térmica de ocupação (Fermi-Dirac) vs T

Fluxo para o H no MgH₂:Ni: shells → calcular a energia de remoção de H de cada casca (CASTEP/Bruma) → preencher E_eV → hsites.

O que cada grandeza significa

  • Shannon da densidade S = -∫ρ̃ ln ρ̃, V_ef = exp(S) (volume efetivo em ų). Só faz sentido comparando a mesma célula/grade (defeito × puro).
  • Fisher I = 4∫|∇√ρ̃|² (FFT, rede qualquer): mede o quão "pontuda" é a densidade.
  • Onicescu / Rényi-2: desequilíbrio (concentração) da distribuição.
  • KL / Jensen-Shannon (mesma grade): onde e quanto o defeito mudou a densidade.
  • Emaranhamento (von Neumann) KS: S = Σ h(ν), h(x) = -x ln x - (1-x) ln(1-x) (Peschel). Função peschel_entropy(C) é exata quando se tem a matriz de overlap C_ij = <ψ_i|P_A|ψ_j> dos orbitais ocupados. Com só pesos de projeção w_nk (diagonal de C) obtém-se uma cota superior (diagonal_entropy).
  • Localização: S_loc = -Σ_a p_a ln p_a, N_eff = exp(S_loc), IPR = Σ p_a².
  • Espaço ativo: bandas com |⟨E⟩-E_F| ≤ janela e peso na região ≥ --wmin; spin-orbitais ≈ qubits (Jordan-Wigner, 1 qubit por spin-orbital).
  • Boltzmann de sítios: P_i = g_i e^{-E_i/kT}/Z; S_sítios = -Σ P_i ln(P_i/g_i).

Limitações (leia antes de interpretar)

  1. É emaranhamento do sistema auxiliar de Kohn-Sham, não do sistema interagente. Use para tendências relativas (Ni × Cr × Zn × puro), não como valor absoluto.
  2. A cota diagonal é frouxa para estados estendidos (num teste de cadeia tight-binding: exata 0,76 × diagonal 6,93). O número total é dominado por bandas de bulk; olhe a entropia por banda e a diferença para o puro com a mesma região.
  3. Pesos de projeção LCAO têm spilling (não somam 1); a cota só vale com projeção completa. A mistura entre k-pontos é ignorada (média ponderada em k).
  4. .pdos_bin não é lido aqui (binário Fortran não documentado). Use os pesos exportados pelo Bruma; se o layout do .dat for diferente do descrito em weights.py, ajuste só aquele módulo.
  5. fermi usa autovalores congelados e μ = E_F do .bands. Se houver banda de defeito colada em E_F, o resultado depende fortemente de μ; confira N(T) (deve ≈ N_elétrons).
  6. shells agrupa por distância (triagem): confirme equivalência por simetria.
  7. Valores de .den_fmt são ρ·V; o pacote divide pelo volume. Ruído numérico negativo (~1e-6 da carga) é truncado em zero. Densidade de diferença não serve para Shannon.

Integração no BruMaRe

Funções públicas (from bruma_quantum import ...): read_bands, read_cell, read_den_fmt, analyze_density, shannon_report, fisher_information, kl_divergence, jensen_shannon, sphere_mask, read_weights, entanglement_report, peschel_entropy, diagonal_entropy, localization_entropy, suggest_active_space, thermal_entropy, find_shells, boltzmann_site_entropy. Saídas .dat usam TAB + linha de nomes (Origin) e os relatórios saem em .json.

Próximos passos naturais

  • Peschel exato: exige coeficientes de onda plana (ou funções de Wannier) para montar C.
  • Informação mútua entre regiões A e B (precisa da mesma matriz completa).
  • Entropia de orbital de uma partição de espaço ativo para DMRG/VQE.

Metadata

Release files for brumare 1.3.2

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

Source distribution (sdist)

Source distribution for brumare 1.3.2
File Size Uploaded Provenance Actions
brumare-1.3.2.tar.gz 21.3 MB With provenance Details for brumare-1.3.2.tar.gz

Built distribution (wheel)

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

Total release size: 42.7 MB

Release files / brumare-1.3.2.tar.gz

Download URL brumare-1.3.2.tar.gz
Size 21.3 MB
Tags Source
SHA-256 checksum
How to use checksums
58d504b9431818457e2d61e3a7ac4d7238c4a1fa6ba16b1000ffa15971c57c4f
BLAKE2b-256 checksum
How to use checksums
162ee4de58e49fab80ca25340f9460b7c2fd3942f43c8d22b4ffa4c79550452a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / brumare-1.3.2-py3-none-any.whl

Download URL brumare-1.3.2-py3-none-any.whl
Size 21.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
909fdc10f2e17fd5845be5e9e551da40c40a4f8dc6f31eb6e1e017706c4bfea0
BLAKE2b-256 checksum
How to use checksums
8bec5573be0f63628198460d9cfbbbfb459e53cf1e3adbe149f33c169fffa11c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for brumare 1.3.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for brumare-1.3.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

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

1.3.2 This release

2 release files Full 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