Some Mathematica resources for quantum information:
- Partial trace of a multi-qubit system (from Wolfram website)
- Partial trace of a multi-quDit system – updated version (from Wolfram website – old version)
- Concurrence of a 2-qubit system – updated version (from Wolfram website – old version)
Note: in the partial trace code some variables are global and may conflict with other parts of your code if you integrate it into a larger program. To fix this, you can simply change the name of some variables.