Hands-on lab · 1 step
Angle-encode a two-feature datum
Write the angle-encoding feature map for a datum as a circuit that uses the data symbols , so that it works for every datum. The grader re-binds the symbols to three data points and checks and on both qubits.
Step 1: Encode x = (x0, x1) with one R_Y per qubit
The circuit declares two non-trainable data symbols and (parameters named x0 and x1). Build the angle-encoding feature map
with one per qubit: qubit is rotated by the symbol x0 and qubit by the symbol x1. Use the symbols as the gate angles, not numbers: the circuit must be a function of the datum.
How it is graded. The grader substitutes the three data points for the symbols, runs your circuit for each, and compares, with absolute tolerance :
- check z: and ;
- check x: and .
For example, at the first datum the targets are and . Only , , are available, at most two gates and no two-qubit gates; the parameter list must stay x0, x1 with their values unchanged.