I am searching for a quantum package in Python that can enable me to calculate, for example, a density matrix symbolically and display the results in variable form rather than numerically. I am aware of QuTiP
, but it is primarily designed for numerical applications.
$\begingroup$
$\endgroup$
1
-
$\begingroup$ Can you give a more specific example of a density matrix you want to calculate symbolically? I have had some luck combining sympy with Qiskit. $\endgroup$– Nick MertesCommented Mar 29 at 20:40
Add a comment
|
2 Answers
$\begingroup$
$\endgroup$
Take a look at qiskit-symb
, which is a Python package.
You may also take a look this, which is not a Python package, but you might find it helpful: Wolfram Quantum Framework provide-
$\begingroup$
$\endgroup$
The pytket package has utility functions for doing symbolic manipulations with quantum circuits. See the docs for pytket.utils.symbolic.
Here's how you'd get the symbolic unitary of a small circuit.
from pytket import Circuit
from pytket.circuit.display import render_circuit_jupyter as draw
from pytket.utils.symbolic import circuit_to_symbolic_unitary
from sympy import symbols
a, b = symbols("a b")
circ = Circuit(2)
circ.X(0).CRy(a, 0, 1).Rz(b, 0)
draw(circ) # Draw circuit diagram
circuit_to_symbolic_unitary(circ) # Get the symbolic unitary matrix