QGRAPHICS: QUANTUM SEARCHING FOR RAY TRIANGLE INTERSECTION
Carolina AlvesIntegrated Master in Physics Engineering
Q Days, April 2019University of Minho, HASLab
Ray Tracing
■ Calculates the color of pixelsby tracing the path that light wouldtake through a virtual 3D scenewhich is described by a collection ofgeometric primitives (e.g.,triangles).
■ The algorithm returns, for a givenray, which triangle it intersectscloser to its origin.
2
The problem
■ Determine which rays intersect ageometric primitive.
■ For simplification the primitives willbe 1D and perpendicular to therays.
■ A higher dimensional approachwould require a large number ofqubits/gates because of the greatamount of calculations needed.
primitives
rays
light source
3
Classical Algorithm
for each ray{
intersect with primitives{
if intersect continue to next ray;
}
}
■ Complexity: O(R*P)
■ Note: The primitives can be ordered,resulting in a O(R*log(P)) complexityalthough it requires a setup timeand more memory.
4
Can we gain in complexity with a quantum strategy?
■ Finding an intersection is asearch algorithm so we’ll useGrover’s Algorithm in ourproblem.
5
https://slideplayer.com/slide/5346108/
Two Approaches
– Superposition of the rays
– Superposition of the primitives
6
Superposition of the rays
7
H
H
H
Superposition of the rays
8
H
H
H
i from 0 to P-1
Superposition of the rays
9
H
H
H
i from 0 to P-1
Superposition of the rays
10
H
H
H
Repeat x times
i from 0 to P-1
Superposition of the rays
■ If we measure the control bit as 1 it is necessary to repeat the circuit without thatray from the superposition so we don’t measure it again.
■ Complexity: O R ∗ ##%&'%
11
Superposition of the primitives
12
H
H
Superposition of the primitives
13
H
H
Superposition of the primitives
14
H
H
Superposition of the primitives
15
H
H
Superposition of the primitives
16
H
H
Repeat y times
Superposition of the primitives
■ Number of solutions: 0 or 1
■ Complexity: O(R*√P)
■ Quadratic gain over the classical algorithm
17
S. RAYS
■ Multiple solutions
■ O R ∗ ##%&'%
■ Only 1 solution (or 0)
■ O(R*√P)
S. PRIMITIVES
Comparison
18
Future Work
■ Expand the geometricconfiguration:
– Rays on a plane– More complex primitives (2Dprimitives, inclined orintersecting primitives)
19
Future Work
■ Expand the geometricconfiguration:
– Rays on a plane– More complex primitives (2Dprimitives, inclined orintersecting primitives)
– Non-parallel raysDepends on the capacity of thequantum machine to performcalculations.
20
Future Work
■ Change the problem to:– For each ray, what is the
geometric primitive closest to the origin of the ray?
■ Error tolerance – real machine:– Quantum error correction
21
QGRAPHICS: QUANTUM SEARCHING FOR RAY TRIANGLE INTERSECTION
Carolina AlvesIntegrated Master in Physics Engineering
Q Days, April 2019University of Minho, HASLab