SymbolicIntegral0¶
About the SymbolicIntegral0
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¶
Class documentation¶
-
class
WaveBlocksND.
SymbolicIntegral0
(doraise=False, *unused, **kunused)[source]¶ -
__init__
(doraise=False, *unused, **kunused)¶ Use a symbolic exact formula for computing the inner product between two semi-classical wavepackets. The formula is constructed explicitly for the inhomogeneous case.
Parameters: doraise – Raise an InnerProductException
exception in case the symbolic formula will fail due to an inherent mathematical singularity. Default isFalse
.
-
exact_result_ground
(Pibra, Piket, eps)¶ Compute the overlap integral of the groundstate by using the symbolic formula:
Note that this is an internal method and usually there is no reason to call it from outside.
Parameters: - Pibra – The parameter set of the bra .
- Piket – The parameter set of the ket .
- eps – The semi-classical scaling parameter .
Returns: The value of the integral .
-
exact_result_higher
(Pibra, Piket, eps, k, l)[source]¶ Compute the overlap integral of two states and by using the symbolic formula:
Note that this is an internal method and usually there is no reason to call it from outside.
Parameters: - Pibra – The parameter set of the bra .
- Piket – The parameter set of the ket .
- eps – The semi-classical scaling parameter .
- k – Index of the wavepacket basis function .
- l – Index of the wavepacket basis function .
Returns: The value of the integral .
-
get_description
()[source]¶ Return a description of this integral object. A description is a
dict
containing all key-value pairs necessary to reconstruct the current instance. A description never contains any data.
-
get_qr
()¶ Return the
QuadratureRule
subclass instance used for quadrature.Returns: The current instance of the quadrature rule.
-
initialize_operator
(operator=None, matrix=False, eval_at_once=False)¶ Provide the operator part of the inner product to evaluate. This function initializes the operator used for quadratures and for building matrices.
Note
The symbolic solution can not handle operators at all.
Parameters: - operator – The operator of the inner product.
If
None
a suitable identity is used. - matrix – Set this to
True
(Default isFalse
) in case we want to compute the matrix elements. For nasty technical reasons we can not yet unify the operator call syntax. - eval_at_once (Boolean, default is
False
.) – Flag to tell whether the operator supports theentry=(r,c)
call syntax. Since we do not support operators at all, it has no effect.
- operator – The operator of the inner product.
If
-
initialize_packet
(pacbra, packet=None)¶ Provide the wavepacket parts of the inner product to evaluate. Since the formula is for the inhomogeneous case explicitly, different wavepackets can be used for the ‘bra’ as well as the ‘ket’ part.
Parameters: - pacbra – The packet that is used for the ‘bra’ part.
- packet – The packet that is used for the ‘ket’ part.
Raises: ValueError
if the dimension of is not 1.
-
perform_build_matrix
(row, col)¶ Computes the matrix elements by an exact symbolic formula.
Parameters: - row – The index of the component of .
- row – The index of the component of .
Returns: A complex valued matrix of shape .
-
perform_quadrature
(row, col)¶ Evaluates the integral by an exact symbolic formula.
Parameters: - row – The index of the component of .
- row – The index of the component of .
Returns: A single complex floating point number.
-
prepare
(rows, cols)¶ Precompute some values needed for evaluating the integral or the corresponding matrix over the basis functions of and . Note that this function does nothing in the current implementation.
Parameters: - rows – A list of all with selecting the for which we precompute values.
- cols – A list of all with selecting the for which we precompute values.
-
set_qr
(QR)¶ Set the
QuadratureRule
subclass instance used for quadrature.Parameters: QR – The new QuadratureRule
instance.
-