0
$\begingroup$

In Q#, How do I store a Qubits state in a binary-based disk / hard drive for use by regular digital programs? Is this even possible?

$\endgroup$
  • $\begingroup$ Are you asking for an exact representation not an approximation? $\endgroup$ – AHusain Jun 4 at 20:17
  • $\begingroup$ Exact representation $\endgroup$ – AJ_4real Jun 4 at 20:48
0
$\begingroup$

No, it is not possible. Consider simply counting the number of possibilities. You have N bits so can only differentiate $2^N$ possibilities. How many possible states are there for 1 qubit if you don't do any approximation?

If you do some approximation, then you may want to store the circuit that produced the given state starting from $| 0 \rangle$. But that would have had gates like rotation by some angle $\theta$ in which case storing $\theta$ would be using the floating point approximation of real numbers in order to turn it into something representable with finite amount of bits.

Don't make the type error of floats vs reals.

$\endgroup$
0
$\begingroup$

What use case do you have in mind?

Q# allows you to produce human-readable dump of wave function using DumpMachine operation (see this question for more details). However, this does not give you an exact representation, since the floating-point numbers used for storing the amplitudes internally are by definition not exact.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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