# watch¶

Line3P.watch(nodes, type='prob')

Creates a handle that watches either marginal probability or walker entanglement during propagation.

Parameters: Keyword Arguments: nodes (array of ints) – the nodes to watch marginal probability (e.g. [0,1,4]). watchtype (str) – (‘prob’ , ‘entanglement’). the type of watch handle to produce. : If watchtype=’entanglement’, EigSolver keywords can also be passed; – for more details of the available EigSolver properties, see propagate(). : * if watchtype='prob', creates a handle that can be accessed to retrieve marginal node probabilities for various $$t$$ * if watchtype='entanglment', creates a handle that can be accessed to retrieve entanglement values for various $$t$$ if watchtype='prob': pyCTQW.MPI.ctqw.nodeHandle() if watchtype='entanglement': pyCTQW.MPI.ctqw.entanglementHandle()

Examples

To watch the entanglement,
>>> walk.watch(None,watchtype='entanglement')
>>> walk.propagate(5.,method='chebyshev')
>>> timeArray, entArray = walk.entanglementHandle.getEntanglement()


Note

• The entanglement measure used in Von Neumann entropy, calculated via $$S=-\sum_{i}\lambda_i\log_{2}\lambda_i$$, where $$\lambda_i$$ are the eigenvalues of the reduced density matrix $$\rho_2 = \text{Tr}_1(|\psi(t)\rangle\langle\psi(t)|)$$
• Nodes do not need to be specified, as entanglement is a global measurement.
• As it is a global measurement, there is a large amount of node communication which may increase overall program run time.
To watch the probabilities,
>>> walk.watch([0,1,4])
>>> walk.propagate(2.,method='chebyshev')
>>>timeArray, probXArray, probYArray, probZArray = self.handle.getLocalNode(4,p=2)


Warning

Note that walk.handle attributes are not collective; if running on multiple nodes, only local values will be returned.