AnalyticEigenstates¶
The classes documented below are the base classes you should consider subclassing before adding a new analytical case to the SiegPy module.
The AnalyticEigenstate
class is the base
class for two other classes:
- the
AnalyticSiegert
class, - and the
AnalyticContinuum
class.
If your analytic case is already well defined by these last classes, you may
only subclass these two. However, if you need to add some methods or
attributes to both classes, you may also subclass
AnalyticEigenstate
.
For instance, the parity of the analytic eigenstates in the 1D Square-Well Potential case made it mandatory.
-
class
siegpy.analyticeigenstates.
AnalyticEigenstate
(k, potential, grid, analytic)[source]¶ Bases:
siegpy.functions.AnalyticFunction
,siegpy.eigenstates.Eigenstate
Class gathering the attributes and methods necessary to define an analytic eigenstate of any analytical problem (such as the 1D Square-Well Potential case).
Note
To consider a case as analytic, the wavefunctions of the Siegert and continuum states should be known analytically. The analytic scalar product of both types of eigenstates with at least one type of test function should also be defined.
Parameters: - k (complex) – Wavenumber of the eigenstate.
- potential (Potential) – Potential for which the analytic eigenstate is known.
- grid (list or set or numpy array) – Discretization grid.
- analytic (bool) – If
True
, the scalar products must be computed analytically.
Raises: WavenumberError
– If the inferred Siegert type is unknown.-
potential
¶ Returns: Potential for which the eigenstate is a solution. Return type: complex or float
-
wavenumber
¶ Returns: Wavenumber of the eigenstate. Return type: complex or float
-
energy
¶ Returns: Energy of the Eigenstate Return type: complex or float
-
_find_Siegert_type
(k)[source]¶ Note
This is an asbtract method.
Parameters: k (float or complex) – Wavenumber of the eigenstate Returns: Type of the eigenstate from its wavenumber k ( 'b'
for bound states,'ab'
for anti-bound states,'r'
for resonant states,'ar'
for anti-resonant states, andNone
for continuum states).Return type: str or NoneType
-
analytic
¶ Returns: Analyticity of the scalar products. Return type: bool
-
__eq__
(other)[source]¶ Two analytic eigenstates are the same if they share the same wavenumber, potential and Siegert_type.
Parameters: other (object) – Another object Returns: True
if both eigenstates are the same.Return type: bool
-
scal_prod
(other, xlim=None)[source]¶ Note
This is an asbtract method.
Evaluate the scalar product between the state and a test function
other
. It ensures that the numerical scalar product is computed when the analytical scalar product with test functions is not implemented in the child class.Parameters: - other (Function) – Test function.
- xlim (tuple(float, float)) – Bounds of the space grid defining the interval over which the scalar product must be computed.
Returns: Value of the scalar product of the state with a test function.
Return type: float or complex
-
class
siegpy.analyticeigenstates.
AnalyticSiegert
(k, potential, grid, analytic)[source]¶ Bases:
siegpy.analyticeigenstates.AnalyticEigenstate
Class specifying the abstract method allowing to find the type of the analytic eigenstate, in the case it is a Siegert state.
Parameters: - k (complex) – Wavenumber of the eigenstate.
- potential (Potential) – Potential for which the analytic eigenstate is known.
- grid (list or set or numpy array) – Discretization grid.
- analytic (bool) – If
True
, the scalar products must be computed analytically.
Raises: WavenumberError
– If the inferred Siegert type is unknown.-
_find_Siegert_type
(k)[source]¶ Parameters: k (complex) – Wavenumber of the Siegert state. Returns: The type of the Siegert state, namely: 'b'
for a bound state'ab'
for an anti-bound state'r'
for a resonant state'ar'
for an anti-resonant state
Return type: str Raises: WavenumberError
– If the wavenumber is equal to zero.
-
class
siegpy.analyticeigenstates.
AnalyticContinuum
(k, potential, grid, analytic)[source]¶ Bases:
siegpy.analyticeigenstates.AnalyticEigenstate
Class specifying the abstract method allowing to find the type of the analytic eigenstate, in the case it is a continuum state.
Parameters: - k (complex) – Wavenumber of the eigenstate.
- potential (Potential) – Potential for which the analytic eigenstate is known.
- grid (list or set or numpy array) – Discretization grid.
- analytic (bool) – If
True
, the scalar products must be computed analytically.
Raises: WavenumberError
– If the inferred Siegert type is unknown.