4

I am programming quantum algorithms in Microsoft Liquid (F#). For debugging, it would be really nice to see what the current quantum state is.

I can use:

for q in qs do show "q[%d]=%s" q.Id (q.ToString())

where qs is my list of qubits, but this only works if the state is not entangled.
However, if it is entangled, is there a way to just show the current quantum state, e.g.:

ket = 1/sqrt(2)*[|00>+|11>]
mvdl1996
  • 41
  • 1
  • I know very little about liquid or quantum computing, but I am intrigued by the use of a platform with roots in e-commerce platform for quantum algorithms — is there anything worth mentioning in your post about this technology choice? – PJTraill Dec 06 '17 at 12:13

1 Answers1

3

The Ket.Dump method will print a nicely formatted state vector to the console:

qs.[0].Ket.Dump()

See http://stationq.github.io/Liquid/docs/html/aecdd029-bf0a-3e8f-3c2b-348802584d85.htm and http://stationq.github.io/Liquid/docs/html/56e790bd-3150-17ca-adac-0b91ecf9ef7e.htm.

Alan Geller
  • 494
  • 2
  • 5