Projection

lightworks.tomography.projection.project_choi_to_physical(choi: ndarray[tuple[Any, ...], dtype[complex128]], max_iter: int = 1000) ndarray[tuple[Any, ...], dtype[complex128]]

Performs the CPTP algorithm from https://arxiv.org/abs/1803.10062, ensuring the provided choi matrix is completely positive and trace preserving. This uses a series of repeat projection steps until a convergence is reached.

Parameters:
  • choi (np.ndarray) – The matrix which is to be projected.

  • max_iter (int) – The max number of iterations that can be performed by the projection algorithm.

Returns:

The calculated choi matrix, which meets the required

conditions to be physical.

Return type:

np.ndarray

lightworks.tomography.projection.project_density_to_physical(rho: ndarray[tuple[Any, ...], dtype[complex128]]) ndarray[tuple[Any, ...], dtype[complex128]]

Takes a provided density matrix and projects into to a physical space using the algorithm from https://doi.org/10.48550/arXiv.1106.5458. It ensures:

  1. The matrix is Hermitian

  2. The trace of the matrix is 1.

  3. All eigenvalues of the matrix are positive, if not the matrix is projected so this is the case.

Parameters:

rho (np.ndarray) – The matrix which is to be projected.

Returns:

The calculated density matrix, which meets the required

conditions to be physical.

Return type:

np.ndarray