Elementarizing quantum algorithms: clarification of the internal structure and preliminary learning outcomes

Introducing elements of quantum information and computation in the secondary school curriculum is a trend which has very recently emerged in physics education. In this paper we describe a tentative elementarization scheme for the information processing phase of quantum algorithms, and report on a preliminary evaluation of its feasibility on Italian self-selected secondary school students in distance learning. While the test was conducted on a very small sample in special conditions, this work of clarification promoted a consistent understanding of the algorithmic structure in informational terms and, at least partially, in physical ones. The feasibility test had for us a positive outcome, which led to refinements of the approach and further tests, also on curricular teaching, which were performed from 2022 onwards.


Introduction
While research on teaching quantum mechanics is a well established sub-field of physics education, the introduction of elements of quantum information and computation at secondary school level is a trend which has emerged in the last five years.With the rise of worldwide interest on new technological applications based on the manipulation of individual quantum systems and the launch of far-reaching educational programmes (e.g., [1,2]), teaching quantum technologies has become an ambitious goal not only at advanced university level, but also in secondary school.For what concerns the latter, the design of research-based curricular materials is focusing mainly on quantum computing and information (e.g., [3,4]), which can be addressed with mathematical tools (e.g., vector algebra and linear transformations) that are available at school level.
Given the richness of the content and the novelty of the research area, most efforts have been devoted to the conversion of science content structure into content structure for instruction.Satanassi et al. [4], for instance, identify as a basic principle of design the reconceptualization of the three main phases of foundational experiments (preparation of a state -transformation of the state -measurement) in terms of computation (input information -processing -output information).
While we believe that such informational interpretation of quantum processes is educationally productive, we feel there is still work to do in order to clarify the structure of quantum algorithms.In particular, there is a need to establish whether the central phase -information processing -presents in turn an internal structure, and, in such a case, whether its examination can help students build a clear picture of the elements that bestow quantum algorithms their peculiar form and operational advantages, and of the composition of these elements in order to perform a specific task.

Theoretical framework and research question
The development of our design was carried out within the Model of Educational Reconstruction [5], which includes three components: analysis and clarifications of science content; research on teaching and learning; design and evaluation of instruction.The first component is divided into two processes: elementarization, i.e., identifying the entities within a complex domain which may be viewed as elementary features, the composition of which explains the relevant scientific content, and the construction of content structure for instruction.
In the present paper, we do not report on the full analysis of the content structure which comprises the background for an educational reconstruction.This will be a topic for different works.Here we report mainly on: 1. a strategy for elementarizing the information processing phase of quantum algorithms, which we consider a promising educational route; 2. its preliminary evaluation performed in 2021.The main research question for the present work can therefore be stated as follows: does the proposed strategy for the decomposition of the information processing phase of quantum algorithms appear as potentially productive according to data collected in the preliminary feasibility test?
A second design principle of our proposal worth mentioning here is connected to the productive role of multiple representations [6].In our sequence, the action of quantum gates is represented graphically in the state space of polarization states.We found this approach very effective and, in subsequent revisions, emphasized the role of multiple representation by developing a strategy in which all logic gates, circuits, algorithms and protocols introduced in the instructional sequence are converted into the experimental design of their possible realization with optical elements.As further specified in Section 4.3, this latter idea was only sketched in the 2021 version presented in this paper.

The information processing phase as a composition of three processes
Based on the analysis of algorithms that can be proposed to secondary school students (Deutsch and Grover), we suggest to decompose the information processing phase into three sequential processes: (1) the enablement of parallelism by means of a Hadamard gate on the first registers (the first one of two in the case of the Deutsch algorithm) to generate an equal superposition of all the states of the computational basis on which the oracle can act at once; (2) exploiting of the multiplicative structure of composite quantum states in order to transfer the whole information encoded in the oracle function to these registers in the form of a positive or negative sign in front of each basis vector; (3) the activation of interference by means of a network of logic gates to produce the desired state on which measurement can be performed.

Example: the Deutsch algorithm
The Deutsch algorithm is a special case of the Deutsch-Jozsa algorithm, formulated in 1992 [7] and perfectioned in 1998 [8].The goal of the Deutsch-Jozsa algorithm is to determine whether an unknown but constrained function : {0,1}  → {0,1} is constant (its value is either always 0 or always 1, for all input values) or balanced (its output is 0 in exactly half the possible cases, otherwise it is 1).The function  is a priori constrained to be either constant or balanced.The Deutsch algorithm is the special case in which n = 1, which had been treated by David Deutsch already in 1985.
For a classical algorithm, answering the above problem with certainty requires in the worst case 2 −1 + 1 queries to the function .The Deutsch-Jozsa algorithm, however, can find deterministically the correct answer with a single evaluation of  [8].The Deutsch-Jozsa algorithm has high educational value for its simplicity; furthermore, it allows to highlight elementary features of the process of elaboration of information in quantum computation which, we believe, can be transposed with some generality to other algorithms and protocols, and provide a significative scaffolding element for students' understanding of quantum computation.In the rest of this Section, we restrict ourselves to a discussion of the Deutsch algorithm.
The circuit representation of this algorithm is reported in Figure 1.The algorithm uses two qubits (also called registers) initialized in the state | 0 ⟩ = |0⟩|1⟩.In the initial step of the algorithm, both qubits go through Hadamard gates, defined by their action on basis states: In other words, in the usual vector representation in which |0⟩ = � 1 0 �, |1⟩ = � 0 1 �, the Hadamard gate corresponds to the matrix As a consequence, the composite system state at the output of the Hadamard gates becomes This step can be considered as an instance of a first general characteristic of quantum computation processes: we call it the enabling of parallelism, through the construction of an equal-weight superposition of basis states for the first register.
The second stage of the algorithm consists in applying the oracle function, which is defined by the following operation on a generic state |⟩|⟩:   |⟩|⟩ = |⟩| ⊕ ()⟩, where the symbol ⊕ represents binary sum.The action of the oracle transforms the state | 1 ⟩ in Eq. ( 2) to Now, since () can take only the values zero or one, the state of the second register remains unchanged except for a possible minus sign depending on the value of (), which can also be seen as a relative phase between the two components of the first register.In other words, Eq. ( 3) can be rewritten as In this step, a second general feature of quantum algorithms appears, which may be important in their educational presentation: the exploiting of the multiplicative structure of composite quantum states, which allows phases gained by one qubit to be considered indifferently as attached to a different qubit in a product state.
After this stage in the algorithm, the second register is no longer used, while the first one passes through a second Hadamard gate.By inspection of eq. ( 4), one can see that the gate transforms the register value to |0⟩ (up to a global phase) if the function  is constant, to |1⟩ (up to a global phase) if it is balanced.More formally, the state | 3 ⟩ after the Hadamard gate may be written as And this can be regarded as the third important characteristic appearing in the Deutsch algorithm: the activation of interference to suppress, in the measured register, the state components that correspond to incorrect answers.The suppression is not complete for all algorithms: not all quantum algorithms provide a deterministically correct result in the first run (e.g., Shor's algorithm).

Introducing quantum algorithms at the level of secondary school
Here we present the main steps which are followed in our sequence, leading to the introduction of educationally relevant quantum algorithms (Deutsch and Grover).

Prerequisites and preliminaries
Complex numbers are not used in the sequence, since the relevant phase shifts introduced are all of ± and correspond to the application of a minus sign to either one or both the components of a superposition state.Thus, mathematical prerequisites are limited to basic algebra, with some linear algebra (e.g.matrices and vectors) being desirable but not strictly required.Knowledge of Boolean logic, including the truth tables of the most important logic gates, is also desirable (formal instruction on this point in Italian schools has a wide range of variability), and is treated as discussed in Section 4.2.
The course requires no previous background in electromagnetism or light polarization, and only assumes knowledge of basic wave phenomena.

Towards quantum algorithms
The conceptual and mathematical foundations for the optical implementation of quantum information processing are laid in two introductory units: one on quantum mechanics in the context of the linear polarization of the photon, the other on classical and non-classical logic.
For the first purpose, we adopted and revised a teaching/learning sequence presented in Pospiech et al., section 4 [9].The basic features of the quantum description and its mathematical representation in terms of ket vectors emerge in a modelling activity starting with an exploration of the interaction of macroscopic light beams with polarizing filters and calcite crystals followed by the discussion of related quantitative experiments and laws on a purely empirical basis.After examining evidence on the detection and polarization of single light quanta, the development of a photon model of the physical situation takes place within an idealized environment for thought experiments and computer simulations including sources of photons on demand in a known polarization mode, active filters, non-absorbing birefringent crystals, and ideal detectors.Students are led to revise basic terms of classical physics such as physical quantity, measurement, state, vector, superposition, interference (Figure 2), for developing an understanding of their quantum counterparts [10].The unit ends with a discussion of entanglement in the spatial and polarization modes of a single photon after its passage through a crystal, as a conceptual and mathematical basis for addressing the purely quantum entanglement of different systems.Our approach to logic is based on the integration of physics, probability, logic, and -as a resultcomputation into an interdisciplinary perspective.In this unit, students are guided to recognize that GIREP-2022 Journal of Physics: Conference Series 2750 (2024) 012025 propositions associated with classical systems possess the structure of a Boolean algebra, and that this picture intertwines naturally with a classical probabilistic approach [11].After an analysis of the truth tables of logical connectives, classical gates and circuits are introduced and discussed.In the light of the close link established between these mathematical structures and the behaviour of classical systems, and of the awareness acquired in the previous unit that the transition to a quantum picture requires the revision of known concepts of physics, it becomes plausible for students to ask whether and how also concepts of logic need some form of revision.These reflections pave the way for the introduction of a new logic capable of representing the encoding and manipulation of information in a way that is compatible with the structure of quantum mechanics.
A natural basis for constructing the concept of qubit is provided by the work made on photon polarization and its state vector.Some qualitative elements of quantum dynamics are introduced, suggesting students to interpret logic gates as the possible result of physical processes on the photon state of polarization.Various single-qubit gates of our interest (X, H, Z) are introduced, and visualized as axial symmetries of the real state plane (axis of symmetry respectively at 45°, 22,5°, 0°).The possibility to switch between formal and graphical representations of the action of quantum gates on polarization states has proved very useful for promoting student understanding, and has been further emphasized in successive revisions of the sequence as discussed in the following Section.

Example: polarization encoding of qubits
The fundamental tools needed to build polarization-based logic gates by means of materials already familiar from the introductory part of the course (i.e., birefringent crystals) are phase shifting materials.With students, we initially introduce the electromagnetic description of light in an elementary form.Since the direction of the linear polarization of light is identified by the electric field vector, we focus only on the mathematical expression for such quantity.We recall the concepts of global phase, of phase difference and its role in wave interference.Finally, we present students with linear isotropic dielectrics, i.e., for our purpose, phase shifting materials that do not change the direction of the polarization.Since in the course we only work with real numbers, the basic phase shifting device will be a sheet of refractive material such that the refractive index and thickness are chosen to obtain a phase shift of .
At this point, all the conceptual instruments required to build logic gates acting on one polarizationencoded qubit are available.The ideal physical implementation of some example gates is almost immediate.By encoding the horizontal state of polarization of a photon as |0⟩ and the vertical one as |1⟩, we need only a system composed of two calcite analyzers (already considered in the introductory sequence on basic quantum theory) with the addition of a phase shifter in the extraordinary ray to design a Z logic gate, i.e., a symmetry around the horizontal axis (Figure 3).
Actually, this setup can be used for implementing an infinite number of gates.As a matter of fact, by rotating a birefringent crystal around its ordinary axis, we obtain a beam separation on different couples of perpendicular directions of polarization.It follows that every gate which can be described as an axial symmetry of the state plane is realizable in this way (Figure 4).In particular, if the ordinary axis is associated with a polarization angle θ=45°, we obtain a X gate, if θ=22,5°, a Hadamard gate, as already displayed in Figure 2.
As stated in Section 2, the transposition of quantum logic gates into optical devices in the version of the sequence tested in 2021 was only sketched, and provided at the level of a significative example.The element which we mostly emphasized was the possibility to interpret several quantum gates as axial symmetries in the state space for polarization encoded qubits.We did not try to translate each and every quantum circuit we discussed into an optical device, as was instead done in the later version of the sequence, whose experimentation started in 2022.In fact, building on the experience of this trial, we subsequently devised a semi-general translation strategy from quantum circuits to optical devices, where one qubit is coded as the polarization state, and the other as the spatial state ("which-way" information), which we believe can further exploit the educational value of multiple representations, allowing students to switch between logical and physical representations of the same algorithm or protocol.

The Deutsch and Grover algorithms
The final part of the sequence is devoted to the introduction of the Deutsch and Grover algorithms.Both algorithms are discussed starting from the statement of the problem and, in the case of the Deutsch algorithm, with a direct comparison with the structure of a classical algorithm designed to solve the same problem.The three key subprocesses of the information processing phase discussed in Section 3 are emphasized for both algorithms.The quantum circuit for Grover's algorithm is displayed in Figure 5, while the one for Deutsch algorithm was displayed in Figure 1.

The preliminary test
In this section, we discuss some results obtained from the analysis of the worksheets and the final test of a preliminary teaching experiment with secondary school students conducted with our approach.

The context
The intervention was performed with 8 self-selected 18 and 19-year-old students from the liceo classico (2) and liceo scientifico (6), both belonging to the institute Galilei-Grattoni of Voghera, Italy.In the Italian educational system, liceo classico and liceo scientifico are types of schools typically attended by students who intend to continue their studies in university; liceo classico is more oriented towards literacy and human sciences while liceo scientifico is more focused on STEM disciplines.The instructors of the course were two researchers in physics education.The experiment lasted from November 2020 to May 2021 for a total of about 25 hours in distance learning.The circuit is correctly analyzed in both Dirac notation and using matrices and vectors.Each operation performed on the individual registers (separable states) is visualized as a geometric transformation in state space.The student performs a consistent transition to considering a composite system rather than two separate subsystems (apart from an inaccuracy in point 3, where he does not refer to the pair of bits (1,1) but improperly to only 1).The answer attests the student's ability to both formally manipulate algebraic tools, and connect them to other relevant forms of representation.

GIREP-2022 Journal of Physics: Conference Series 2750 (2024) 012025
Data were collected from worksheets assigned to students during the lessons and from a final test composed of open questions concerning aspects of quantum information and computation.Seven students participated to the final test.

Understanding of different representations of quantum logic circuits
One of the worksheets we assigned to students consisted in a series of items probing the capabilities of students in a) translating circuit diagrams into Dirac and matrix notations, and using such notations to perform actual calculations; b) connecting the operations performed by logic gates to the graphical representation of quantum states; c) connecting the formal expression of a state to the probabilities of measurement outcomes.The text of the worksheet and an example of answer are reported in Figure 6.
The work made for the construction of the qubit concept starting from polarization, and the subsequent interpretation of logic gates as axial symmetries in the state space seems to have been well understood by almost all students.
Furthermore, the 6 students from liceo scientifico also solved, for the most part correctly, more demanding questions in terms of mathematical manipulations (mostly sub-item 4), while students of liceo classico displayed difficulties in this sense, presumably due to their more limited mathematical background.

Qualitative/conceptual understanding of quantum algorithms
In the final test, we preferred to design questions that would allow us to evaluate whether the students had understood the conceptual aspects of the proposed topics, leaving the elements of pure algebraic calculation as optional.Here we report one of the two items related to the third design principle, the decomposition of quantum algorithms into three fundamental processes.To understand whether the proposed approach had supported the conceptual understanding of the Deutsch algorithm, we proposed the following open response item: Use Deutsch algorithm to introduce the main elements of quantum algorithms: quantum parallelism, the role of the operator on target [register 1] and ancilla [register 2], interference and measurement.For each of these elements, identify the parts of the circuit that represent them and identify which aspects of quantum physics are involved.(If you think it is necessary, carry out some calculations).
We conducted a qualitative analysis of the answers to the final test aimed at determining whether the division in subprocesses we provided students with had been productive for their learning.An example of these answers is reported in Figure 7.

Data collection
All students were able to correctly highlight, in the circuit representation of Deutsch algorithm, the portions of circuit corresponding to each of the three significant subprocesses (the enabling of quantum parallelism, the transfer of information of the oracle from the second register to the first one, the final selection of the result).All students also identified, at least partially, the links between each subprocess and individual features of quantum physical behavior and description, such as quantum superposition, the multiplicative structure of quantum composite systems which allows a phase factor to be considered related indifferently to the first register (carrying information) or to the second one (auxiliary qubit), quantum interference.Some students supported their reasoning with explicit calculations, but only as a complement to the considerations made earlier, so that they do not seem to rely solely on mathematics for sense-making.
In Table 1, we have included some answers given by the students to show which answers were considered complete -the link between the computational aspect and systems physics is correct and clear -and which were partial, with the computational aspect being the only one present.By examining students' answers, we can conclude that the elementarization we performed of the internal transformations from input to output within a quantum algorithm was, in the small and privileged setting of this first experimentation, successful in scaffolding students' learning process and providing a general framework to imbue such transformations with conceptual meaning.
The numerous limitations of this preliminary trial (very small sample, composed of self-selected students, in distance learning) do not allow to draw any conclusion on the effectiveness of the approach for curricular teaching.Nevertheless, some of the results obtained do appear encouraging.However, there were also some critical elements to take into account for future implementations.For example, a number of items of the worksheets were meant to be resolved by calculation, but also asked to explain the procedure used and the results.However, students either ignored the request for a comment, or input of the first register.|⟩ = target; |⟩ = ancilla" (yellow); "The H gate produces interference on the qubits, eliminating the superposition" (green) "Thus, measurement will have a certain outcome" (magenta) answered with extremely concise remarks.This phenomenon was very general, and among the factors which prompted us to insert, in the final test, items focusing on discursive analysis, in which mathematics was optional.In subsequent experimentations started in 2022 we introduced corrections aimed at improving the quality of students' argumentation about quantum computing, among which: • Structured worksheets for the most significant activities, including inquiry-based and modelling tasks, in which students are required to produce extended written analyses and explanations, in such a way to activate and stimulate their expressive abilities; • Groupwork activities, based on laboratory experiences on the optical bench aimed at providing an experimental analogue of the behaviour of quantum gates with classical polarized light.

Conclusions and current directions
We have presented the outline of a course on quantum technologies for high school whose design principles are strongly rooted in the model of educational reconstruction.In particular, we believe that the most innovative and potentially fruitful characteristics of our approach is the elementarization of the information processing phase of quantum algorithms, which we organized into three separate subprocesses, each calling into play relevant properties of quantum systems.Furthermore, the introduction of quantum logic gates with optical devices, first adopted in this study, has shown great potential and deserved subsequent development.
We reported on a preliminary test performed in very special conditions, which while not allowing us to draw any definitive conclusion, still highlighted both encouraging elements and possible criticalities which needed to be taken into account.The next step, which started in late spring 2022, was to perform tests of a revised version of our proposal both in curricular teaching, guided by class teachers, in presence; and in out of school settings, such as vocational initiatives, guided by educational researchers.The revised version includes several innovative elements, including the complete transposition of pedagogically relevant quantum logic circuits, algorithms and protocols to a physical realization with optical devices, as discussed in Section 4.3, and the methodological improvements and additions discussed in Section 5.3.From the parallel work on teacher professional development which we conducted in the past two years [12], we were able to form a small group of teachers motivated to didactic innovation, which allowed us to perform the crucial transition to trials in curricular teaching.These new trials were performed on substantially larger samples, producing a large amount of new data, for which we are now in the process of finalizing qualitative and quantitative analysis finalized to collect indications for further revisions of the educational sequence.

Figure 1 .
Figure 1.Quantum circuit of the Deutsch's algorithm.Squares labelled with H represent Hadamard gates, while   is the "oracle" for the unknown function f (see text).The symbol ⊕ represents sum modulo 2.

Figure 2 .
Figure 2. Interference: for a and b both real (allowing us to use a notation with only ket vectors in scalar products) we compute the probability that a photon prepared in the polarization state |⟩ passes through the filter with axis at , thus changing its state to |⟩, to be collected by the detector.Such probability is equal to the probability that the photon reaches the detector after passing through the crystals when only the 0° path is open, i.e. (|0°⟩ • |⟩) 2 plus the probability that it reaches the detector after passing through the crystals when only the 90° path is open, i.e. (|90°⟩ • |⟩) 2 plus an interference term: (|°⟩ • |⟩) (|°⟩ • |⟩).

Figure 3 .
Figure 3. Idealized design of a Z gate on a polarization-encoded qubit.The gate is designed using calcite analyzers which are familiar to students from the initial introduction to QM [9].

Figure 4 .
Figure 4. Generic gate describable as an axial symmetry on the state plane.Different quantum gates can be obtained for different values of the θ angle.

Figure 5 .
Figure 5.Quantum circuit of the Grover algorithm.All the gates represented can be obtained using the setup in Figure 4.

Figure 6 .
Figure 6.Example of an exercise on the computation of a logic circuit and of its solution proposed by a student.The circuit is correctly analyzed in both Dirac notation and using matrices and vectors.Each operation performed on the individual registers (separable states) is visualized as a geometric transformation in state space.The student performs a consistent transition to considering a composite system rather than two separate subsystems (apart from an inaccuracy in point 3, where he does not refer to the pair of bits (1,1) but improperly to only 1).The answer attests the student's ability to both formally manipulate algebraic tools, and connect them to other relevant forms of representation.

Figure 7 .
Figure 7. Part of the answer of one of the students to the item discussed in Section 5.3.Student's writing in different colours (in the original) can be translated as follows: "H gates produce the superposition state necessary to exploit quantum parallelism" (cyan); "The unitary operator, thanks to quantum parallelism, can act simultaneously on both qubits |0⟩ and |1⟩.It performs a binary sum between the value |⟩ at the input of the second register and f(x), in other terms, the result of the transformation of the value |⟩ at the

Table 1 .
Classification of some answers to the final test question on the Deutsch algorithm.The numbers in parentheses refer to students' answers in the final test in each category (N=7)