Skip to content

holab.physics

This module provides functionalities for computing holograms based on wave equations, particularly the Helmholtz equation.


compute_hologram(lens, source, f0, lens_thickness, projection_distance, *, maxiter_helmholtz_solver=100, tol_helmholtz_solver=0.001, remove_padding=True, background=water)

Solves the helmholtz equation locally around the lens, and projects the field to the hologram plane using the angular spectrum method.

Parameters:

Name Type Description Default
lens PhysicalObject

The lens object. This needs to be a physical object with a "as_medium_on_environment" method.

required
source FourierSeries

The source field.

required
f0 float

The frequency of the source.

required
lens_thickness float

The thickness of the lens. This is used to determine the location of the plane used to extract the field to be projected.

required
projection_distance float

The distance from the lens to the hologram plane. This is used to determine the location of the plane used to extract the field to be projected. It is measured from the output plane of the lens.

required
maxiter_helmholtz_solver int

The maximum number of GMRES iterations for the helmholtz solver. Defaults to 100.

100
tol_helmholtz_solver float

The tolerance for the helmholtz solver. Defaults to 0.001.

0.001
remove_padding bool

Whether to remove the padding added by the angular spectrum method. Defaults to True.

True
background Material

The background material. Defaults to water.

water

Returns:

Name Type Description
FourierSeries FourierSeries

The hologram field.

project_to_hologram_plane(pressure, f0, lens_thickness, plane_distance, remove_padding=True, background=water)

Projects a field to the hologram plane using the angular spectrum method.

Parameters:

Name Type Description Default
pressure FourierSeries

The field to be projected. This needs to be a 3D wavefield from which a planar slice will be extracted.

required
f0 float

The frequency of the field.

required
lens_thickness float

The thickness of the lens. This is used to determine the location of the plane used to extract the field to be projected.

required
plane_distance float

The distance from the lens to the hologram.

required
remove_padding bool

Whether to remove the padding added by the angular spectrum method.

True
background Material

The background material. Defaults to water.

water

solve_helmholtz(medium, source, f0, maxiter=100, tol=0.001)

A thin wrapper around jwave.acoustics.time_harmonic.helmholtz_solver.

Parameters:

Name Type Description Default
medium Medium

The medium in which the field is to be solved.

required
source FourierSeries

The source field.

required
f0 float

The frequency of the source.

required
maxiter int

The maximum number of GMRES iterations (the internal solver used by helmholtz_solver).

100
tol float

The tolerance for the GMRES solver (the internal solver used by helmholtz_solver).

0.001

Returns:

Name Type Description
FourierSeries FourierSeries

The resulting acoustic field.