Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Add DumpUnitary function #179

@tcNickolas

Description

@tcNickolas

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions