Recent Changes - Search:

HomePage

PmWiki

pmwiki.org

MpAttr

The mp-attr command displays the attributes of a wavefunction.

The attributes are a list of key=value pairs, similar to UNIX environment variables. Some common attributes are set by commands that act on the wavefunction, but other attributes can be set freely. Attributes can also be used as command-line parameters. For example, if no Hamiltonian is supplied to the dmrg program, then it uses the Hamiltonian attribute of the wavefunction.

Synopsis

mp-attr <wavefunction> [attribute [= value]] ...

Examples

  1. List all attributes of a wavefunction:

    $ mp-attr psi
    Hamiltonian=lattice:H{alpha=0.6153846153846154,K=1}
    LastEnergy=-8.9062111352850764
    QShift=4
    UnitCellSize=26
    WavefunctionType=Infinite
    
  2. Display the value of a single attribute:

    $ mp-attr psi UnitCellSize
    26
    

    This form is useful when writing scripts.

  3. Display the values of several attributes:

    $ mp-attr psi UnitCellSize QShift
    UnitCellSize=26
    QShift=4
    
  4. Set the value of the Hamiltonian attribute:

    $ mp-attr psi Hamiltonian="lattice:H_JK"
    

    This will also display the attribute. It is possible to display and set many attributes at the same time.

Notes

  1. mp-attr is intended for use in scripts. For example, during post-processing the calculation of observables might depend on the particular Hamiltonian, or perhaps the unit cell size, or the quantum number (target state) of the wavefunction. Those are pre-defined attributes. You can also set arbitrary information in your own attributes, for example, if you want to label a wavefunction to indicate that it has already been processed by some script you could use mp-attr psi Processed=true and then the script could check the value of $(mp-attr psi Processed) for true vs empty.

See also

Edit - History - Print - Recent Changes - Search
Page last modified on July 25, 2016, at 07:18 PM