Coder Social home page Coder Social logo

liquid's People

Contributors

fornever avatar toblux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

liquid's Issues

[CLOSED] Building a new Hamiltonian

Issue by ahusain
Thursday Mar 03, 2016 at 03:21 GMT
Originally opened as https://github.com/msr-quarc/Liquid/issues/15


The current Spin and Fermion classes are very limited, I was interested in applying my own Hamiltonian, perturbations, initial state, etc. Can someone post a short example how to use the Hamiltonian base class (of which there is very little documentation) and/or explain how to do this? I know you can effectively simulate this by using gates and time-stepping on your own, but I was hoping the class could take care of some of the bookkeeping for you.

Please help me cheat at video games :)

Pointer Scanning is a very comming technique used in video game cheating engines (and also hacking) to map dynamically allocated pointers back to a root (static) object. This process is very limited becaue it's only able to scan a few levels deep like 5 - 7 which in modern games is not deep enough. Clustered computers are often used to allow for deeper scanning but only allows to all a few more levels deep. This is a very hard problem for classical computers to solve.

https://www.youtube.com/watch?v=yy2Da6Y8EZA

Specific gate set decomposition/compilation question

The documentation of Circuit.Compile does not mention if an arbitrary function is only translated into a list of specific gates from a specified set or liquid instructions are mapped to their gates. Does Liquid support the compilation into specific gate sets?

[CLOSED] Parallelism in Quantum Algorithms

Issue by ajavadia
Sunday Dec 20, 2015 at 15:27 GMT
Originally opened as https://github.com/msr-quarc/Liquid/issues/6


I am interested in identifying the logical-level gate parallelism factors in your built-in algorithms.

I assume a good way to do this would be to call Fold(aggressive=1) on the generated circuit and then use GateCount(doParallel=1). However since the algorithms implementations are not released, I am only confined to the flags provided for each algorithm. Shor's, for example, has no such option. In Quantum Chemistry, I played with a bunch of options (A, C, N, O, etc) and looked at the "Counts" line in the output. I didn't see a difference between the "Seq," "Par," "Nest," and "RedundBest" counts in any scenario. Is this because those optimization flags don't fold the circuit, or there's just no parallelism between gates in the Quantum Chemistry circuit?

In general, is it possible for you to release the built-in algorithm implementations (not the entire simulator) so that this can be done for other algorithms such as Shor's as well?

Nesting Circuit.Run will throw error

I would like to partially Circuit.Fold a function, because circuit folding also includes moving labels on the right to the left. In this example I'm labelling the inputs of a function using the function labellingStart. I then compile the labelling to a circuit, to fold it so the labelling is executed in parallel. The labelling must then be applied to the larger circuit function in which it is embedded (not shown); I apply the Circuit.Run to make sure that the circStart is included in the larger circuit (otherwise circStart is not included in the output). This, however, seems to not be possible since it throws an error. Is this intended? What alternative way is there to put labels on the left and on the right which are shown in parallel, but are not moved by Circuit.Fold?

let k = Ket(4)
let qs = k.Qubits
let expand (qs: Qubits) =
    match (List.map(fun l -> [l]) qs) with
    | ki3 :: ki2 :: ki1 :: ki :: [] ->

        let labellingStart (qbs: Qubits) =
            LabelL "\\ket{k_i}" [qbs.[3]]
            LabelL "\\ket{k_{i+1}}" [qbs.[2]]
            LabelL "\\ket{k_{i+2}}" [qbs.[1]]
            LabelL "\\ket{k_{i+3}}" [qbs.[0]]

        let circStart = (Circuit.Compile labellingStart qs).Fold()
        circStart.Run qs
        
        // ... Remainder of circuit function ....
    | x -> failwithf "4 qubits must be given, instead was given %A" x
let circ = Circuit.Compile expand qs

I get the following error:

0:0000.0/=============== Logging to: Liquid.log opened ================
0:0000.0/Error running function draw(): Exception has been thrown by the target of an invocation.
0:0000.0/Inner: Circuit.Run: Must provide a ket state that has legal qubits
0:0000.0/Error occured at Invoke
0:0000.0/!!!!!!!!!!!!!!!!!!!!!! Stack Trace !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0:0000.0/  at ad.c (System.String A_0) [0x0023c]
0:0000.0/    in <16e8952738114e09bd59d5cb36925823>:0 
0:0000.0/  at Microsoft.Research.Liquid.Parser.CommandRun (Microsoft.Research.Liquid.LiquidArgs las) [0x000c4]
0:0000.0/    in <16e8952738114e09bd59d5cb36925823>:0 
0:0000.0/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0:0000.0/!!!    ERROR: Exiting Liquid
0:0000.0/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Access circuit output probabilities

Hi,

I am new to both Liquid and F# and want to write a very simple code that brute-force simulates a quantum circuit on n qubits. Eventually I want to access all output probabilities of the form |<0| C | x>|^2 where x runs over all 2^n configurations of the qubits.

Is there a simple way to access these at once (for example, simply by accessing all amplitudes of C |0>)? How would I write this list to a file?

Thanks and Cheers,
Dominik

Linux version segfaults on Debian Jessie (mono 3.2.8)

Hi there!

Just happened to test Liquid on Debian Jessie and noticed the Linux binary crashes while the Windows(?) binary works fine with the same Mono version:

glaubitz@qmio03:..glaubitz/Liquid-master> mono --version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-10)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
glaubitz@qmio03:..glaubitz/Liquid-master>

Windows version:

glaubitz@qmio03:..glaubitz/Liquid-master> mono ./bin/Liquid.exe
0:0000.0/
0:0000.0/===========================================================================================
0:0000.0/= The Language-Integrated Quantum Operations (LIQUi|>) Simulator =
0:0000.0/= Copyright (c) 2015,2016 Microsoft Corporation =
0:0000.0/= If you use LIQUi|> in your research, please follow the guidelines at =
0:0000.0/= https://github.com/msr-quarc/Liquid for citing LIQUi|> in your publications. =
0:0000.0/===========================================================================================
0:0000.0/
0:0000.0/TESTS (all start with two underscores):
0:0000.0/ __Big() Try to run large entanglement tests (16 through 33 qubits)
0:0000.0/ __Chem(m) Solve Ground State for molecule m (e.g., H2O)
0:0000.0/ __ChemFull(...) See QChem docs for all the arguments
0:0000.0/ __Correct() Use 15 qubits+random circs to test teleport
0:0000.0/ __Entangle1(cnt) Run n qubit entanglement circuit (for timing purposes)
0:0000.0/ __Entangle2(cnt) Entangle1 with compiled and optimized circuits
0:0000.0/ __Entangles() Draw and run 100 instances of 16 qubit entanglement test
0:0000.0/ __EntEnt() Entanglement entropy test
0:0000.0/ __EIGS() Check eigevalues using ARPACK
0:0000.0/ __EPR() Draw EPR circuit (.htm and .tex files)
0:0000.0/ __Ferro(false,true) Test ferro magnetic coupling with true=full, true=runonce
0:0000.0/ __JointCNOT() Run CNOTs defined by Joint measurements
0:0000.0/ __Kraus(cnt,AD,DP,v)Teleport w/noise for cnt times with prob AmpDamp=AD, DePolar=DP, v=true=verbose
0:0000.0/ __Noise1(d,i,p) d=# of idle gates, i=iters, p=probOfNoise
0:0000.0/ __NoiseAmp() Amplitude damping (non-unitary) noise
0:0000.0/ __QECC() Test teleport with errors and Steane7 code (gen drawing)
0:0000.0/ __QFTbench() Benchmark QFT used in Shor (func,circ,optimized)
0:0000.0/ __QLSA() Test of HHL linear equation solver
0:0000.0/ __QuAM() Quantum Associative Memory
0:0000.0/ __QWalk(typ) Walk tiny,tree,graph or RMat file with graph information
0:0000.0/ __Ramsey33() Try to find a Ramsey(3,3) solution
0:0000.0/ __SG() Test spin glass model
0:0000.0/ __Shor(N,true) Factor N using Shor's algo false=direct true=optimized
0:0000.0/ __show("str") Test routine to echo str and then exit
0:0000.0/ __Steane7() Test basic error injection in Steane7 code
0:0000.0/ __Teleport() Draw and run original, circuit and grown versions
0:0000.0/ __TSP(5) Try to find a Traveling Salesman solution for 5 to 8 cities
0:0000.0/
0:0000.0/Liquid Usage: Liquid [/switch...] function
0:0000.0/ Enclose multi-word arguments in double quotes
0:0000.0/
0:0000.0/Arguments (precede with / or -):
0:0000.0/
0:0000.0/ Switch Default Purpose
0:0000.0/ ------ -------------------- ------------------------
0:0000.0/ /log Liquid.log Output log file name path
0:0000.0/ /la Unset Append to old log files (otherwise erase)
0:0000.0/
0:0000.0/ /s "" Compile and load script file
0:0000.0/ /l "" Load compiled script file
0:0000.0/
0:0000.0/
0:0000.0/ Final arg is the function to call:
0:0000.0/ function(pars,...)
0:0000.0/
0:0000.0/============================================
0:0000.0/
0:0000.0/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0:0000.0/!!! ERROR: Need to provide at least one argument
0:0000.0/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
glaubitz@qmio03:..glaubitz/Liquid-master>

Linux version:

glaubitz@qmio03:..glaubitz/Liquid-master> mono linux/Liquid.exe
Missing method .ctor in assembly /local_scratch/glaubitz/Liquid-master/linux/Liquid.exe, type Microsoft.FSharp.Core.EntryPointAttribute
Can't find custom attr constructor image: /local_scratch/glaubitz/Liquid-master/linux/Liquid.exe mtoken: 0x0a000011

  • Assertion at class.c:5597, condition `!mono_loader_get_last_error ()' not met

Stacktrace:

Native stacktrace:

    mono() [0x4b5ca0]
    /lib/x86_64-linux-gnu/libpthread.so.0(+0xf8d0) [0x7ff6f251f8d0]
    /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7ff6f219a067]
    /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7ff6f219b448]
    mono() [0x6406e5]
    mono() [0x640853]
    mono() [0x529590]
    mono(mono_class_get_full+0xe2) [0x52a762]
    mono(mono_class_from_name+0xfe) [0x52ab7e]
    mono(mono_class_from_typeref+0x182) [0x52a392]
    mono(mono_class_get_full+0x145) [0x52a7c5]
    mono() [0x5296bd]
    mono(mono_class_get_full+0xe2) [0x52a762]
    mono() [0x5531aa]
    mono() [0x559a5e]
    mono() [0x42676e]
    mono(mono_runtime_invoke+0x3d) [0x5b8a8d]
    mono(mono_runtime_exec_main+0x10d) [0x5bb14d]
    mono(mono_main+0x1253) [0x48b863]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7ff6f2186b45]
    mono() [0x419fad]

Debug info from gdb:

[New LWP 24286]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007ff6f251f4c9 in __libc_waitpid (pid=24287, stat_loc=0x7ffe171df7bc, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
40 ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
Id Target Id Frame
2 Thread 0x7ff6effff700 (LWP 24286) "mono" sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85

  • 1 Thread 0x7ff6f3008780 (LWP 24285) "mono" 0x00007ff6f251f4c9 in __libc_waitpid (pid=24287, stat_loc=0x7ffe171df7bc, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40

Thread 2 (Thread 0x7ff6effff700 (LWP 24286)):
#0 sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
#1 0x00000000006371d6 in mono_sem_wait ()
#2 0x00000000005af5d4 in ?? ()
#3 0x000000000059178b in ?? ()
#4 0x000000000062ba1d in ?? ()
#5 0x000000000063bd93 in ?? ()
#6 0x00007ff6f25180a4 in start_thread (arg=0x7ff6effff700) at pthread_create.c:309
#7 0x00007ff6f224d62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7ff6f3008780 (LWP 24285)):
#0 0x00007ff6f251f4c9 in __libc_waitpid (pid=24287, stat_loc=0x7ffe171df7bc, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
#1 0x00000000004b5d3d in ?? ()
#2
#3 0x00007ff6f219a067 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#4 0x00007ff6f219b448 in __GI_abort () at abort.c:89
#5 0x00000000006406e5 in ?? ()
#6 0x0000000000640853 in ?? ()
#7 0x0000000000529590 in ?? ()
#8 0x000000000052a762 in mono_class_get_full ()
#9 0x000000000052ab7e in mono_class_from_name ()
#10 0x000000000052a392 in mono_class_from_typeref ()
#11 0x000000000052a7c5 in mono_class_get_full ()
#12 0x00000000005296bd in ?? ()
#13 0x000000000052a762 in mono_class_get_full ()
#14 0x00000000005531aa in ?? ()
#15 0x0000000000559a5e in ?? ()
#16 0x000000000042676e in ?? ()
#17 0x00000000005b8a8d in mono_runtime_invoke ()
#18 0x00000000005bb14d in mono_runtime_exec_main ()
#19 0x000000000048b863 in mono_main ()
#20 0x00007ff6f2186b45 in __libc_start_main (main=0x419d10, argc=2, argv=0x7ffe171e1878, init=, fini=, rtld_fini=, stack_end=0x7ffe171e1868) at libc-start.c:287
#21 0x0000000000419fad in ?? ()

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.

Aborted
glaubitz@qmio03:..glaubitz/Liquid-master>

Cheers,
Adrian

Please solve the halting problem :)

https://channel9.msdn.com/Blogs/Charles/Byron-Cook-Terminator-Proving-Good-Things-Will-Eventually-Happen
https://channel9.msdn.com/Shows/Going+Deep/Byron-Cook-Inside-Terminator

Please create a terminator like static software verification using Liquid

Terminator was a microsoft research project that could detect if programs would go into an infinate loop up to like 35,000 lines of code for hardward drivers.

Please impliment this same concept in Liquid or whatever microsoft's newest quantium language is for any length code. This would effectivly solve the unsolvable halting problem.

This should be easy, knock it out in a day or two. :)

https://en.wikipedia.org/wiki/Halting_problem
https://en.wikipedia.org/wiki/Microsoft_Terminator

Access to output of stab.showState function

Dear LIQUi|> team,

We are using the Stabilizer simulator and would like to be able to access and manipulate the output of the stab.showState function.

Thank you.

Raja Nagarajan and Antoine Vaillant

Question about __QWalk running on Mac

Dear All,

I am a Mac user and I want to run some experiments/simulations using __QWalk(). I understand that a BLAS library is needed in order to run __QWalk() and that uploading BLAS on Liquid is only available on Windows.

I have executed the command mono Liquid.exe "__QWalk(x)" where x is a valid parameter and I have certainly obtained some results. For instance, I ran mono Liquid.exe "__QWalk(tree)" and the results I got have been attached to this message (Liquid.log.txt file)
Liquid.log.txt

My question is: I do not know if running __QWalk() without a BLAS libray actually has a negative impact (that is, errors) on the results I get. Would you please be so kind as to share with me anything you know about the accuracy of running __QWalk() without a BLAS library?

Thank you very much in advance!

Salvador E. Venegas-Andraca

[CLOSED] Update QuickStart.md

Issue by redjbishop
Friday Oct 02, 2015 at 20:21 GMT
Originally opened as msr-quarc/Liquid#1


Hi Alan
I put the steps into sections and clarified a few things. I removed the option to get Liquid from the browser, and just included the Clone from the Desktop Client which works.

However, I am not an expert on Markdown and the resulting document does not look as it should. I did not change any numbers of the steps, but they are all messed up when I choose view. I hope you can fix that.
Thanks

Judith


redjbishop included the following code: https://github.com/msr-quarc/Liquid/pull/1/commits

Request for QLSA source code

{This request came in via the mailing list, so I'm logging it here for others to see}

My name is Volkan Erol and I am working as Assistant Professor in Computer Engineering department in Istanbul Okan University. Actually we are interested in your liquid software. My PhD thesis is on Entanglement Measures and Quantum Fisher Information. Personally I am studying nowadays Quantum Machine Learning.

When I was looking at your tutorial I have found that there is a sample for Quantum Linear Programming. If possible, could you please share with the .fsx source file of the following sample.

{picture from Liquid.pdf User's Manual on QLSA}

I would like check it and if possible I will suggest your software to my students.

Best regards,

Volkan Erol
Asst. Prof.
Okan University Computer Engineering department

Spin function

Hello, I am working on quantum ising model in Liquid and I found out that function that is used in ising model is stochastic. Is there a deterministic version of function that can be used?

Blockchain in QC

Hi. I want to test DLT in QC. It´s a professional project. May I try Liquid? How to start?

[CLOSED] what does the output log show?

Issue by rumschuettel
Wednesday Mar 16, 2016 at 22:15 GMT
Originally opened as https://github.com/msr-quarc/Liquid/issues/17


Not a bug, but out of curiosity:
0:0015.1/Time: 191 [180 to 240] MB= 61 cache(22973,16) GC:1478
What are the numbers after cache? I assume the last line is the garbage collected gates, but I can't see what the other numbers mean: I'm not caching gates, but yet the number is increasing constantly. Disabling the cache by setting CacheDisable to true does not change the output.

Hope someone can help clarifying that :-).
Thanks & best,
rumschuettel

NormDiff and Ket inner product

Hi,

I came across this issue while I wanted to calculate the inner product of two Ket vectors.
The only related function I could find was the NormDiff method.
However this functions seems to malfunction as can be reproduced by the following little code:

let keta = Ket(1)
keta.Qubits.[0].StateSet( new CVec([| 1. ; 0. |],[| 0.; 0. |])
let ketb = Ket(1)
ketb.Qubits.[0].StateSet( new CVec([| 0. ; 1. |],[| 0.; 0. |]) )
printfn "%A" keta
printfn "%A" ketb
printfn "L2 difference? %A" <| keta.NormDiff( ketb.Single() )

Results in the output:
Ket of 1 qubits:
=== KetPart[ 0]: Qubits (High to Low): 0
1
0
Ket of 1 qubits:
=== KetPart[ 0]: Qubits (High to Low): 0
0
1
L2 difference? 1.0

It seems that the function calculates L infinity difference rather that L2.

But my main question is whether there is a way to efficiently calculate the dot product of two Ket vectors.
In theory one could do this while preserving product form, whereas this function event if it worked would treate the Ket as if all qubits were entangled thus creates a full state vector.

Thanks

Licence file not aplicable for multiple logins

Hi

This a subtle issue about the licence file.
I have a desktop machine at my institution, but for running tests I prefer logging to another machine which has more cores. When I log to another machine my home folder gets auto mounted. So when I try to run liquid it checks the license file and finds out that it was accepted from a different machine.
So it asks again to accept and then I need to reopen Liquid. But then if I return my desktop I need to accept again and this goes on...

Is there any workaround for this? Probably a multi entry license file? (The machines run linux here.)

Thanks

Electron spin in time-dependent magnetic field?

Dear LIQUi|> Team,
I am interested in a specific problem, and I am not sure if I could use LIQUi|> for this. I would like to simulate the evolution of the spin state of an electron in a time-dependent magnetic field B(t). The Hamiltonian is simply:
H(t) = 1/2 * \mu_B * g_e * \sigma . B(t),
where \sigma is a vector of the Pauli matrices. Is there a way to do this with LIQUi|>? In case, this is not yet available, do you plan to extend the code in this direction?
Many thanks for any help.

Operation with different kets or the use of more than 24 qubits

Hi,
I searched in the previous issues and I haven't seen this issue/doubt.
I would like to work with some operations(CNOT) involving qubits.
something like:
let a = Ket(24).Qubits
CNOT[a.[1];result.[16]]
CNOT[a.[8];result.[16]]

but than I am using 24 qubits and I cannot allocate.

So, the solution is to create all qubits such as:
let a = Ket(8).Qubits
let b = Ket(8).Qubits
let result = Ket(8).Qubits
and apply something like :
CNOT[a.[1];result.[1]]
CNOT[b.[1];result.[1]]
However, Liquid doesn't allow me to work with different "states", i.e., I received the following error:
Inner: EvalOp: Not all qubits from the same state

Do you know how I can manage to do it? Or in the current state isn't possible?

Thank you in advance.

n-Controlled Gate with 0 and 1 states

I want to make a controleld gate but source qubits are not only 1 state, for example C-Swap (n qubit controlled);

let consider that we have |phi> state;
qs: |0001> -> H [qs.[1]]; H [qs.[2]]; -> |0001>+|0011>+|0101>+|0111> = |phi>

and apply SWAP(0,3) gate with controlled |10> for controlled qubits 1,2; (if qubit[1]=1 and qubit[2]=0 then apply SWAP(q.[0];q.[3]) gate);
U |phi> -> |0001>+|0011>+|1100>+|0111>

(or controlled |1010> for controlled qubits 1,2,3,4)
Can i do this, how do i ?

[CLOSED] Looking for Help testing on OSX

Issue by dbwz8
Thursday Feb 04, 2016 at 23:19 GMT
Originally opened as https://github.com/msr-quarc/Liquid/issues/11


With the major release of a new portable version of LIQUi|〉 (see the REAMDE.md file), I would like to ask the community for a little help. The only reason that we haven’t announced on OSX is that I’m still waiting for a machine to arrive that I can test on. If anyone is willing to take the Linux instructions (in the GettingStarted.md file) and to document what they need to do differently for OSX, I would greatly appreciate it. Theoretically, the provided /linux directory in the tree should already be (mostly) compatible. The main thing you would need to figure out is how to install mono, fsharp and monodevelop (all of which are documented at the same sites that the Linux instructions reference). In the event that the compiled .DLL and .EXE files refuse to cooperate, details of any roadblocks would also help in finishing the porting effort. Thanks in advance.

[CLOSED] Are there any source codes about some examples?

Issue by klinus9542
Friday Jan 08, 2016 at 00:04 GMT
Originally opened as https://github.com/msr-quarc/Liquid/issues/7


Are there any source codes about Fourier transform, phase estimation or other algorithms?

I am a student from UTS in Australia. I am now doing research of quantum computation.
During the last months, I have used Liquid as my research tools to stimulate some ideas about Groover's search algorithm and quantum secret sharing telecommunication. It is interesting and very useful.
However, when I want to code to verify basic quantum algorithms, for example quantum Fourier transform , phase estimation and order-finding, I find that your team have made Shor's factoring algorithm as inherent function. Then I regard that your team must have coded order-finding and reverse quantum Fourier transform successfully because it is an essential part of Shor's algorithm. I have tried my best to explorer the whole resource to find source code. Unfortunately, I can Not find any details about them. Is it possible to share some basic quantum algorithms source codes? In addition, more source codes would improve deep understanding of CHM file, brochure of LIQUid. The classes in Microsoft.Research.Liquid Namespace also have some unclear methods and properties. Thus given some advanced source examples, we also can make them clear and use them in other algorithms. Furthermore, a specific license, such as GNU or MPL, is an indivisible part of this platform. That often means how much time we should spend in studying this platform.

The version of .net framework and F# which is needed by LIQUid also are not very clear. With the rapid develop of VS, I think it would cost more and more time to test the correct version. If working environment is declared on User's Manual, it would be highly appreciated.

Thank you for your attention.
Thank you for your LIQUid.

Shusen Liu
(klinus 'at' outlook.com or Shusen.liu 'at' student.uts.edu.au)
08 Jan, 2016

A error in user manual

Dear Liquid team,
I'm trying to implement Stean7 class acorrding to your nice user manual.
At the page of 56 and 58(Example 53 and Example 55), one line of the code was replaced by
"Error! Hyperlink reference not valid."

Ket Bra operations

I am new F# and Liquid. my doctorate thesis is about quantum computing. i want to use Liquid for studies. i have a few questions about liquid.

  1. for ket state (|0>, |1> or |psi>) liquid have that

let ket = Ket(1)
let q = ket.Qubits

my first question: is there anything for bra state (<0|, <1| or <psi|)?

how can i do this operation: |0><0| |psi> or |a>|b><c|

  1. let's say we have |a> and |b> states

let ket = Ket(1)
let a = ket.Qubits
let ket2 = Ket(1)
let b = ket2.Qubits

my second question: how can i get (|a> + |b>) or (|a>⊗|b>) as c or d that is a new qubit state

let ket3 = Ket(1)
let c = ket3.Qubits
let ket4 = Ket(2)
let d = ket4.Qubits
c = a + b ?? or
d = a ⊗ b ??

Thank you for your interest.

Stabilizer Gaussian Elimination function

Dear LIQUi|> Team,

I'm using the Stabilizer simulator, and more precisely the Gaussian function (stab.Gaussian).

Currently, the use of this function is bound to the Stabilizer object, so we would like to be able to call the Gaussian function on any Tableau and get a Tableau back (as an output)

Thank you,

Raja Nagarajan and Antoine Vaillant.

[CLOSED] How do single gates act on Entangled Qubits?

Issue by ahusain
Saturday Mar 26, 2016 at 00:07 GMT
Originally opened as https://github.com/msr-quarc/Liquid/issues/18


I created an Identity matrix get to force qubits to be entangled, but it interacts very strangely with the built in gates. I am struggling to figure out why, because I can't take a look inside any of the built-gates.

I defined the identity gate as

let Id (qs:Qubits) =
let gate =
        Gate.Build("Id",fun () ->
            new Gate(
                Name = "Identity",
                Help = "Identity matrix for "+string(qs.Length)+" qubits",
                Mat = (CSMat(pown 2 qs.Length)),
                Draw = "\\gate{Id}"
        ))
    gate.Run qs

I started with a 2 qubit ket set to [Zero, One], and then applied the identity gate to it. It entangles fine and shows the entangled state (0, 1, 0, 0). Then I act X on the gate to get (0, 0, 0, 1), again no problems, it flips the first qubit properly. But when I act with X once more, I get (0, 0, 1, 0)!
What is the reason for this behavior? Is it because I explicitly defined the matrix in Id? Here is the code I ran using the Id gate.

let ket = Ket(2, One)
let qs  = ket.Qubits
X qs \\Now qs = [Zero, One] or (0, 1, 0, 0)
Id qs \\Returns (0, 1, 0, 0)
X qs \\Returns (0, 0, 0, 1)
X qs \\Returns (0, 0, 1, 0)
X qs \\Returns (0, 0, 0, 1)

Repeating this using the CNOT gate or some other entangling gate doesn't give the same problem, so it must have to do with the way I defined the gate.

Too many qubits have been allocated

When performing operations on more than 23 qubits I get the following message:

Too many qubits have been allocated

A simple program to reproduce this is:

X >< ((Ket(24)).Reset())

Why am I getting this message?

I somewhat remember there being a mention of a maximum number of qubits we are allowed to allocate; is this the case here? Would it be possible increase this limit for educational/research purposes? I am implementing algorithm for the gate counts, some purely (non-entangling) classical verification purposes, and for drawing circuit diagrams. As such I do not need to worry too much about the impact on the simulation of this many qubits.

Initialising an entangled quantum state

Hi there, I'm trying to use LiQUID to realise the simulation of the 1D Schrödinger equation with the algorithm for example described in http://arxiv.org/pdf/0709.1704v2.pdf . I have already implemented the time-evolution circuit. As I want to test the time-evolution on different starting states it is important to prepare an initial state equation (for example a gaussian wave packet). So far I have not found a way in Liquid to prepare an entangled state, so I wanted to ask whether there is a way to create an entangled state by for example supplying the CVec of such a state, or if the only way is to start at the 0 ket and then convert it to my intended initial state using gate decompositions?

[CLOSED] Randomness generation for separate measurements seems to be heavily correlated

Issue by pizzasok
Wednesday Feb 03, 2016 at 22:21 GMT
Originally opened as https://github.com/msr-quarc/Liquid/issues/10


Hi,

I just started experimenting with the simulator and subsequent measurements turned out be heavily correlated. I just initialised a qubit in some state and measured it, and repeated the same process many times. The result was very very strange. It may be the case that randomness generation is just not refreshed frequently enough so that it somehow use the same values for quickly repeated measurements.

Here is my code:

#if INTERACTIVE
#r @".\Liquid1.dll"
#else 
namespace Microsoft.Research.Liquid // Tell the compiler our namespace
#endif

open Microsoft.Research.Liquid // Get necessary Liquid libraries 
open Util // General utilities 
open Operations // Basic gates and operations


module Script =                     // The script module allows for incremental loading

    let rec measIter (qubit:Qubit) (times:int) =
        let q = Ket(1).Qubits.[0]
        q.StateSet qubit.State
        M[q]
        if q.Bit.v = 0 then
            times
        else
            measIter qubit (times+1)

    [<LQD>] 
    let TestRandom() =
        show "Iterating a measurement on qubit copies:"
        let qubit = Ket(1).Qubits.[0]
        qubit.StateSet(sqrt(0.8),0.0,sqrt(0.2),0.0)
        let p = qubit.Prob1
        for i in [1..10] do
            let rep = measIter qubit 0
            show "First measured |0> after %i repetitions, its probability is %e." rep ((1.0-p)*p**(float rep))

And the result of running it was:

C:\Liquid\bin>Liquid.exe /s TestRandom.fsx TestRandom()
0:0000.0/
0:0000.0/===========================================================================================
0:0000.0/=    The Language-Integrated Quantum Operations (LIQUi|>) Simulator                       =
0:0000.0/=        Copyright (c) 2015, Microsoft Corporation                                        =
0:0000.0/=        If you use LIQUi|> in your research, please follow the guidelines at             =
0:0000.0/=        https://github.com/msr-quarc/Liquid for citing LIQUi|> in your publications.     =
0:0000.0/===========================================================================================
0:0000.0/
0:0000.0/
0:0000.0/===========================================================================================
0:0000.0/=    This is an unregistered copy of LIQUi|>.                                             =
0:0000.0/=    Please follow the instructions at http://github.com/msr-quarc/Liquid to register.    =
0:0000.0/===========================================================================================
0:0000.0/
0:0000.0/=============== Logging to: Liquid.log opened ================
Microsoft (R) F# Compiler version 14.0.23020.0
Copyright (c) Microsoft Corporation. All Rights Reserved.
0:0000.0/Iterating a measurement on qubit copies:
0:0000.0/First measured |0> after 0 repetitions, its probability is 8.000000e-001.
0:0000.0/First measured |0> after 0 repetitions, its probability is 8.000000e-001.
0:0000.0/First measured |0> after 1829 repetitions, its probability is 0.000000e+000.
0:0000.0/First measured |0> after 0 repetitions, its probability is 8.000000e-001.
0:0000.0/First measured |0> after 0 repetitions, its probability is 8.000000e-001.
0:0000.0/First measured |0> after 0 repetitions, its probability is 8.000000e-001.
0:0000.0/First measured |0> after 0 repetitions, its probability is 8.000000e-001.
0:0000.0/First measured |0> after 0 repetitions, its probability is 8.000000e-001.
0:0000.0/First measured |0> after 0 repetitions, its probability is 8.000000e-001.
0:0000.0/First measured |0> after 0 repetitions, its probability is 8.000000e-001.
0:0000.0/=============== Logging to: Liquid.log closed ================

On the third line you can see the trace of an event which should not happen in the lifetime of the universe. A measurement event happened 1829 times in a sequence where each individual event had only 10% chance! I get similar results for about each 3rd test runs.

I do not know if it is relevant but I am running Liquid on a 64 bit Windows 7 OS which runs on a VirtualBox instance hosted by a 64 bit ubuntu machine.

Do you have any clue what is happening under the hood?

Convert qudit type CVec into type Qubits for measurement.

Hi there, so my ultimate goal is to apply certain operations on a qudit (d-level quantum states) state. For instance, multiply the amplitude of the state |4> by a scalar. e.g. |4> to -|4>. Below is a simple code to get the equal superposition of 2^n states in a qudit CVec type.

[<LQD>]
let __UserSample(n:int) =

    let k        = Ket(n)

    let qs       = k.Qubits 

    H >< qs 

    let mutable psi = k.Single()

I couldn't see how applying operations on a specific qudit state is possible by applying gates on post-Hadamard qs (type Qubits). Post Hadamard qs for n = 3 looks something like that

image

which can be expanded into

image

So applying any kinds of gate on these qubits before using the Single() command on the k will affect other qudit states that I do not want to touch. That is why I resolved to manipulating psi of CVec type which allows me to operate on a specific qudit states.

After all the operations have been done on psi, is there a pre-defined function/gate in LiQUi|> to convert this CVec type into Qubits type to be measured?

Take QASM code as simulator input?

Hello, our research group is trying to take advantage of the simulation power of Liquid. Is there a way to perform simulations on user QASM code (perhaps by translating QASM code to something that's compatible with Liquid), or does the circuit have to be compiled and simulated all within Liquid? By the way, is the UserSample() function in Liquid/linux/Main.fs built for this purpose? Thank you!

Generating Circuit Diagram for Shor's Algorithm in Microsoft LIQUi>

Hi, my name is Nick.

I'm currently working on a research paper with different quantum simulators. One of the simulators that I'm working with is Microsoft LIQUi> to simulate Shor's algorithm for various input values.

Is there a simple way for LIQUi> to generate a circuit diagram for a specific instance of Shor's algorithm? Like a line of code in the command prompt? I've watched the video tutorial, but I have a very limited understanding of using Visual Studio and creating scripts and functions in its environment.

Thanks!

Looking for help in compiling the Liquid.sln with VS2017 and windows 10

Hi,
When I add a function in Main.fs file and re-compiler the Liquid.sln according to the user's manual, I met four errors as follow :
1>FSC: Error FS1225: Failed to find the file next to FSharp.Core "C: \ Liquid \ bin \ FSharp.Core.optdata". The file should be in C:\Liquid\bin\FSharp.Core.optdata.

1>FSC: Error FS0229: There was an error opening the binary file "C: \ Liquid \ bin \ FSharp.Core.dll": Failed to find the file next to FSharp.Core "C: \ Liquid \ bin \ FSharp.Core.optdata".The file should be in C:\Liquid\bin\FSharp.Core.optdata.

1>FSC: Error FS3160: There was a problem reading the assembly "C: \ Liquid \ bin \ FSharp.Core.dll": There was an error opening the binary file "C: \ Liquid \ bin \ FSharp.Core.dll": Failed to find the file next to FSharp.Core "C: \ Liquid \ bin \ FSharp.Core.optdata". The file should be in C:\Liquid\bin\FSharp.Core.optdata.

1>FSC: Error FS0073: Internal Error: BuildFrameworkTcImports: no successful import of C:\Liquid\bin\FSharp.Core.dll

Is these any necessary steps before compiler the sln file? I want to know how to fix the error.
Waiting for your answers.

Best regards,
Thanks!

[CLOSED] Thread unsafe licence check?

Issue by pizzasok
Sunday Feb 28, 2016 at 00:27 GMT
Originally opened as https://github.com/msr-quarc/Liquid/issues/14


Hi,

I just started using the simulator, and wrote a nice script which does some tests with a whole bunch of different parameters on the input quantum states. So I thought it would be nice to use all the cores of my processor to speed up things, so I delegated some process using Array.Parallel.map.
It worked out nicely, until I moved to building my first project.

I just imported the .sln file with monodevelop and created a new f# source file in the project,
where I copied the content of the script file. And my cope suddenly stopped working correctly,
giving runtime error messages regarding threads. The main error was:
System.AggregateException and there was some InnerException:
System.IO.IOException Sharing violation on path /home/me/.liquidrc

It seems like the problem is that each thread calls Liquid and then each instance is trying to check the licence file the same time which gives rise to this error. I guess it was not a problem with scripting because then already the main call was targeting Liquid.exe:
mono Liquid.exe /s Test.fsx "Test()"

Do you think it can be indeed the root cause?
If yes how can I overcome it? Or can you make the licence check thread safe?

Thanks

Missing Methods

Hey! I've recently installed the Liqui|> software on my Mac together with Visual Studio Community and all the necessities, but for some reason every time I try to run some simple simulations (like, for example, the first one in the tutorial videos) I get this Error log:

0:0000.1/Error running function Try(): Exception has been thrown by the target of an invocation.
0:0000.1/Inner: Method 'Microsoft.Research.Liquid.Ket..ctor' not found.
0:0000.1/Error occured at Invoke
0:0000.1/!!!!!!!!!!!!!!!!!!!!!! Stack Trace !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0:0000.1/ at ad.c (System.String A_0) [0x0023c]
0:0000.1/ in <16e8952738114e09bd59d5cb36925823>:0
0:0000.1/ at Microsoft.Research.Liquid.Parser.CommandRun (Microsoft.Research.Liquid.LiquidArgs las) [0x000c4]
0:0000.1/ in <16e8952738114e09bd59d5cb36925823>:0
0:0000.1/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0:0000.1/!!! ERROR: Exiting Liquid
0:0000.1/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

It doesn't seem to be able to find certain methods and no matter what I do, the situtation stays pretty grim. Please help, if there's any hope!

Thank you

Simulation of Quantum Ising model using Spin-Glass sample

Dear LIQUi|> Team,
I am working on simulation of Quantum Ising model using LIQUi|>, which has almost the same Hamitonian as a Spin-Glass model given in the Samples.
But as a result I have to plot [ versus Λ(t)/Γ(t)] and [Sx versus Λ(t)/Γ(t)] with different configuration of Λ(t)/Γ(t)]. I encountered with the following problem: I can not extract whole data. Output gives only for few time:

0:0198.6/Time:  2140 [2140 to 2141] MB=      64 cache(2584504,58) GC:332
0:0198.7/Time:  2568 [2568 to 2569] MB=      64 cache(2590068,58) GC:441
0:0198.7/  2%: .... [<H>=-2.025 Stdev 0.003] [S_mid=0.012]
0:0198.7/Time:  3008 [3008 to 3009] MB=      65 cache(2595814,58) GC:456
0:0198.8/Time:  3454 [3454 to 3455] MB=      65 cache(2601612,58) GC:462
0:0198.8/  3%: .... [<H>=-2.045 Stdev 0.004] [S_mid=0.023]
...
  1. So how can we get whole data?
  2. How can we plot a graph?
    Thanks for any help!

incorrect BitControl QASM output from AltOutput.fs

Hi,

In the AltOutput.fs script, the parser for BitCon gates of Liquid is incorrect. For example, in the Teleport circuit, it outputs (c-x q1) instead of (c-x q1,q2).
I guess the problem is because the arity of the BitCon gate is still equal to that of the uncontrolled one.
Simply add the int value of pfx to the arity can fix this.

Thanks!

Custom namespace breaks command line arguments

Dear Liquid Team,

I have copied over the example project in the "source/" directory for my own purposes and it has functioned well so far and I ran some programs. Now I wanted to change the namespace from "Microsoft.Research.Liquid" to my own namespace. With some modifications to the imports statements a lot of things work fine. However, when I run liquid and give my function as a command line argument, I get the following message:

0:0000.0/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
0:0000.0/!!!    ERROR: Run function: Can't find myFunction
0:0000.0/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I have tried the following cmd line arguments: myFunction(), myNamespace.myModule.myFunction(), myModule.myFunction(), and myNamespace.myFunction(). All give similar errors. How do I point RunLiquid() to the right function?

Note: Everything works as soon as I change the namespace to Microsoft.Research.Liquid and have cmd line arguments myFunction()

And could it be possible to pass RunLiquid() the function directly instead? I'm not sure why we bother with command line arguments in a functional world.

[CLOSED] Hamiltonian Gates

Issue by rumschuettel
Saturday Jan 30, 2016 at 13:42 GMT
Originally opened as https://github.com/msr-quarc/Liquid/issues/9


Hi! Brief question: in Hamiltonian mode, one can use gates such as ZR or ZZR to couple spins. What if I want to use a coupling that's Hermitian but not necessarily unitary, e.g. a projector? I tried creating a projector on |11> for the first 2 qubits out of 4 by defining a custom gate with a diagonal matrix with 1s in the corresponding entry and 0 everywhere, which is not unitary - the simulation somewhat works, but the normalization is now totally off:
0:0000.0/Ket of 4 qubits: 0:0000.0/=== KetPart[ 0]: 0:0000.0/Qubits (High to Low): 0 1 2 3 0:0000.0/0x00000000: 2.1601667977e-05 0:0000.0/0x00000001: 2.1601667977e-05 0:0000.0/0x00000002: 2.1601667977e-05 0:0000.0/0x00000003: 2.1601667977e-05 0:0000.0/0x00000004: 1.14743224743e-05 0:0000.0/0x00000005: 1.14743224743e-05 0:0000.0/0x00000006: 1.14743224743e-05 0:0000.0/0x00000007: 1.14743224743e-05 0:0000.0/0x00000008: 1.14743224743e-05 0:0000.0/0x00000009: 1.14743224743e-05 0:0000.0/0x0000000a: 1.14743224743e-05 0:0000.0/0x0000000b: 1.14743224743e-05 0:0000.0/0x0000000c: 1.48433500775e-10 0:0000.0/0x0000000d: 1.48433500775e-10 0:0000.0/0x0000000e: 1.48433500775e-10 0:0000.0/0x0000000f: 1.48433500775e-10
So one can see that indeed the states with 1100, 1101, 1110 and 1111 have the least amplitude (as expected), but the overall probabilities don't add up to 1.

Any hint would be appreciated.
Thanks!
J.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.