1
$\begingroup$

Is there a way to create an arbitrary state in Q# just for debugging purposes in the local computer via the quantum full state simulator?

$\endgroup$

1 Answer 1

1
$\begingroup$

Modern QDK (version 1.*): You can use the library operations PreparePureStateD (arbitrary real amplitudes) or ApproximatelyPreparePureStateCP (complex amplitudes, with a possibility of approximate state preparation) to prepare an arbitrary state starting from the $|0..0\rangle$ state.

Classic QDK (version 0.*): You can use the library operations PrepareArbitraryStateD (real non-negative amplitudes) or PrepareArbitraryStateCP (complex amplitudes) to prepare an arbitrary state starting from the $|0..0\rangle$ state.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.