Harmonic measure computation and boundary crowding diagnostics for 2D domains
Project description
harmonic-measure
Harmonic measure computation and boundary crowding diagnostics for 2D domains.
Overview
Harmonic measure quantifies the "visibility" of boundary subsets from interior points in potential-theoretic terms. This package provides:
- Direct computation of harmonic measure via boundary integral methods
- Corner detection for domains approaching polygonal limits
- Scaling diagnostics to quantify boundary crowding
- Visualization of harmonic measure density on boundaries
Installation
pip install harmonic-measure
# With plotting
pip install harmonic-measure[plot]
Quick Start
from harmonic_measure import HarmonicMeasure
from superellipse import Superellipse
# Create a Lamé domain approaching a rectangle
curve = Superellipse(a=1, b=1, p=32) # p=2n, so n=16
# Compute harmonic measure of a boundary subset
hm = HarmonicMeasure(curve)
omega = hm.measure_subset(
basepoint=[0, 0],
subset_fn=lambda pt: abs(pt[0] - 1) < 0.1 # near corner
)
print(f"Harmonic measure of corner neighborhood: {omega:.6f}")
Theory
Harmonic Measure
For a domain Ω with boundary ∂Ω, the harmonic measure ω_Ω(z, A) of a boundary subset A ⊂ ∂Ω as seen from z ∈ Ω is:
$$\omega_\Omega(z, A) = u_A(z)$$
where u_A solves: Δu = 0 in Ω, u = 1 on A, u = 0 on ∂Ω \ A.
Conformal Invariance
Under a conformal map f: 𝔻 → Ω with f(0) = z:
$$\omega_\Omega(z, A) = \frac{|f^{-1}(A)|}{2\pi}$$
where |·| denotes arc length on ∂𝔻.
Corner Crowding
For polygonal limits with interior angle α, boundary layers of thickness ρ have:
$$\omega \sim \rho^{\pi/\alpha}$$
For right angles (α = π/2): ω ~ ρ² (quadratic crowding)
API Reference
HarmonicMeasure(geometry)
Main class for harmonic measure computations.
| Method | Description |
|---|---|
measure_subset(basepoint, subset_fn) |
Harmonic measure of subset defined by boolean function |
measure_corners(basepoint, radius) |
Harmonic measure of corner neighborhoods |
density(basepoint) |
Harmonic measure density at each boundary node |
plot_density(basepoint) |
Visualize density on boundary |
corner_scaling_diagnostic(curve, ns, c=2.0)
Compute corner harmonic mass across a range of Lamé exponents.
Returns (ns, arc_lengths, fitted_slope).
adaptive_convergence(n, a, c, tol=1e-10)
Adaptively refine discretization until harmonic measure converges.
CLI
# Compute harmonic measure of corner regions
harmonic-measure corners --p 32 --radius 0.1
# Scaling diagnostic across exponents
harmonic-measure scaling --ns 8 16 32 64 --output scaling.csv
# Plot harmonic measure density
harmonic-measure density --p 16 --output density.png
Applications
- Conformal mapping: Diagnose boundary correspondence crowding
- Schwarz-Christoffel limits: Quantify prevertex clustering
- Brownian motion: Exit distribution from domains
- Potential theory: Capacity and extremal length computations
Related Packages
superellipse: Geometry primitivespanel-bie: Boundary integral solvers
References
- Garnett, J.B. & Marshall, D.E. (2005). Harmonic Measure. Cambridge University Press.
- Pommerenke, C. (1992). Boundary Behaviour of Conformal Maps. Springer.
License
MIT License. See LICENSE for details.
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
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 harmonic_measure-0.6.0.tar.gz.
File metadata
- Download URL: harmonic_measure-0.6.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a95ed0f1aa3c90de41fc9e4b50359f11993faa5eecd40e15669c0bd833a9b248
|
|
| MD5 |
42a51768073f27017852693328d39881
|
|
| BLAKE2b-256 |
51fe4229b9b1f85c578d235fd3e7440dfa1c4767a0b2d4c93ebd41778a34e088
|
Provenance
The following attestation bundles were made for harmonic_measure-0.6.0.tar.gz:
Publisher:
release.yml on egoughnour/harmonic-measure
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
harmonic_measure-0.6.0.tar.gz -
Subject digest:
a95ed0f1aa3c90de41fc9e4b50359f11993faa5eecd40e15669c0bd833a9b248 - Sigstore transparency entry: 857192720
- Sigstore integration time:
-
Permalink:
egoughnour/harmonic-measure@341f24317aeb86e823b5f96e96d4b3ae3f4753e6 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/egoughnour
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@341f24317aeb86e823b5f96e96d4b3ae3f4753e6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file harmonic_measure-0.6.0-py3-none-any.whl.
File metadata
- Download URL: harmonic_measure-0.6.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
456b090ef7a8877e165e1a133de1a8ce8a6d1f860a95c64abd92e43fa6c6ed48
|
|
| MD5 |
2caf07dd36309a4049211d6935e239c7
|
|
| BLAKE2b-256 |
d6fb6bcb9e6e110b6247f32096c289801f7e8bc3793364de0075bdc87dbf8e70
|
Provenance
The following attestation bundles were made for harmonic_measure-0.6.0-py3-none-any.whl:
Publisher:
release.yml on egoughnour/harmonic-measure
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
harmonic_measure-0.6.0-py3-none-any.whl -
Subject digest:
456b090ef7a8877e165e1a133de1a8ce8a6d1f860a95c64abd92e43fa6c6ed48 - Sigstore transparency entry: 857192724
- Sigstore integration time:
-
Permalink:
egoughnour/harmonic-measure@341f24317aeb86e823b5f96e96d4b3ae3f4753e6 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/egoughnour
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@341f24317aeb86e823b5f96e96d4b3ae3f4753e6 -
Trigger Event:
push
-
Statement type: