Both sides previous revisionPrevious revisionNext revision | Previous revision |
documentation:language_reference:functions:printexpectationvalues [2018/11/13 15:43] – Added code example and mentioned extraLists Simon Heinze | documentation:language_reference:functions:printexpectationvalues [2024/01/25 19:44] (current) – Point out that restrictions are not respected. Johannes Falke |
---|
| |
### | ### |
PrintExpectationValues(psiList, Hamiltonian, opList, options) (old order) or PrintExpectationValues(psiList, opList, Hamiltonian, extraLists, options) (new order) takes a table of wavefunctions, a table of operators, a Hamiltonian operator, extraLists, and a list of options, and prints out expectation values. The Hamiltonian is treated separately here because it is possible to sort the output by energy and/or to print the standard deviation in energy. It can be omitted. The (otpional) extraLists need to be given in pairings of name and list of numbers. They can for example be used to include values that cannot be expressed as Hermitian operators. The Options are also optional. | PrintExpectationValues(psiList, Hamiltonian, opList, options) (old order) or PrintExpectationValues(psiList, opList, Hamiltonian, extraLists, options) (new order) takes a table of wavefunctions, a table of operators, a Hamiltonian operator, extraLists, and a list of options, and prints out expectation values. Note that restrictions placed on the operators in opList are not currently respected. The Hamiltonian is treated separately here because it is possible to sort the output by energy and/or to print the standard deviation in energy. It can be omitted. The (otpional) extraLists need to be given in pairings of name and list of numbers. They can for example be used to include values that cannot be expressed as Hermitian operators. The Options are also optional. |
| |
The function prints a header based on the name of the operator (except in the case of the Hamiltonian, where it uses "E"). | The function prints a header based on the name of the operator (except in the case of the Hamiltonian, where it uses "E"). |
* "colWidth" Positive integer specifying the width of each column. (Default value 8) | * "colWidth" Positive integer specifying the width of each column. (Default value 8) |
* "printHeaderEvery" Positive integer specifying how often the header should be printed. (Default value 0, meaning the header is only printed at the beginning) | * "printHeaderEvery" Positive integer specifying how often the header should be printed. (Default value 0, meaning the header is only printed at the beginning) |
* "printSigma" Bool specifying if the standard deviation shall be printed, useful for checking how close to an energy eigenstate a wavefunction is (needs an specified Hamiltonian for that). (Default false) | * "printSigma" Bool specifying if the standard deviation shall be printed, useful for checking how close to an energy eigenstate a wavefunction is (needs an specified Hamiltonian for that). If the Hamiltonian has restrictions it takes these into account, allowing to check how far away a wave function is from an eigenstate in a subspace. (Default false) |
* "sortByEnergy" Bool specifying if the wavefunctions are to be sorted by energy (needs an specified Hamiltonian for that). (Default false) | * "sortByEnergy" Bool specifying if the wavefunctions are to be sorted by energy (needs an specified Hamiltonian for that). (Default false) |
* "zero" Positive real number. Every number whose absolute value is smaller than zero is set to 0 for a more readable output. (Default 1E-10) | * "zero" Positive real number. Every number whose absolute value is smaller than zero is set to 0 for a more readable output. (Default 1E-10) |