ObservablesLCWP¶
About the ObservablesLCWP
class¶
The WaveBlocks Project
@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 R. Bourquin @license: Modified BSD License
Inheritance diagram¶
![Inheritance diagram of ObservablesLCWP](../_images/inheritance-689efb7f6a6db665ba2351a035f09ea54956a129.png)
Class documentation¶
-
class
WaveBlocksND.
ObservablesLCWP
[source]¶ This class implements observable computation for linear combinations
of wavepackets
. There are no assumptions made on the type of the wavepackets
in
.
-
__init__
()[source]¶ Initialize a new
ObservablesLCWP
instance for observable computation of linear combinationsof wavepackets
.
-
kinetic_energy
(lincomb, *, matrix=None, component=None, summed=False, return_matrix=False)[source]¶ Compute the kinetic energy
of a linear combination
of wavepackets.
Parameters: - linbomc – The linear combination
of which we compute the kinetic energy.
- matrix (An
ndarray
orNone
(default).) – The kinetic overlap matrix. IfNone
the matrix is computed internally. - component (Integer or
None
.) – The indexof the components
whose kinetic energy we want to compute. If set to
None
the computation is performed for allcomponents.
- return_matrix (Boolean, default is
False
.) – Whether to return the kinetic overlap matrix used internally.
Returns: The kinetic energy of
and optionally the kinetic overlap matrix
.
- linbomc – The linear combination
-
kinetic_overlap_matrix
(lincomb, *, component=None)[source]¶ Compute the kinetic overlap matrix
.
Parameters: - lincomb – The linear combination
.
- component (Integer or
None
.) – The indexof the components
whose kinetic energy we want to compute. If set to
None
the computation is performed for allcomponents.
Returns: The matrix
.
- lincomb – The linear combination
-
norm
(lincomb, *, matrix=None, component=None, summed=False, return_matrix=False)[source]¶ Compute the
norm
of a linear combination
of wavepackets.
Parameters: - lincomb (A
LinearCombinationOfWavepackets
subclass instance.) – The linear combinationof which we compute the norm.
- matrix (An
ndarray
orNone
(default).) – The overlap matrix. IfNone
the matrix is computed internally. - component – The index
of the components
whose norm is calculated. The default value is
None
which means to compute norms of allcomponents.
- return_matrix (Boolean, default is
False
.) – Whether to return the overlap matrix used internally.
Returns: The norm of
and optionally the overlap matrix
.
- lincomb (A
-
overlap_matrix
(lincomb, *, component=None)[source]¶ Compute the overlap matrix
.
Note that this function is just a shortcut for calling the inner product evaluator directly.
Parameters: - lincomb – The linear combination
.
- component (int or
None
.) – The indexof the components
whose overlap is calculated. The default value is
None
which means to compute overlaps of allcomponents.
Returns: The matrix
.
- lincomb – The linear combination
-
potential_energy
(lincomb, potential, *, matrix=None, component=None, summed=False, return_matrix=False)[source]¶ Compute the potential energy
. of a linear combination
of wavepackets.
Parameters: - linbomc – The linear combination
of which we compute the potential energy.
- potential – The potential
. (Actually, not the potential object itself but one of its
V.evaluate_*
methods.) - matrix (An
ndarray
orNone
per default.) – The potential overlap matrix. IfNone
the matrix is computed internally. - component (Integer or
None
.) – The indexof the components
whose potential energy we want to compute. If set to
None
the computation is performed for allcomponents.
- return_matrix (Boolean, default is
False
.) – Whether to return the potential overlap matrix used internally.
Returns: The potential energy of
and optionally the potential overlap matrix
.
- linbomc – The linear combination
-
potential_overlap_matrix
(lincomb, potential, *, component=None)[source]¶ Compute the potential overlap matrix
.
Parameters: - lincomb – The linear combination
.
- potential – The potential
. (Actually, not the potential object itself but one of its
V.evaluate_*
methods.) - component (Integer or
None
.) – The indexof the components
whose potential energy we want to compute. If set to
None
the computation is performed for allcomponents.
Returns: The matrix
.
- lincomb – The linear combination
-
set_gradient
(gradient)[source]¶ Set the gradient.
Parameters: gradient (A Gradient
subclass instance.) – A gradient operator.
-
set_innerproduct
(innerproduct)[source]¶ Set the innerproduct.
Parameters: innerproduct (A InnerProduct
subclass instance.) – An inner product for computing the integrals. The inner product is used for the computation of brakets.
Note
Make sure to use an inhomogeneous inner product here.
-