toqito icon indicating copy to clipboard operation
toqito copied to clipboard

Missing documentation for `depolarizing` and `dephasing`

Open tnemoz opened this issue 9 months ago • 2 comments

Before reporting this bug:

  • [x] Verify there is not an existing issue for it already
  • [x] You are using the latest version of toqito with a python version >=3.10

Describe the bug

The depolarizing channel with parameter $p$ is often defined as $$\Phi(\rho)=p\mathrm{Tr}[\rho]\frac{I}{d}+(1-p)\rho$$ with its Choi matrix being $$\frac{p}{d}I\otimes I+(1-p)|\psi\rangle!\langle\psi|$$ with $\ket{\psi}$ being the (unnormalized) maximally entangled state. However, it seems like the depolarizing function swaps $p$ and $1-p$, which is the Qetlab convention, as seen here.

https://github.com/vprusso/toqito/blob/d0c797ae9ee3a93bd3c1d6c1f81d7fbb8fa0d58c/toqito/channels/depolarizing.py#L94-L95

Furthermore, the documentation doesn't state how the parameter $p_0$ is applied, which is crucial to know which convention is used. In all cases, the documentation should be transformed to include the parameter $p_0$ instead of the totally depolarizing channel only.

The same missing documentation concerning how the parameter is used occurs for the dephasing function.

Both documentations should be updated accordingly to reflect the use of the parameters of the channels.

tnemoz avatar Mar 27 '25 01:03 tnemoz

If this is still being worked on I would like to take up this issue

RohitP2005 avatar Mar 28 '25 08:03 RohitP2005

Sure, @RohitP2005 , if you'd like to give this a go, you're more than welcome to do so. Also, thanks to @tnemoz for flagging this!

vprusso avatar Mar 28 '25 12:03 vprusso