32 views

Uploaded by ivi

INTRO QCL

- Migrating+from+C+to+Cpp
- Rapid
- End_routine_to_get_data_from_TVARVC_TABLE.pdf
- The quantum-to-classical transition: Bohr’s doctrine of classical concepts, emergent classicality, and decoherence
- Pricing Configuration is Same for Regular Sales Order
- SAC Tutorial
- Chinese Physicists Measure Speed of Einstein
- MS. Excell VBA-#16, July 24, 2013.pdf
- berrada.pdf
- XII-CompSc1..doc
- lapacke
- sichelman_abstract.pdf
- Zorro Manual
- 1110.4108.pdf
- Grynberg, photodetectors
- Chapter 566566
- 1 Block Models and Rough Open Pits
- basicsCC++1.pdf
- Recursion in C
- Midterm1 Study Guide

You are on page 1of 40

SEMBEI/LARC/PCS/POLI/USP

QCL intro

1 / 30

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

2 / 30

Installation

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

3 / 30

Installation

Installation

http://tph.tuwien.ac.at/~oemer/qcl.html

Untar the file (tar xzvf qcl-0.6.3.tgz)

make; make install

To run, just type qcl in your terminal

Note: qcl is only available in Linux operating systems. If youre using Windows

try a virtual machine or Cygwin.

Note2: You need flex and bison in order to use qcl. Some other packages may

also be needed for additional features, look into the documentation to more info.

QCL intro

4 / 30

Getting Started

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

5 / 30

Getting Started

Simple examples

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

6 / 30

Getting Started

Simple examples

Embedded Examples

Type qcl to start the environment

QCL intro

7 / 30

Getting Started

Simple examples

Embedded Examples

Type qcl to start the environment

Type include grover.qcl; to import the grover.qcl file

Use grover(10); to run the Grover Search for the number 10

Try other values

QCL intro

7 / 30

Getting Started

Simple examples

Embedded Examples

Type qcl to start the environment

Type include grover.qcl; to import the grover.qcl file

Use grover(10); to run the Grover Search for the number 10

Try other values

Now import shor.qcl and run the Shors algorithm to some values

QCL intro

7 / 30

Getting Started

Simulation Limits

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

8 / 30

Getting Started

Simulation Limits

Questions

What happens when you enter a even number?

And a square?

QCL intro

9 / 30

Getting Started

Simulation Limits

Questions

What happens when you enter a even number?

And a square?

What is the highest factorable value? (Shor)

What is the highest searchable value? (Grover)

QCL intro

9 / 30

Getting Started

Simulation Limits

Questions

What happens when you enter a even number?

And a square?

What is the highest factorable value? (Shor)

What is the highest searchable value? (Grover)

What is the maximum number of Qubits allowed? Why?

QCL intro

9 / 30

Getting Started

QCL Code

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

10 / 30

Getting Started

QCL Code

Use gedit (or your favorite text editor) to open grover.qcl

Identify the types of sub-programs presented in the language

QCL intro

11 / 30

Getting Started

QCL Code

Use gedit (or your favorite text editor) to open grover.qcl

Identify the types of sub-programs presented in the language

What is the difference between them? (procedure, operator, qufunct)

QCL intro

11 / 30

Getting Started

QCL Code

Use gedit (or your favorite text editor) to open grover.qcl

Identify the types of sub-programs presented in the language

What is the difference between them? (procedure, operator, qufunct)

routine type program state machine state recursion

procedure

all

all

yes

operator

none

unitary

no

qufunct

none

pseudo-classic

no

functions

none

none

yes

QCL intro

11 / 30

Getting Started

QCL Code

Use gedit (or your favorite text editor) to open grover.qcl

Identify the types of sub-programs presented in the language

What is the difference between them? (procedure, operator, qufunct)

routine type program state machine state recursion

procedure

all

all

yes

operator

none

unitary

no

qufunct

none

pseudo-classic

no

functions

none

none

yes

Operator O : A Op A

qufunc: F : |xi|0i |xi|f (x)i

Can you identify basic quantum ports in the code?

QCL intro

11 / 30

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

12 / 30

First Examples

QCL

First, we will type commands direct on the shell

The idea is to understand how the simulator works before going to

batch mode

QCL intro

13 / 30

Measurement

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

14 / 30

Measurement

Measurement

qureg a[1];

declare qubit a

reset;

measure a;

make a measure on a

QCL intro

15 / 30

Measurement

reset;

H(a);

measure a;

What is the output? Is this deterministic? (try re-typing this three

commands some times).

QCL intro

16 / 30

Entanglement

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

17 / 30

Entanglement

Simple Entanglement

qureg a[1];

qureg b[1];

reset;

H(a);

CNot(b,a);

flip b if a is |1i

Make a final measure on a, what happen to b?

Repeat the commands H, CNot and measure.

QCL intro

18 / 30

Entanglement

Bell states

reset;

Not(a);

CNot(b,a);

This is the

states?

| i

flip b if a is |1i

QCL intro

19 / 30

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

20 / 30

A simple script

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

21 / 30

A simple script

A simple script

environment:

Create a script.qcl file (gedit script.qcl &), containing:

include shor.qcl;

shor(15);

Now save, open the qcl environment, and call include teste.qcl.

QCL intro

22 / 30

A simple script

A simple procedure

Now we will use the procedure feature:

Create a procedure.qcl file, containing:

include shor.qcl;

procedure callShor(int x){

shor(x);

}

Now save, open the qcl environment, and call include procedure.qcl.

You will have to call callShor(15) to run the script.

QCL intro

23 / 30

Toffoli Gate

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

24 / 30

Toffoli Gate

We will use the operator feature to create a Toffoli gate, which will flip a

qubit if the other two are 1:

Create a toffoli.qcl file, containing:

operator toffoli(qureg q) {

if q[0] and q[1] { Not(q[2]); };

}

QCL intro

25 / 30

Toffoli Gate

We will use the operator feature to create a Toffoli gate, which will flip a

qubit if the other two are 1:

Create a toffoli.qcl file, containing:

operator toffoli(qureg q) {

if q[0] and q[1] { Not(q[2]); };

}

To test, open qcl and type:

include toffoli.qcl;

qureg q[3];

reset;

toffoli(q);

QCL intro

25 / 30

Toffoli Gate

Not(q[0]);

toffoli(q);

QCL intro

26 / 30

Toffoli Gate

Not(q[0]);

toffoli(q);

Result should be 1. Finally, try

Not(q[1]);

toffoli(q);

QCL intro

26 / 30

Toffoli Gate

Not(q[0]);

toffoli(q);

Result should be 1. Finally, try

Not(q[1]);

toffoli(q);

Result should be 7.

QCL intro

26 / 30

More on syntax

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

27 / 30

More on syntax

Table of Contents

1

Installation

Getting Started

Simple examples

Simulation Limits

QCL Code

Measurement

Entanglement

A simple script

Toffoli Gate

More on syntax

Some helpful structures

QCL intro

28 / 30

More on syntax

Conditional:

if a and (b or c) { do something }

else { do something else };

For loop:

for i=1 to N { do something }

While loop:

{ do something } until (some condition);

Do and undo transform:

H(a); !H(a);

Length of qureg a:

#a

Rafael Trapani Possignolo (SEMBEI)

QCL intro

29 / 30

More on syntax

QCL intro

30 / 30

- Migrating+from+C+to+CppUploaded byCsit secondshem
- RapidUploaded byAngelica Varo
- End_routine_to_get_data_from_TVARVC_TABLE.pdfUploaded byRajeshvaramana Venkataramana
- The quantum-to-classical transition: Bohr’s doctrine of classical concepts, emergent classicality, and decoherenceUploaded byclaudio_cagioni
- Pricing Configuration is Same for Regular Sales OrderUploaded bysomu_suresh5362
- SAC TutorialUploaded byvelkus2013
- Chinese Physicists Measure Speed of EinsteinUploaded bysdio06
- MS. Excell VBA-#16, July 24, 2013.pdfUploaded byJogi Oscar Sinaga
- berrada.pdfUploaded byAnonymous Nzf9XA
- XII-CompSc1..docUploaded byShreyas Choudhary
- lapackeUploaded byMario Zamora
- sichelman_abstract.pdfUploaded bycyclopssteel
- Zorro ManualUploaded byJose Paez Serrano
- 1110.4108.pdfUploaded byShweta Sridhar
- Grynberg, photodetectorsUploaded byhellhawk123
- Chapter 566566Uploaded byOscar Rivera Zayas
- 1 Block Models and Rough Open PitsUploaded bymapyk
- basicsCC++1.pdfUploaded byHemanth Rao
- Recursion in CUploaded bySerban Petrescu
- Midterm1 Study GuideUploaded byTony Le
- informaticainterviewquestionanswerscollection-140220034738-phpapp01.pdfUploaded byAjay Singh
- Science and AestheticsUploaded byrobertogermano
- FortranUploaded bysheetal
- EssayUploaded bySushmita Sharma
- Function in C++Uploaded byAkshaysuresh
- Function 1Uploaded bysweetu.m
- LAB_6aUploaded byNazirul Hafiz Zainal
- Alerton_Programmers Guide and Reference for BACtalk SystemsUploaded byggr1977
- Game Gems 2.pdfUploaded byFrancisco Reyes Valente
- SQL CommandsUploaded bykeuliseutin

- Introduction to Coding Quantum Algorithms A Tutorial Series Using Qiskit.pdfUploaded byivi
- Quantum simulation of negative hydrogen ion using variational quantum eigensolver on IBM quantum computer.pdfUploaded byivi
- Quantum Computer With Cold Ions in the Aubry Pinned PhaseUploaded byivi
- Quantum Electronic Circuit Simulation of Generalized Sine-Gordon ModelsUploaded byivi
- Quantifying the Magic of Quantum ChannelsUploaded byivi
- Quantifying the Magic of Quantum ChannelsUploaded byivi
- Universal Variational Quantum ComputationUploaded byivi
- Quantum Simulation of Negative Hydrogen Ion Using Variational Quantum Eigensolver on IBM Quantum ComputerUploaded byivi
- Efficient Classical Simulation of Clifford Circuits With Nonstabilizer Input StatesUploaded byivi
- Thermodynamic Studies of Different Black Holes With Modifications of EntropyUploaded byivi
- Time-Domain Multiplexed 2-Dimensional Cluster State.pdfUploaded byivi
- Homomorphic Encryption of Linear Optics Quantum Computation on Almost Arbitrary States of Light With Asymptotically Perfect SecurityUploaded byivi
- Post-Quantum Cryptographic Hardware PrimitivesUploaded byivi
- Uniting the wave and the particle in quantum mechanics.pdfUploaded byivi
- Enhancing the Efficiency of Adiabatic Quantum ComputationsUploaded byivi
- Topology by Dissipation Transport PropertiesUploaded byivi
- Opportunities for Nuclear Physics & Quantum Information ScienceUploaded byivi
- Demonstration of Nonstoquastic Hamiltonian in Coupled Superconducting Flux QubitsUploaded byivi
- Finding spin-glass ground states using quantum walks.pdfUploaded byivi
- A Method to Calculate Correlation for Density Functional Theory on a Quantum ProcessorUploaded byivi
- Decoding Quantum Errors With Subspace ExpansionsUploaded byivi
- Control Electronics for Semiconductor Spin QubitsUploaded byivi
- Universal Variational Quantum ComputationUploaded byivi
- Quantum phases and topological properties of interacting fermions in one-dimensional superlattices.pdfUploaded byivi
- A Quantum Algorithm for Solving Systems of Nonlinear Algebraic EquationsUploaded byivi
- Observation of Dressed States of Distant Atoms With Delocalized Photons InUploaded byivi
- Adiabatic Quantum Dynamics Under Decoherence in a Controllable Trapped-ion SetupUploaded byivi
- Introduction to Coding Quantum Algorithms.pdfUploaded byivi
- Quantum kinetic perturbation theory for near-integrable spin chains with weak long-range interactions.pdfUploaded byivi
- Dissipation-Assisted Matrix Product FactorizationUploaded byivi

- Light Cyber - Advanced Threat Protection Solution Delivering Easy-to-use and Scalable Cyber SecurityUploaded byIxia
- BootCampUploaded byNishant Kr
- Homework 3Uploaded byPhan Anh Trịnh
- APIIT AIS L01 IntroductionUploaded byYugaprashanthan Navaratnam
- RIPUploaded byMustafa Ezzi
- Detail Lab GuideUploaded byTuPro Fessional
- Car Collection for SaleUploaded byWay2Tutorials
- OBIA_Tutorial-OBIA Tutorial V1 - Slides OnlyUploaded bymlgovardhan
- How to Enable Hyper-V for the Windows Phone EmulatorUploaded byPrashant Mohite
- cryptographyUploaded bySushobhan Das
- Radio Buttons in the Output of an ALVUploaded byAnonymous pgde6dmLX
- 08A40gsCASSymbolicDifferentiation (1)Uploaded byMarina Del Pilar Castillo Barces
- mathlab activityUploaded byMuhammad Saad
- Cicode reference - manual for beginners .pdfUploaded byBabak
- Ma5600 Multi Service Access Module Operation and MaintenanceUploaded byWellington Espinoza
- Lesson_05.pdfUploaded byThilan Nawagamuwa
- AdutilitiesUploaded byMadhu Raju
- .NET Performance Testing and Optimization The Complete Guide Paul Glavich and Chris FarrellUploaded byjoinsaad
- NGN_FG-book_IIUploaded byJyoti Rajput Pawar
- ACI UtilityUploaded bySheky Harold
- 3d Password for More Secure AuthenticationUploaded byManju Rose Dwarai
- mikrobootloader_usb_manual_v100.pdfUploaded byCatalin Pancescu
- Blog Bpwalters ComUploaded bySanjeev Saxena
- Green FootUploaded byjaimedarua
- Lesson2-5DistributedMemorySorting.pdfUploaded byProjectlouis
- M.tech. (Digital Systems & Signal Processing)Uploaded byAli Maarouf
- A Brief Introduction of Resource Management Techniques in Cloud Computing EnvironmentUploaded byEditor IJRITCC
- Computer Worm ClassificationUploaded byijcsis
- HCI_IEC60870-5-104_enUploaded byThirumal
- c 04111362Uploaded byArdhian Eka P