CPSC 489/689 Quantum Algorithms Problem Set 5, Assignments of Computer Science

Information about problem set 5 for the cpsc 489/689 quantum algorithms course taught by andreas klappenecker. The assignment is due on march 4, 2003, and students are required to demonstrate their program between 2pm–5pm to neelima chinthamani in hrbb 509a. Instructions on how to replace certain functions, package the program using the gnu build system, and rename specific output files. Hints are also provided for renaming the outputs of flex and yacc. The document mentions the alfred language and its specification of gate conditions and their corresponding bit masks.

Typology: Assignments

Pre 2010

Uploaded on 02/13/2009

koofers-user-d5l
koofers-user-d5l 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Problem Set 5
CPSC 489/689 Quantum Algorithms
Andreas Klappenecker
The assignment is due Wednesday, Mar 4, 2003.
Demonstrate your program between 2pm–5pm
to Neelima Chinthamani in HRBB 509A
Replace the two functions applygate and measure state with sensible code,
completing the simulator alfred.
Package the program with the GNU build system. Write configure.in and
Makefile.am, and package the program such that it is possible to obtain an
executable by invoking configure and make.
Hints: The GNU automake manual is somewhat misleading in the re-naming
conventions of the lex and yacc outputs.
The standard output of flex alfred.l are the files yy.tab.c and yy.tab.h,
which are re-named to alfred.c and alfred.h, respectively.
The standard output of yacc -d alfred.y, or its bison equivalent, are
the files y.tab.c and y.tab.h, which are renamed to alfred-alfred.c
and alfred-alfred.h, respectively. Consequently, you want to include
the file alfred-alfred.h instead of y.tab.h in the scanner file alfred.l.
The file Makefile.am can contain as little as four lines, specifying the program,
the sources, the libraries, and the options for yacc (alfred YFLAGS = -d). You
do not need to specify any dependencies!
Make sure that your program will compile if we delete the output of lex and
yacc (or flex and bison), before invoking make.
The alfred language specifies the gate
by G([3,-1,-2],0,[0,1,1,0]), where the most significant qubit at position
3 is a 1-condition, and the 0-conditions of the qubits at position 1 and 2 are
specified by 1 and 2. The lexer will translate these conditions into the
following bit masks
ocnd = 01102= 6,icnd = 10002= 8,gpos = 00012= 1.

Partial preview of the text

Download CPSC 489/689 Quantum Algorithms Problem Set 5 and more Assignments Computer Science in PDF only on Docsity!

Problem Set 5 CPSC 489/689 Quantum Algorithms Andreas Klappenecker

The assignment is due Wednesday, Mar 4, 2003. Demonstrate your program between 2pm–5pm to Neelima Chinthamani in HRBB 509A

Replace the two functions applygate and measure state with sensible code, completing the simulator alfred.

Package the program with the GNU build system. Write configure.in and Makefile.am, and package the program such that it is possible to obtain an executable by invoking configure and make.

Hints: The GNU automake manual is somewhat misleading in the re-naming conventions of the lex and yacc outputs.

  • The standard output of flex alfred.l are the files yy.tab.c and yy.tab.h, which are re-named to alfred.c and alfred.h, respectively.
  • The standard output of yacc -d alfred.y, or its bison equivalent, are the files y.tab.c and y.tab.h, which are renamed to alfred-alfred.c and alfred-alfred.h, respectively. Consequently, you want to include the file alfred-alfred.h instead of y.tab.h in the scanner file alfred.l.

The file Makefile.am can contain as little as four lines, specifying the program, the sources, the libraries, and the options for yacc (alfred YFLAGS = -d). You do not need to specify any dependencies!

Make sure that your program will compile if we delete the output of lex and yacc (or flex and bison), before invoking make. The alfred language specifies the gate

by G([3,-1,-2],0,[0,1,1,0]), where the most significant qubit at position 3 is a 1-condition, and the 0-conditions of the qubits at position 1 and 2 are specified by −1 and −2. The lexer will translate these conditions into the following bit masks

ocnd = 0110 2 = 6, icnd = 1000 2 = 8, gpos = 0001 2 = 1.