Anonymous ID: e41af5 March 7, 2019, 1:23 a.m. No.8750   🗄️.is 🔗kun   >>8751

Julia for Virtual Quantum Computing

 

Getting starting with Julia

Download latest release from: https://julialang.org/downloads/

  • follow standard prompts and install.

  • add the julia/bin directory to your path, which is where julia.exe resides.

 

Jupyter Notebooks

  • read about it here: https://jupyter.org/install

  • found the Ananconda3 route straightforward (already had for Python, latest 3.7 version).

  • Conda install here (mac selected by default, others avail): https://www.anaconda.com/distribution/

 

Project Jupyter was born out of the IPython project as the project evolved to become a notebook that could support multiple languages - hence its historical name as the IPython notebook. The name Jupyter is an indirect acronyum of the three core languages it was designed for: JUlia, PYThon, and R and is inspired by the planet Jupiter

 

Ok, while Conda downloads, open a CMD window and launch julia (just type julia if on your path).

This puts you at the Julia "REPL".

This is core interface. Type 1 + 1 and hit enter. Doing math, nice!

Type println("hello world") and Boom, you've got hello world checked off the list.

Now, hit the "]" key, and Boom, you're in the "Package Manager".

  • this is where you grab your add-on goodies. You'll come back here and add some more if what you need isn't in the "Base" Julia distro. Things like plotting, etc.

  • for now, you need the package that works with Jupyter Notebooks. Type "add IJulia" (note spelling and it's case sensitive).

  • congrats, you've installed your first package. Exit with Ctrl-C.

 

By now, Conda should be downloaded.

Install, and select the add to Path checkbock (red text comes up. Don't add if you already have it installed, etc.).

  • After install finishes, it will prompt if you'd like to install MS VStudio Code (think you already have that? Not needed for this).

 

Ok, you're done!

Go to your start menu and launch Jupyter Notebook.

It will start in your root \Users\username directory.

Here's a link to a notebook for the validation step posted by VQC yesterday:

https://pastebin.com/YYfaHxSr

  • save as an .ipybn file type (remove .txt from pastebin).

  • navigate to dir from Jupyter and launch. Will take a moment for the Kernel to start.

  • "SHIFT-ENTER" is used when in a code cell to run that section of code. Results post right below the cell. You can run the whole workbook, or sections as well using menus at top.

  • There is also a little "play button" that shows to left of a cell, but installing here don't see it as on other machine.

 

There are plenty of sites to learn from. Here's a nice one, it was done in a notebook, you just copy paste code and run it. Piece by piece. No compiling (it does it in background first time you run a function).

https://juliabyexample.helpmanual.io/