entanglementHandle

class entanglementHandle(t, psi, N, **kwargs)[source]

Bases: object

Creates a handle with the ability to store and updates entanglement.

Parameters:
  • t (float) – the elapsed time at handle initialization.
  • psi (petsc4py.PETSc.Vec) – vector containing the statespace.
  • N (int) – the size of the quantum walker’s position space (i.e. number of graph vertices).
Keyword Arguments:
 

: EigSolver keywords can also be passed;

for more details of the available EigSolver properties, see EigSolver.

Important

The Eigsolver must be set to lapack, since all the eigenvalues must be found in the calculation of entanglement.

Fortran interface

This function calls the Fortran function entanglement().

Method Summary

entanglementHandle.getEntanglement([t]) Returns the stored entanglement.
entanglementHandle.update(t, psi) Creates a handle with the ability to store and updates entanglement.

Method Details

entanglementHandle.getEntanglement(t=None)[source]

Returns the stored entanglement.

Keyword Arguments:
 t (None or float) – the timestep to retrieve the entanglement. If None, the the entanglement at all recorded timesteps is returned.
Returns:tuple of arrays : returns arrays corresponding to the times recorded (if t=None) and the entanglement over the recorded times.

Example

>>> timeArray, entArray = entanglementHandle.getEntanglement()

or

>>> entArray = entanglementHandle.getEntanglement(t=4)
entanglementHandle.update(t, psi)[source]

Creates a handle with the ability to store and updates entanglement.

Parameters:
  • t (float) – the timestep of the handle update.
  • psi (petsc4py.PETSc.Vec) – vector containing the statespace.

Fortran interface

This function calls the Fortran function entanglement().