Fundamentally, quantum computing is different from classical computing because of the physical laws working "under the hood" of the computer. To understand quantum computing in this light, it's useful to treat nature as a sort of black box. It takes an initial state of a system as an input, performs changes on it governed by physical laws, and outputs experimental data (aka measurements) at the end. We can try to infer the laws of nature by looking at the pattern of input states and output measurements.
Let's start with a simple deterministic warm-up example, where the same input always leads to the same output.
In the code box below, you can print the result of applying the box to
an arbitrary list of bits (zeros or ones) using secret_box(bits)
. Here are some examples:
secret_box([0,1,0,1,1]) = [1,0,1,1,0] secret_box([1,1,0,0,1,0,1]) = [1,0,0,1,0,1,1]
Do you think you know what the patern is? You can generate more examples using the provided code. Once you are sure,
complete the deterministic_box
function that implements the secret deterministic rule.
The output of your deterministic_box
fuction must have the same length as the input.
To interact with codercises, please switch to a larger screen size.
Learning Objectives: