Problem Statement
You are given integers n, m, L, S0, S1, ⋯, Sn−1 and a real number θ.
For an integer x=x0+21x1+⋯2n−1xn−1 (xi∈{0,1}) where 0≤x<2n, define the function f(x) by
f(x)=S0x0+S1x1+⋯+Sn−1xn−1.
Implement the (n+m)-qubit oracle O acting on computational basis states as
∣x⟩n∣0⟩mO{eiθ∣x⟩n∣0⟩meiθ∣x⟩n∣0⟩mf(x)=L (mod 2m)f(x)=L (mod 2m)
for any integer x such that 0≤x<2n.
Constraints
- 1≤n,m≤9
- n+m≤10
- 0≤L<2m
- 0≤Sk<2m
- 0≤θ<2π
- The circuit depth must not exceed 100.
- Integers are encoded by little-endian notation, i.e., ∣100⟩=1=∣001⟩.
- Changes in the global phase are ignored.
- The submitted code must follow the specified format: