You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Please describe what you would like the feature to accomplish.
It would be extremely helpful to be able to see a matrix representation of a Q# operation.
Describe the solution you'd like
A DumpUnitary function that would take an operation on N qubits as a parameter and dump an array of complex numbers that is a matrix representation of that unitary. It could use Choi–Jamiłkowski isomorphism to extract those coefficients from the amplitudes of a state prepared in a specific way.
Describe alternatives you've considered
My current workaround is https://github.com/microsoft/QuantumKatas/tree/master/utilities/DumpUnitary, but it is fairly fragile (it broke when DumpMachine output format broke, it doesn't account for relative phases between columns, and so on). This really seems like something that should be part of the built-in language capabilities, not something that each user has to implement for themselves.