Quantum Computers Part 2 - Programming using IBM's circuit diagramFollow article
IBM has made a NISQ (noisy intermediate-scale quantum) computer. And they let anyone have a play with it through the cloud – called the IBM Q Experience.
This blog only uses a circuit diagram (which looks like a music stave) and a circuit editor (Openqasm).
Quasm is a Q assembler (hence the name – Q ASseMbler). This is the language that both qiskit python programs and the circuit diagram (music stave) editor spit out to be compiled into the set of microwave pulses that will be sent into the cryostat (very cold fridge) to modify the state of the qubits in the actual quantum computer. Qiskit is not a very high-level library, so the commands you put into a python program to add gates to the circuit make the program look very similar to what ends up in the Qasm file that comes out the bottom of that. Hence Qasm looks a lot like python qiskit – but it isn't exactly.
NOTE: 29th February 2020 IBM has changed its tutorials and now, after doing the simple circuit editor described below, it moves straight on to programming using Qiskit – which is a set of open-source Python libraries. I have not explored this method of programming.
How to program IBM's state of the art quantum computer using circuit diagrams
Step 1 – Understanding
Read my article on "things I wish I had known before I tried to program a quantum computer" – Quantum Computers Part 1 – what?
- Go to https://quantum-computing.ibm.com and sign up / log on.
- Read the Terms and conditions – especially if you think you may be making something commercially viable in the future – be aware of the rights you are handing to IBM.
- At the welcome page, do not click on the enticing "Create a circuit" or "Create a notebook" yet. Instead, click on the "Documentation" icon at the top of the left-hand menu.
- On the Documentation and Support page, there's a lot of really interesting and useful articles. I suggest you read through the "Learn Quantum Computing Without Coding – Quantum computing for the very curious" first. If you get very curious, then read the "A field guide to quantum computing".
Step 2 – Create a Circuit (not using quantum properties)
- Make sure you are signed in to https://quantum-computing.ibm.com
- Under Documentation, click on "Create your first quantum circuit"
Note: It may be easier to have the documentation open on a different screen or device than the one you try to create a circuit in – it will save flipping between the two.
- Click "circuit composer" on the left-hand menu – it looks sort of like an electronic circuit, with a square and a circle in it. Then click "New Circuit". It will open a new tab.
- Follow the instructions online to add a NOT (X) gate and a measurement icon and save and run. The results can take a while to show up – they are shown as "PENDING" before the live link actually appears.
- Read about the results – and celebrate that you've written your first quantum computing program – that was run on a simulator. You can run it on IBM's quantum computer by selecting a different back end when you run the program.
The rest of the tutorials for using the circuit diagram have now been removed and replaced with those using the Python programming language.
And this is where I bowed out ... sorry.