This is an old revision of the document!


PrintExpectationValues

PrintExpectationValues(psiList, Hamiltonian, opList, options) takes a table of wavefunctions, a Hamiltonian operator, a table of operators, 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 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”).

Input

  • psiList : A list of wavefunctions, or a single wavefunction
  • Hamiltonian : Giving the Hamiltonian operator here is optional
  • opList : A list of operators for which expectation values are to be calculated
  • Possible Options are:
    • “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)
    • “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)
    • “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)

Output

  • None

Example

Here's no example:

Input

Example.Quanty
-- some example code

Result

text produced as output

Table of contents

Print/export