You are expected to complete this assignment individually. If you need help, you are invited to come to office hours and/or ask questions on Canvas. Clarification questions about the assignments may be asked publicly. Once you have specific bugs related to your code, make the posts private.
In this lab, we are adding the functionality to perform arbitrary operations on multiple qubits using matrix multiplication. In addition, we need to be able to combine a two single qubits into a two-qubit entity.
We would like to have some consistency between how we treat qubits, regardless of the width. The way we'll do this is practice with the concrete one- and two-qubit cases, then create a n-qubit class. All three of these classes will have distinct similarities, which we will define in a general Qubit class from which they will all inherit. This week, we'll do the one- and two-qubit options. Next week, we'll generalize to n-qubit.
If you want to add "helper" functions that aren't specified in the assignment, you are welcome to do so. If you want it to be used by all classes, place it in the parent class. If it is specific to a subclass, place it there. We will only test the functions specified, but you're always allowed to add private or protected methods.
You should submit several files for this assignment ( ParentQubit.java SingleQubit.java, DoubleQubit.java, TestQubits.java and Makefile) in your subversion repository as directed below.
This continues to refine and advance your quantum simulator. You began by viewing qubits like the visual representation, and you will need to make a transition to the mathematical representation. While it is possible in this lab to mostly stay with the original representation, there are a few methods that are very difficult to implement that way. So I would suggest making the transition to the vector / matrix representation now if you can. You definitely will need to next week, so you might as well now.
Make sure you add to your Makefile as you complete classes.
Now you need to make the skeleton code so that your program will minimally execute. You must do this in case you do not complete your assignment. Our testing infrastructure needs to compile and execute even if you did not complete the entire assignment.
public class Blah { public double surface_area_cylinder(double height, double radius) { return 0.0; } }
public static void main(String[] args) { Blah b = new Blah(); b.surface_area_cylinder(1.0, 5.0); // add the rest of the method calls here }
The next step is to implement DoubleQubit. Now you will implement this methods when you ahve two qubits.