# Optimization of universal quantum gates with higher-dimensional spaces

### Submission summary

 As Contributors: Hai-Rui Wei Preprint link: scipost_202106_00005v1 Date submitted: 2021-06-03 15:00 Submitted by: Wei, Hai-Rui Submitted to: SciPost Physics Academic field: Physics Specialties: Quantum Physics Approaches: Theoretical, Computational

### Abstract

Minimizing the number of necessary two-qubit gates is an important task in quantum information processing. By introducing non-computational quantum states, we construct effective circuits for the controlled-NOT (CNOT) gate and the n-qubit Toffoli gate with (2n-3) qubit-qudit gates and (2n-4) single-qudit gates. The cost of a three-qubit Toffoli gate is reduced from the minimum limit of five two-qubit gates to three nearest-neighbor qubit-qudit gates. By operating with the spatial-mode degree of freedom, polarization CNOT and Toffoli gates are designed with linear optics. Our optical schemes can be achieved with a higher success probability and no extra auxiliary photons are needed in the scheme.

###### Current status:
Has been resubmitted

### Submission & Refereeing History

Resubmission 2105.10631v2 on 20 July 2021

Submission scipost_202106_00005v1 on 3 June 2021

## Reports on this Submission

### Strengths

- The PSWAP based Toffoli gate implemented in an optical system using three photons has a higher success probability than previous results

### Weaknesses

- The reduction of quantum operations is not well presented and is not new
- The implementation of the optical Toffoli gate has to be clarified

### Report

The authors constructed P-SWAP based CNOT and Toffoli multi qubit gates by increasing the dimension of the system using qudits. The qudits allow to reduce the complexity of the circuit by using non computational states, i.e. unpopulated states at the beginning and the end of the process. The authors provide a protocol to implement a Toffoli gate on an optical setup, leading to a better success probability than in [19] and [51].

I agree with the computations of Sec. 2. However, the authors must clarify their definition of a n-qubit toffoli gate and correct the paper accordingly. In the three-qubit Toffoli gate presented on Fig. 3, n=3 takes in account the target qubit $t$ while in Fig. 3, $n$ denotes the number of controlled qubits only, as it should be for a fair comparison with [19].
One can check easily that with this latter definition, the n-Toffoli gate is performed with $(2n-1)$ qubit-qudit and $(2n-2)$ single qudit gates, and not $(2n-3)$ and $(2n-4)$ as claimed by the authors in the abstract, the introduction and the conclusion (this latter being true if $n$ includes the target qubit). In Sec. 2.2.2., the authors wrote the right result of $(2n-1)$ and $(2n-2)$ which is not what they claimed in the abstract and the conclusion.

This is not a minor mistake because it involves that the total number of quantum operations is exactly the same as in Ref. [19]. It cannot be presented as a new result. I think the authors should present their Toffoli gate as an alternative of the one in Ref. [19] or to write clearly that the number of gates has not been reduced as compare to [19].
Since the reduction of the number of gates is presented as a result of this work in the abstract, I think the authors should rewrite the article.

I believe that the advantage of this technique is to increase the success probability of the Toffoli gate, which reaches 1/64 instead of 1/72 with no additional photons. However, the implementation of the Toffoli gate is also unclear, as it was raised by the first and the second referee. The obtention of Eq. (27) from Fig. 3 is ambiguous. I agree with the computations of the authors if, starting from the initial state (21), the state collapses in one of Eqs. (17)-(20) after the first P-SWAP gate.
The objections of referees 1 and 2 must be investigated to make sure that no additional problems are involved.
Moreover, following each step between Eqs. (21) and (27), I obtain different global factors:
From Eq. (21), applying HPW${}^{22.5^{\circ}}$ involves a factor $1/\sqrt{2}$. The first P-SWAP gate involving a factor $1/(2\sqrt{2})$, we obtain:
$|\chi_{i,12}>=\left.\left.\frac{1}{4}\right[\alpha_1\left(|H_i>+|V_i>\right)|H_{12}>+\alpha_2\left(|H_i>-|V_i>\right)|H_{12}>+\alpha_3|V_{1'}\left(|H_{12}>+|V_{12}>\right)+\alpha_4|V_{1'}\left(|H_{12}>-|V_{12}>\right)\right],$
that is Eq. (22) with a global factor $1/4$ instead of $1/\sqrt{2}$.
After the second P-SWAP gate, we obtain a $1/{8\sqrt{2}}$ global factor on Eqs. (23) to (26) instead of a $1/\sqrt{2}$, and finally, after the last
HWP${}^{22.5^{\circ}}$ and PBS${_2}$ a factor $1/8$ remains on Eq. (27).

In summary, I think that the paper has to be completely rewritten and must demonstrate clearly that the probability of success is increased by using this method. The problems raised by referees 1 and 2 has to be clarified . The Toffoli gate has to be described as an alternative of the one in Ref. [19], but the reduction of the number of gates cannot be presented as a result of this paper.

### Requested changes

1) Rewrite the paper by describing the gate as an alternative of the one of Ref. [19] with a higher success probability. The reduction of quantum operation cannot be presented as a new result and this number has to be computed rigorously
2) The implementation of the Toffoli gate has to be clarified according to the objections of the first and the second referee

• validity: low
• significance: good
• originality: ok
• clarity: ok
• formatting: good
• grammar: good

### Author:  Hai-Rui Wei  on 2021-07-21

(in reply to Report 3 on 2021-06-29)
Category:

Comment 1: The authors constructed P-SWAP based CNOT and Toffoli multi qubit gates by increasing the dimension of the system using qudits. The qudits allow to reduce the complexity of the circuit by using non computational states, i.e. unpopulated states at the beginning and the end of the process. The authors provide a protocol to implement a Toffoli gate on an optical setup, leading to a better success probability than in [19] and [51].

Reply: We thank Reviewer 3 for reviewing our manuscript and making the comments.

Comment 2: I agree with the computations of Sec. 2. However, the authors must clarify their definition of a $n$-qubit Toffoli gate and correct the paper accordingly. In the three-qubit Toffoli gate presented on Fig. 3, $n$=3 takes in account the target qubittwhile in Fig. 3, “$n$” denotes the number of controlled qubits only, as it should be for a fair comparison with [19]. One can check easily that with this latter definition, the $n$-Toffoli gate is performed with (2$n$−1) qubit-qudit and (2$n$−2) single qudit gates, and not (2$n$−3)and(2$n$−4) as claimed by the authors in the abstract, the introduction and the conclusion (this latter being true if “$n$” includes the target qubit). In Sec. 2.2.2., the authors wrote the right result of(2$n$−1)and(2$n$−2)which is not what they claimed in the abstract and the conclusion.
This is not a minor mistake because it involves that the total number of quantum operations is exactly the same as in Ref. [19]. It cannot be presented as a new result. I think the authors should present their Toffoli gate as an alternative of the one in Ref. [19] or to write clearly that the number of gates has not been reduced as compare to [19].Since the reduction of the number of gates is presented as a result of this work in the abstract, I think the authors should rewrite the article.

Reply: We thank Reviewer 3 for bringing our attention to this issue.

Modification: We have modified it as “$n$-control-qubit Toffoli gate with (2$n$-1) qubit-qudit gates and (2$n$-2) single-qudit gates” in all text.
We also stated our Toffoli gate is an alternative scheme of Refs. [20,21], and compared to [20,21] in terms of required gate number and the success probability. Sentences “Using the same idea as the works in [20, 21], we designed an alternative the quantum circuit to implement the Toffoli gate with a higher success probability based on the P-SWAP gates, which required the same number of qubit-qudit gates as the protocols in Refs. [20,21].” are added. [see line 4 of paragraph 1 in Sec. 4 Discussion]

Comment 3: I believe that the advantage of this technique is to increase the success probability of the Toffoli gate, which reaches 1/64 instead of 1/72 with no additional photons. However, the implementation of the Toffoli gate is also unclear, as it was raised by the first and the second referee. The obtention of Eq. (27) from Fig. 3 is ambiguous. I agree with the computations of the authors if, starting from the initial state (21), the state collapses in one of Eqs. (17)-(20) after the first P-SWAP gate.The objections of referees 1 and 2 must be investigated to make sure that no additional problems are involved.
Moreover, following each step between Eqs. (21) and (27), I obtain different global factors:
From Eq. (21), applying HWP$^{22.5^\circ}$ involves a factor $1/\sqrt{2}$. The first P-SWAP gate involving a factor $1/2\sqrt{2}$, we obtain:
$\begin{eqnarray*} |\chi_{i,12}\rangle = \frac{1}{4}[\alpha_1(|{H_i}\rangle + |{{V_i}} \rangle) |{H_{12}}\rangle + \alpha_2(|{H_i}\rangle - |{{V_i}} \rangle) |{H_{12}}\rangle+\alpha_3|{V_{1'}}\rangle(|{H_{12}}\rangle + |{{V_{12}}} \rangle) +\alpha_4|{V_{1'}}\rangle(|{H_{12}}\rangle - |{{V_{12}}} \rangle)] \end{eqnarray*}$
that is Eq. (22) with a global factor 1/4 instead of $1/\sqrt{2}$. After the second P-SWAP gate, we obtain a $1/8\sqrt{2}$ global factor on Eqs. (23) to (26) instead of a $1/\sqrt{2}$, and finally, after the last HWP$^{22.5^\circ}$ and PBS2 a factor 1/8 remains on Eq. (27).

Reply: We thank Reviewer 3 for bringing our attention to these issues.

Modification:
-We revised and explained the implementation Toffoli gate. [see Eqs. (33)-(45)].
-We added Eq. (17) and modified the implementation of P-SWAP gate. [see Eqs. (11)-(21)]
-We expanded Eq. (27) into (29)-(32), and modified the implementation CNOT gate. [see Eqs. (22)-(32)]
-We have modified our paper according to the comments by referees 1 and 2. [see above Reply and Modification for the Reports by referees 1 and 2]
-We fixed the global factors in Eqs. (23-32). Also, we fixed the global factors in Eqs. (36-45). [see Eqs. (23-32) and (36-45)]

Comment 4: In summary, I think that the paper has to be completely rewritten and must demonstrate clearly that the probability of success is increased by using this method. The problems raised by referees 1 and 2 has to be clarified. The Toffoli gate has to be described as an alternative of the one in Ref. [19], but the reduction of the number of gates cannot be presented as a result of this paper.

Reply: We thank Reviewer 3 for bringing our attention to these issues.

Modification:
-We have rewritten and explained the implementation of P-SWAP, CNOT and Toffoli gates in detail. [see Eqs. (11-45)]
-We demonstrated the probability of success is increased [see Reply and Modification for comment 3 by referee 1].
-We have addressed the problems raised by referees 1 and 2 [see the Reply and Modification for comments by referees 1 and 2]
-We have stated that our Toffoli gate is an alternative of the one in Ref. [20] and compared to [20,21] in terms of required gate number and the success probability. [see line 4 of paragraph 1 in Sec. 4 Discussion]

### Author:  Hai-Rui Wei  on 2021-07-20

(in reply to Report 3 on 2021-06-29)
Category:

Comment 1: The authors constructed P-SWAP based ....
Reply:We thank Reviewer 3 for reviewing our manuscript and making the comments.

Comment 2: I agree with the computations of Sec. 2. ....
Modification: We have modified it as “n-control-qubit Toffoli gate with (2n-1) qubit-qudit gates and (2n-2) single-qudit gates” in all text.
We also stated our Toffoli is an alternative scheme of Refs. [20,21], and compared to [20,21] in terms of required gate number and the success probability.Sentences “Using the same idea as the works in [20, 21], we designed an alternative the quantum circuit to implement the Toffoli gate with a higher success probability based on the P-SWAP gates, which required the same number of qubit-qudit gates as the protocols in Refs. [20,21].”are added. [see line 4 of paragraph 1 in Sec. 4 Discussion]

Comment 3: I believe that the advantage of this technique is to increase ......
Reply:We thank Reviewer 3 for bringing our attention to these issues.
Modification:
-We revised and explained the implementation Toffoli gate.[see Eqs. (33)-(45)].
-We added Eq. (17) and modified the implementation of P-SWAP gate. [see Eqs. (11)-(21)]
-We expanded Eq. (27) into (29)-(32), and modified the implementation CNOT gate. [see Eqs. (22)-(32)]
-We have modified our paper according to the comments by referees 1 and 2.[see above Reply and Modification for the Reports by referees 1 and 2]
-We fixed the global factors in Eqs. (23-32). Also, we fixed the global factors in Eqs. (36-45).[see Eqs. (23-32) and (36-45)]

Comment 4: In summary, I think that the paper has to be ......
Modification:
-We have rewritten and explained the implementation of P-SWAP, CNOT and Toffoli gates in detail. [see Eqs. (11-45)]
-We demonstrated the probability of success is increased [see Reply and Modification for comment 3 by referee 1].
-We have addressed the problems raised by referees 1 and 2 [see the Reply and Modification for comments by referees 1 and 2]
-We have stated that our Toffoli gate is an alternative of the one in Ref. [20]and compared to [20,21] in terms of required gate number and the success probability.[see line 4 of paragraph 1 in Sec. 4 Discussion]

### Strengths

-Following the ideas introduced in [19], they propose an alternative construction using P-SWAP gates.

### Weaknesses

- The quantum circuit cost is not well defined, and it makes the conclusion questionable.
- Sec. 3 is unclear and potentially incorrect.

### Report

The authors apply the idea introduced in [19] for the efficient design of quantum circuits using higher-dimensional space. The underlying idea is to work not only with qubits, but more generally with qudits, in order to increase the number of degrees of freedom during the control process. In order to recover qubits states at the end of the process, the transformation must be designed such that, at the final time, the additional states are not populated.

The method of higher dimensional space is potentially useful to realize quantum circuits with a minimum number of operations, and thus, this can decrease the error produced during the computation.

The novel elements are the following : they propose a concrete realization of the method to produce CNOT and Toffoli gates by means of P-SWAP gates. The optical setup is different than the one considered in [19].

I have several remarks on this paper.
- The cost of a quantum circuit is usually defined under the assumption of a set of elementary quantum gates called « basic gate library ». When we optimize a quantum circuit, we design a circuit that produces the same transformation, but using the minimum number of gates of the library. When circuits are based on the same library, this make sense to compare them. But does it make sense to compare the cost (number of gates) of quantum circuit based on different libraries, especially when the underlying systems are so much different (since the system dimension is increased, there are qudit gates which do not have an equivalent in qubit gates).

In several paragraphs, they compare the number of gates required to produce a CNOT gate using their method with the number of gates of standard quantum circuits found in the literature. The way they count the number of gates and the way they compare the results are misleading, and not precisely defined.

For example, at the end of sec 2.2.1, they write : « From Eqs. (7-10), one can see that a three-qubit Toffoli gate can be simulated using three nearest-neighbor qubit-qudit gates and two single-qutrit gates. The cost of this construction outperforms the previous synthesis ones that require six CNOT gates [39] or five two-qubit gates [1]. »
A naive count of the number of gates is 2+3=5. Following this logic, this is difficult to see that the result of [1] is outperformed. Even if this does not change really the conclusion of sec. 2.2.2, the same remark can be addressed: there is no clear definition of how the number of gates must be calculated. I’m not convinced that the XA gates can be removed from the computation of the cost, because it has a non-trivial effect.

Since one of the main claims of this paper concerns the low number of gates used in the method, I suggest to clarify the definition of the cost and how they can be compared.

-My second comment is related to the main objection given by the first referee. As I understand their reasoning, they use Eq. (17) in the propagation of the state to the next quantum gate. This would mean that the circuit is of the form :

(Q. gate) -(detector) – (Q. gate) – (detector). ((1))

Which is (in general) not equivalent to :

(Q. gate) – (Q. gate) – (detector). ((2))

In Fig.5, I understand that the system is in the form of ((2)), and thus it is difficult to see where the detector is. In this figure, it looks like that there is no measurement, and thus, I expect to take Eq. (16) as an input for the next quantum gates, and to proceed to the measurement at the end. Except if the measurement and the other gate operation commutes, the two approaches are not equivalent.

In order to avoid any misunderstanding, and potential errors, these points must be clarified.

Finally, I have two other remarks which are not related to the scientific content (these remarks may not be taken into account in the publishing decision).

-On page 10, in the paragraph : « As shown in Fig. 6, after three input photons are injected… », it is very difficult to follow the reasoning. Maybe a few words of link can improve the transition between paragraphs.

-The title does not really reflect the contents of the paper. Usually, the notion of optimization is related to an algorithm that allows us to reduce a well-defined cost function. Ideally, we want to have the global minimum of such a cost function. When we consider the cost of a quantum circuit, we say that a circuit is optimized if the circuit is optimal, i.e. it has the global minimum of the cost function (see https://www.degruyter.com/document/doi/10.2478/s11534-008-0039-8/html or https://arxiv.org/pdf/2009.13247.pdf page 12). In this paper, there is no optimization algorithm and no proof of global minimum. Hence, maybe the word « reduction » is more relevant in this context (see the references). Also, « universal quantum gates » are not discussed in this paper, only CNOT and Toffoli gates are investigated. Maybe an explicit reference to CNOT and Toffoli gates is more suitable ?

### Requested changes

- Provide a clear definition of the cost , and how these circuits can be compared to state of the art circuits.
- Provide further details in Sec. 3 and clarify the role of the detectors.

• validity: low
• significance: ok
• originality: low
• clarity: low
• formatting: -
• grammar: -

### Author:  Hai-Rui Wei  on 2021-07-20

(in reply to Report 2 on 2021-06-25)
Category:

Comment 1: The authors apply the idea introduced in [19] for the efficient design of quantum circuits using higher-dimensional space. The underlying idea is to work not only with qubits, but more generally with qudits, in order to increase the number of degrees of freedom during the control process. In order to recover qubits states at the end of the process, the transformation must be designed such that, at the final time, the additional states are not populated. The method of higher dimensional space is potentially useful to realize quantum circuits with a minimum number of operations, and thus, this can decrease the error produced during the computation. The novel elements are the following: they propose a concrete realization of the method to produce CNOT and Toffoli gates by means of P-SWAP gates. The optical setup is different than the one considered in [19].

Reply: We thank Reviewer 2 for reviewing our manuscript and making some positive comments.

Comment 2: I have several remarks on this paper. - The cost of a quantum circuit is usually defined under the assumption of a set of elementary quantum gates called « basic gate library ». When we optimize a quantum circuit, we design a circuit that produces the same transformation, but using the minimum number of gates of the library. When circuits are based on the same library, this make sense to compare them. But does it make sense to compare the cost (number of gates) of quantum circuit based on different libraries, especially when the underlying systems are so much different (since the system dimension is increased, there are qudit gates which do not have an equivalent in qubit gates). In several paragraphs, they compare the number of gates required to produce a CNOT gate using their method with the number of gates of standard quantum circuits found in the literature. The way they count the number of gates and the way they compare the results are misleading, and not precisely defined. For example, at the end of sec 2.2.1, they write:From Eqs. (7-10), one can see that a three-qubit Toffoli gate can be simulated using three nearest-neighbor qubit-qudit gates and two single-qutrit gates. The cost of this construction outperforms the previous synthesis ones that require six CNOT gates [39] or five two-qubit gates [1]. A naive count of the number of gates is 2+3=5. Following this logic, this is difficult to see that the result of [1] is outperformed. Even if this does not change really the conclusion of sec. 2.2.2, the same remark can be addressed: there is no clear definition of how the number of gates must be calculated. I’m not convinced that the XA gates can be removed from the computation of the cost, because it has a non-trivial effect. Since one of the main claims of this paper concerns the low number of gates used in the method, I suggest to clarify the definition of the cost and how they can be compared.

Reply: We thank Reviewer 2for this helpful suggestion. Addressing the problem would improve our manuscript greatly. A quantum circuit can be decomposed into a sequence of two-qubit entangled gates and single-qubit gates [Phys.Rev. A 52, 3457 (1995)]. The cost or complexity of quantum circuits is usually measured by the number of two-qubit entangled gates needed to perform the desired unitary operation. The reason for counting the number of two-qubit gates is mainly experimental since their realization is much more demanding and introduces more imperfections than the realization of one-qubit gates. Adding every new two-qubit gate to the circuit increases its overall imperfection. This constitutes the main obstacle preventing realization of quantum computation within sufficient precision. It is therefore crucial to design circuits with the least possible number of entangling gates.

Modification: We have added the definition of the cost in paragraph 1 in Introduction “Quantum circuits can be realized by sequences of two-qubit gates and single-qubit gates in principle [1]. The cost (also called complexity) of the quantum circuits usually is measured by the number of two-qubit entangled gates involved in the quantum circuit, because they introduce more imperfections and more demands than the single-qubit gates.” We removed all inappropriate comparisons between our gate cost and previous cost in qubit system.

Comment 3:-My second comment is related to the main objection given by the first referee. As I understand their reasoning, they use Eq. (17) in the propagation of the state to the next quantum gate. This would mean that the circuit is of the form: (Q. gate) –(detector) – (Q. gate) – (detector). ((1)) Which is (in general) not equivalent to: (Q. gate) – (Q. gate) – (detector). ((2)) In Fig.5, I understand that the system is in the form of ((2)), and thus it is difficult to see where the detector is. In this figure, it looks like that there is no measurement, and thus, I expect to take Eq. (16) as an input for the next quantum gates, and to proceed to the measurement at the end. Except if the measurement and the other gate operation commutes, the two approaches are not equivalent. In order to avoid any misunderstanding, and potential errors, these points must be clarified.

Reply: We thank Reviewer 2 for pointing out this question.We regret that we did not manage a clear message. In fact, we use the method (P-SWAP gate)– (P-SWAP gate)– (detector)–(feed-forward)to realize the CNOT gate, and use the similar method (P-SWAP gate) – (CNOT gate)– (P-SWAP gate) – (detector)– (feed-forward) to realize the Toffoli gate. As shown in our revised manuscript, the feed-forward operations are performed at the last step (see the paragraphs below Eq. (21)) to complete the P-SWAP gate. In the construction of two-photon CNOT gate, as shown in Fig. 5, after the first P-SWAP gate is completed, the photon emitted from the output port pairs (1’, 12) and (9, 12), or (1’’, 12) and (10,12) are led to the next P-SWAP gate. We take measurement and feed-forward operation only in the last P-SWAP gate. Similarly, in the construction of the Toffoli gate, the feed-forward operation are only performed after the rightmost P-SWAP gate. [see Fig. 5 and paragraphs below Eq. (44) and (45) in the revised version]

Modification: We added the input-output modes of P-SWAP gate in Fig. 5 and Fig. 6. We added some sentences as follows to explain the implementation of CNOT and Toffoli gates as the form:(Q. gate) – (Q. gate) – (detector)– (feed-forward). We added a sentence “After the photons interact with the first P-SWAP gate, the outing photons emitted from spatial mode pairs(9, 12) and (1’, 12), or (10, 12) and (1’’, 12) (as an input) will be led to the next HWP$^0$◦ and the rightmost P-SWAP gate”[see the paragraph below Eq. (22)] We added 5 paragraphs below Eq. (21) on page 8. We added 5 paragraphs below Eq. (28) on page 10. We added 5 paragraphs below Eq. (41) on page 12.

Comment 4: Finally, I have two other remarks which are not related to the scientific content (these remarks may not be taken into account in the publishing decision). -On page 10, in the paragraph « As shown in Fig. 6, after three input photons are injected… », it is very difficult to follow the reasoning. Maybe a few words of link can improve the transition between paragraphs. -The title does not really reflect the contents of the paper. Usually, the notion of optimization is related to an algorithm that allows us to reduce a well-defined cost function. Ideally, we want to have the global minimum of such a cost function. When we consider the cost of a quantum circuit, we say that a circuit is optimized if the circuit is optimal, i.e. it has the global minimum of the cost function (seehttps://www.degruyter.com/document/doi/10.2478/s11534-008-0039-8/html or https://arxiv.org/pdf/2009.13247.pdf page 12). In this paper, there is no optimization algorithm and no proof of global minimum. Hence, maybe the word « reduction » is more relevant in this context (see the references). Also, « universal quantum gates » are not discussed in this paper, only CNOT and Toffoli gates are investigated. Maybe an explicit reference to CNOT and Toffoli gates is more suitable?

Reply: We thankReviewer 2 for bringing our attention to these questions.

Modification:-We added a title of subsection 3.3, i.e.“3.3 Implementation of a linear optical Toffoli gate”. We also added some sentences “We propose the implementation of a Toffoli gate based on the designed P-SWAP and CNOT gates.As shown in Fig. 6,….” [see the paragraph below subsection 3.3] -We changed the title of our paper as“Implementation of CNOT and Toffoli gates with higher-dimensional spaces”

### Weaknesses

* some of the presented results were already published
* the linear optical scheme is not analyzed correctly

### Report

As far as I can tell, the proposals presented in Section 2 are correct. They are a modification of the authors' previous proposal for the Fredkin gate cited as [25]. However, the paper does not mention that the synthesis proposed in Section 2.2.2 uses the same idea already proposed in the works cited as [19,20]. The authors mention being "inspired" by [19,20] in the 4th sentence in the Discussion, but given the claims in the abstract and introduction, the references should be credited more explicitly. As the P-SWAP variant of the Toffoli gate also uses 3 qubit-qudit gates, the reduction in the number of two-qudit gates is therefore not a novel result.

The proposal of the linear-optical setup is very similar to schemes already published by the authors [25] [New J. Phys. 22 093051 (2020)].

Most importantly, the P-SWAP scheme would only work in coincidence-basis post-selection. From Eq. (16), the terms (17) to (20) can only be post-selected if detectors are placed at the P-SWAP outputs. The P-SWAP setup is, however, used in subsequent schemes using only path post-selection. For example, if one chooses the P-SWAP output modes 9, 12, and 1', the post-selected output of the CNOT scheme depicted in Fig. 5 is
\begin{align}
|\chi^+_{9,12}\rangle' &=\frac{1}{8} \bigg\{ \left[\alpha_1 \left(1+1/2\sqrt{2} \right) + \alpha_2 3/2\sqrt{2}\right]|\text{HH}\rangle \\
&+ \left[\alpha_2 \left(1+1/2\sqrt{2} \right) + \alpha_1 3/2\sqrt{2}\right]|\text{HV}\rangle \\
&+ \left( \sqrt{2} \alpha_3 + \alpha_4\right) |\text{VH}\rangle \\
&+ \left( \sqrt{2}\alpha_4 + \alpha_3\right) |\text{VV}\rangle \bigg\},
\end{align}
as opposed to Eq. (27) that shows the desired output of the CNOT. One can arrive at this result using simple creation-operator transformations at each component and discarding unused modes.

Additionally, some steps are not explained at all, such as:
* a simple joining of multiple P-SWAP spatial output modes 9-12 into just two modes,
* the summation of probabilities of non-orthogonal states (17) to (20),
* the feed-forward $P_\pi$ being carried out without detection.

I believe that none of the steps above are possible. Modes can be switched based on classical information, which is not available for the superposition (16). The state (16) does not contain a sum of the states (17) to (20), because the terms involving mode 1' appear only once in (16). And the feed-forward must be triggered by definition.

In summary, the main part of the manuscript does not present a correct analysis. I believe that addressing the correctness is a necessary condition for publishing in any scientific journal. For details and elaborations on the above arguments, I encourage the authors to refer to past reviews of this work.

• validity: poor
• significance: -
• originality: -
• clarity: -
• formatting: -
• grammar: -

### Author:  Hai-Rui Wei  on 2021-07-21

(in reply to Report 1 on 2021-06-18)
Category:

Comment 1: As far as I can tell, the proposals presented in Section 2 are correct. They are a modification of the authors' previous proposal for the Fredkin gate cited as [25]. However, the paper does not mention that the synthesis proposed in Section 2.2.2 uses the same idea already proposed in the works cited as [19,20]. The authors mention being inspired'' by [19,20] in the 4th sentence in the Discussion, but given the claims in the abstract and introduction, the references should be credited more explicitly. As the P-SWAP variant of the Toffoli gate also uses 3 qubit-qudit gates, the reduction in the number of two-qudit gates is therefore not a novel result.

Reply: We thank Reviewer 1 for his/her comments.

Modification: We added some statements about [20,21] in the paragraph 4 in Introduction. See “Ralph et al. [20,21] first proposed an interesting scheme for synthesizing a Toffoli gate using three qubit-qudit CNOT gates and two single-qutrit $X_A$ gates. The main idea of the works in Refs. [20,21] was to extend temporarily the higher-dimensional subspaces on one of the controlled qubit carriers and then perform corresponding logical operations. Using the same method as Refs. [20,21], in this paper, we propose an alternative scheme to implement the CNOT and Toffoli gates based on the P-SWAP gates based on the partial-swap (P-SWAP) gates by using higher-dimensional spaces.''

We added also the more comparisons about our schemes and the works in Refs. [20,21], see the paragraph 1 in Section Discussion. “Using the same idea as the works in [20,21], we designed an alternative the quantum circuit to implement the Toffoli gate with a higher success probability based on the P-SWAP gates, which required the same number of qubit-qudit gates as the protocols in Refs. [20,21].''

“Moreover, the success probability of our P-SWAP-based Toffoli gate (1/64) is higher than the CNOT-based protocols (1/72) [20,21] and it is also higher than the no-decomposition-based one (1/133) [59].'' [see at the end of paragraphs 2 in Section Discussion]

Comment 2: The proposal of the linear-optical setup is very similar to schemes already published by the authors [25] [New J. Phys. 22 093051 (2020)]. Most importantly, the P-SWAP scheme would only work in coincidence-basis post-selection. From Eq. (16), the terms (17) to (20) can only be post-selected if detectors are placed at the P-SWAP outputs. The P-SWAP setup is, however, used in subsequent schemes using only path post-selection. For example, if one chooses the P-SWAP output modes 9, 12, and $1'$, the post-selected output of the CNOT scheme depicted in Fig. 5 is

$\begin{eqnarray*} |\chi_{9,12}^+\rangle'&=&\frac{1}{8} \{[\alpha_1(1+1/2\sqrt{2})+\alpha_2 3/2\sqrt{2}]|HH\rangle\\&& +[\alpha_2(1+1/2\sqrt{2})+\alpha_1 3/2\sqrt{2}]|HV\rangle \\&& +(\sqrt{2}\alpha_3+\alpha_4)|VH\rangle \\&& +(\sqrt{2}\alpha_4+\alpha_3)|VH\rangle \}. \end{eqnarray*}$

as opposed to Eq. (27) that shows the desired output of the CNOT. One can arrive at this result using simple creation-operator transformations at each component and discarding unused modes.

Reply: We thank Reviewer 1 for pointing it out. We regret that we did not manage a clear message. We recalculated the P-SWAP gate using the creation-operator transformations as follows, and the input state in terms of creation-operator is expressed as

$\begin{eqnarray*} |\varphi_0\rangle&=&\big(\alpha_1\hat{a}^\dagger_{H_{1}}\hat{a}^\dagger_{H_{2}}+\alpha_2\hat{a}^\dagger_{H_{1}}\hat{a}^\dagger_{V_{2}} +\alpha_3\hat{a}^\dagger_{V_{1}}\hat{a}^\dagger_{H_{2}} +\alpha_4\hat{a}^\dagger_{V_{1}}\hat{a}^\dagger_{V_{2}}+\alpha_5\hat{a}^\dagger_{V_{1^{'}}}\hat{a}^\dagger_{H_{2}} +\alpha_6\hat{a}^\dagger_{V_{1^{'}}}\hat{a}^\dagger_{V_{2}}\big)|\text{vac}.\rangle. \end{eqnarray*}$

Here $|\text{vac}.\rangle$ is the state vector of vacuum. We obtain the below creation-operator transformations by Fig. 4 in the manuscript,

$\hat{a}_{H_1}^\dagger = \frac{1}{\sqrt{2}}(\hat{a}_{H_{11}}^\dagger + \hat{a}_{H_{12}}^\dagger ), \quad \hat{a}_{V_1}^\dagger = \frac{1}{\sqrt{2}}(\hat{a}_{V_{11}}^\dagger + \hat{a}_{V_{12}}^\dagger ), \quad \hat{a}_{V_{1'}}^\dagger = \frac{1}{\sqrt{2}}(\hat{a}_{V_{1'}}^\dagger + \hat{a}_{V_{1''}}^\dagger ),$$\hat{a}_{H_2}^\dagger = \frac{1}{2}(\hat{a}_{H_9}^\dagger + \hat{a}_{H_{10}}^\dagger - \hat{a}_{H_{11}}^\dagger + \hat{a}_{H_{12}}^\dagger), \quad \hat{a}_{V_2}^\dagger = \frac{1}{2}(\hat{a}_{V_9}^\dagger + \hat{a}_{V_{10}}^\dagger - \hat{a}_{V_{11}}^\dagger + \hat{a}_{V_{12}}^\dagger).$

We institute initial state with above transformations, then yields

$\begin{eqnarray*} |\varphi_3\rangle&=&\frac{1}{{2\sqrt 2}}\big[ {\alpha _1}(\hat a_{{H_{11}}}^\dagger + \hat a_{{H_{12}}}^\dagger)(-\hat a_{{H_{11}}}^\dagger + \hat a_{{H_{12}}}^\dagger + \hat a_{{H_{9}}}^\dagger + \hat a_{{H_{10}}}^\dagger)\\&& + {\alpha _2}(\hat a_{{H_{11}}}^\dagger + \hat a_{{H_{12}}}^\dagger)(\hat a_{V_{10}}^\dagger +\hat a_{{V_{9}}}^\dagger + \hat a_{{V_{12}}}^\dagger - \hat a_{{V_{11}}}^\dagger)\\&& + {\alpha _3}(\hat a_{{V_{12}}}^\dagger + \hat a_{{V_{11}}}^\dagger)(-\hat a_{H_{11}}^\dagger +\hat a_{{H_{12}}}^\dagger + \hat a_{{H_{9}}}^\dagger + \hat a_{{H_{10}}}^\dagger)\\&& + {\alpha _4}(\hat a_{{V_{12}}}^\dagger + \hat a_{{V_{11}}}^\dagger)(\hat a_{V_{10}}^\dagger +\hat a_{{V_{9}}}^\dagger + \hat a_{{V_{12}}}^\dagger - \hat a_{{V_{11}}}^\dagger)\\&& + {\alpha _5}(\hat a_{{V_{1'}}}^\dagger + \hat a_{{V_{1''}}}^\dagger)(-\hat a_{H_{11}}^\dagger +\hat a_{{H{12}}}^\dagger + \hat a_{{H_{9}}}^\dagger + \hat a_{{H_{10}}}^\dagger)\\&& + {\alpha _6}(\hat a_{{V_{1'}}}^\dagger + \hat a_{{V_{1''}}}^\dagger)(\hat a_{V_{10}}^\dagger +\hat a_{{V_{9}}}^\dagger + \hat a_{{V_{12}}}^\dagger - \hat a_{{V_{11}}}^\dagger)\big]|\text{vac}.\rangle. \end{eqnarray*}$

We expand above equation and rewrite it as

$\begin{eqnarray*} |\varphi_3\rangle&=&|\varphi_4^{1}\rangle+|\varphi_4^{2}\rangle+|\varphi_4^{3}\rangle+|\varphi_4^{4}\rangle+\frac{1}{{2\sqrt 2}} \big[ {\alpha _1}(\hat a_{{H_{11}}}^\dagger + \hat a_{{H_{12}}}^\dagger )(-\hat a_{{H_{11}}}^\dagger + \hat a_{{H_{12}}}^\dagger)\\&& + {\alpha _2}(-\hat a_{{H_{11}}}^\dagger\hat a_{{V_{11}}}^\dagger + \hat a_{{H_{11}}}^\dagger \hat a_{{V_{12}}}^\dagger - \hat a_{{V_{11}}}^\dagger\hat a_{{H_{12}}}^\dagger + \hat a_{{H_{12}}}^\dagger\hat a_{{V_{12}}}^\dagger)\\&& + {\alpha _3}(-\hat a_{{H_{11}}}^\dagger \hat a_{{V_{11}}}^\dagger + \hat a_{{V_{11}}}^\dagger \hat a_{{H_{12}}}^\dagger- \hat a_{{H_{11}}}^\dagger \hat a_{{V_{12}}}^\dagger + \hat a_{{H_{12}}}^\dagger \hat a_{{V_{12}}}^\dagger)\\&& + {\alpha _4}(\hat a_{{V_{12}}}^\dagger + \hat a_{{V_{11}}}^\dagger)(\hat a_{{V_{12}}}^\dagger - \hat a_{{V_{11}}}^\dagger)\\&& + {\alpha _5}(\hat a_{{V_{1'}}}^\dagger + \hat a_{{V_{1''}}}^\dagger)(\hat a_{{H_{9}}}^\dagger + \hat a_{{H_{10}}}^\dagger)\\&& + {\alpha _6}(\hat a_{{V_{1'}}}^\dagger + \hat a_{{V_{1''}}}^\dagger)(\hat a_{V_{9}}^\dagger +\hat a_{{V_{10}}}^\dagger)\big]|\text{vac}.\rangle. \end{eqnarray*}$

(i) When one chooses the event that photons come from output mode pairs (9, 12) and ($1'$, 12), the state $|\varphi_3\rangle$ will collapse into

$\begin{eqnarray*} |\varphi_4^{1}\rangle&=&\frac{1}{2\sqrt{2}}(\alpha_1\hat a_{H_{9}}^\dagger\hat a_{H_{12}}^\dagger +\alpha_2\hat a_{V_{9}}^\dagger \hat a_{H_{12}}^\dagger +\alpha_3\hat a_{H_{9}}^\dagger\hat a_{V_{12}}^\dagger +\alpha_4\hat a_{V_{9}}^\dagger \hat a_{V_{12}}^\dagger +\alpha_5\hat a_{V_{1'}}^\dagger\hat a_{H_{12}}^\dagger +\alpha_6\hat a_{V_{1'}}^\dagger \hat a_{V_{12}}^\dagger)|\text{vac}.\rangle. \end{eqnarray*}$

The P-SWAP gate is completed.

(ii) When one chooses the event that photons come from output mode pairs (10, 12), and ($1''$, 12), the state $|\varphi_3\rangle$ will collapse into

$\begin{eqnarray*} |\varphi_4^{2}\rangle&=&\frac{1}{2\sqrt{2}}(\alpha_1\hat a_{H_{10}}^\dagger \hat a_{H_{12}}^\dagger +\alpha_2\hat a_{V_{10}}^\dagger \hat a_{H_{12}}^\dagger +\alpha_3\hat a_{H_{10}}^\dagger \hat a_{V_{12}}^\dagger +\alpha_4\hat a_{V_{10}}^\dagger \hat a_{V_{12}}^\dagger +\alpha_5\hat a_{V_{1^{''}}}^\dagger\hat a_{H_{12}}^\dagger +\alpha_6\hat a_{V_{1^{''}}}^\dagger \hat a_{V_{12}}^\dagger)|\text{vac}.\rangle, \end{eqnarray*}$

The P-SWAP gate is also completed.

(iii) When one chooses the event that photons come from output mode pairs (9, 11) and ($1'$, 11), the state $|\varphi_3\rangle$ will collapse into

$\begin{eqnarray*} |\varphi_4^{3}\rangle&=&\frac{1}{2\sqrt{2}} (\alpha_1\hat a_{H_{9}}^\dagger \hat a_{H_{11}}^\dagger +\alpha_2\hat a_{V_{9}}^\dagger \hat a_{H_{11}}^\dagger +\alpha_3\hat a_{H_{9}}^\dagger \hat a_{V_{11}}^\dagger +\alpha_4\hat a_{V_{9}}^\dagger \hat a_{V_{11}}^\dagger -\alpha_5\hat a_{V_{1'}}^\dagger \hat a_{H_{11}}^\dagger -\alpha_6\hat a_{V_{1'}}^\dagger \hat a_{V_{11}}^\dagger)|\text{vac}.\rangle. \end{eqnarray*}$

A feed-forward operation $\sigma_z=|H\rangle\langle H|+|V\rangle\langle V|$ is applied to complete the SWAP gate, and such operation can be realized conveniently by setting an HWP setting at zero degree in mode $1'$.

(iv) When one chooses the event that photons come from output mode pairs (10, 11) and ($1''$, 11), the state $|\varphi_3\rangle$ will collapse into

$\begin{eqnarray*} |\varphi_4^{4}\rangle&=&\frac{1}{2\sqrt{2}}(\alpha_1\hat a_{H_{10}}^\dagger \hat a_{H_{11}}^\dagger +\alpha_2 \hat a_{V_{10}}^\dagger \hat a_{H_{11}}^\dagger +\alpha_3\hat a_{H_{10}}^\dagger \hat a_{V_{11}}^\dagger +\alpha_4 \hat a_{V_{10}}^\dagger \hat a_{V_{11}}^\dagger -\alpha_5\hat a_{V_{1''}}^\dagger \hat a_{H_{11}}^\dagger -\alpha_6 \hat a_{V_{1''}}^\dagger \hat a_{V_{11}}^\dagger)|\text{vac}.\rangle. \end{eqnarray*}$

An HWP setting at zero degree is applied in path mode $1''$ to complete the P-SWAP gate.

The states $|\varphi_4^{1}\rangle$, $|\varphi_4^{2}\rangle$, $|\varphi_4^{3}\rangle$, $|\varphi_4^{4}\rangle$, are orthogonal to each other, because the subscript "$i$'' in $H_i$ ($V_i$) stands for the $H$-polarized ($V$-polarized) photon emitted from spatial mode $i$''. Thus, the P-SWAP gate is realized with a success probability $4\times1/8=1/2$.

Correspondingly, we also rewrote the implementation of CNOT and Toffoli gates in term of creation operations, and these can be found in Eqs. (22-45).

Modification: We have rewritten the implementation of P-SWAP, CNOT and Toffoli gates in terms of creation operations [see Eqs. (11-45)]

Comment 3: Additionally, some steps are not explained at all, such as:

*a simple joining of multiple P-SWAP spatial output modes 9-12 into just two modes,

*the summation of probabilities of non-orthogonal states (17) to (20),

*the feed-forward $P_\pi$ being carried out without detection.

Reply: We thank Reviewer 1 pointing out these questions.

*The joining of output modes of P-SWAP gate: We regret that we did not manage a clear message. We should note we do not take measurements in output modes of the first P-SWAP gate in the constructions of the CNOT and Toffoli gates. After the first P-SWAP gate in the construction of CNOT gate, photons emitted from mode pairs (9, 12) and ($1'$, 12), or (10, 12) and ($1''$, 12) will be led to the next operation, and we detect photons only on the CNOT gate output, see Fig. 5.

Similar method also is applied to the Toffoli gate, the photons are detected only on the rightmost P-SWAP gate, see Fig. 6.

*The calculation of gate success probability: From above calculations, we can check that $|\varphi_4^{1}\rangle$, $|\varphi_4^{2}\rangle$, $|\varphi_4^{3}\rangle$, $|\varphi_4^{4}\rangle$, are orthogonal to each other, the subscripts “$i$'' in $H_i$ ($V_i$) stands for the $H$-polarized ($V$-polarized) photon emitted from spatial mode “$i$'', i.e., when $i\neq j$, $\langle H_i|H_j\rangle=\langle V_i|V_j\rangle=0$. The success probability of the P-SWAP gate therefore is $4\times1/8=1/2$.

*Realization of the feed-forward operation: We regret that we did not manage a clear message. In fact, we employ the method (P-SWAP gate)-(P-SWAP gate)-(detecting)-(feed-forward) to realize the CNOT gate, and (P-SWAP gate)-(CNOT gate)-(P-SWAP gate)-(detecting)-(feed-forward) to realize the Toffoli gate. That is, we perform the feed-forward operations on only the rightmost P-SWAP gate after the measurement, see Fig. 5 and Fig. 6. Moreover, we also explained the realization of feed-forward operation in details.

For P-SWAP gate, from Eqs. (20) and (21), we find only phase errors in modes $1'$ and $1''$ need to be corrected. These errors can be corrected easily by using half wave plates setting at zero degree in mode $1'$ and mode $1''$ based on the output modes of photons. Similar explanations can be found in CNOT and Toffoli gates.

Modification: * The joining of output modes of P-SWAP gate:

We added some sentences to state the first P-SWAP gate without measurement, the measurement only is applied on the CNOT and Toffoli output.

“After the photons interact with the first P-SWAP gate, the outing photons emitted from spatial mode pairs (9, 12) and ($1'$, 12), or (10 12) and ($1''$, 12) (as an input) will be led to the next HWP$^{0^\circ}$....'' [see the paragraph below Eq. (22)]

“First, after photons go through the PBS1 and the leftmost P-SWAP gate, when the outing photons emitted from path pairs (9, 12) and ($1'$, 12), or (10, 12) and ($1''$, 12), we can obtain two desired states,'' [see the paragraph above Eq. (34)]

“Second, the states described by Eqs. (34) and (35) are considered as the inputs for the CNOT gate acting on photon 1 and photon 3. When the outing photons emitted from path pairs (9, 11), (9, 12), (10, 11), or (10, 12), which can yield 16 desired outcomes... '' [see the paragraph below Eq. (35)]

“Third, above 16 states are considered as inputs for the rightmost P-SWAP gate acting on photon 1 and photon 2. When the photon emitted from path pairs (9, 12) and ($1'$, 12), or (9, 11) and ($1'$, 11), or (10, 12) and ($1''$, 12), or (10, 11) and ($1''$, 11), we can obtain 64 desired states...'' [see the paragraph below Eq. (37)]

Also, we modified Fig. 5 and Fig. 6, and added the explanation for the numbers in caption of Fig. 5.

*The calculation of gate success probability: We added Eq. (17) and modified Eqs. (18-21) [see and Eqs. (17-21)]

We explained the gate success probability, i.e., we added sentences “Here the four orthogonal states $|\varphi_4^{1}\rangle$, $|\varphi_4^{2}\rangle$, $|\varphi_4^{3}\rangle$, $|\varphi_4^{4}\rangle$ are given by...'' [see the paragraph below Eq. (17)]

We added sentences "Based on above orthogonal two-fold states $|\chi^+{9,12}\rangle_3$, $|\chi^+\rangle_3$, $|\chi^+{9,11}\rangle_3$, $|\chi^+\rangle_3$, one can find that..." [see the paragraph below Eq. (32)]

We added sentences “Based on above orthogonal eight-fold states described by Eqs. (42-45), one can find that our proposal can be achieved with a higher success probability...'' [see the last paragraph on page 13]

*Realization of the feed-forward operation: We added sentences to explain the feed-forward operations on only the last P-SWAP gate and detect photons only in the output of CNOT and Toffoli gates. [see the sentences for modification of above the joining of output modes of P-SWAP gate]

We rewrite the realization of feed-forward operation for P-SWAP gate, and cited Refs. [Phys. Rev. A 64 062311 (2001); Phys. Rev. Lett. 98, 170502 (2007); Phys. Rev. Lett. 126, 140501 (2021); Proceedings of the National Academy of Sciences 107, 20869-20874 (2010)].

"(iii) When one chooses the event that photons come from output mode pairs (9, 11) and ($1'$, 11), the state $|\varphi_3\rangle$ will collapse into $|\varphi_4^3\rangle$. And then, a phase flip operation, $\hat{a}^\dagger_{V_1'}\stackrel{\sigma_z}{\longleftrightarrow}-\hat{a}^\dagger_{V_1'}$, should be applied to complete the P-SWAP gate. Such feed-forward operation can be achieved by setting HWP$^{0^\circ}$ in spatial mode $1'$. The spatial-based classical feed-forward operations has been experimentally demonstrated recently [59-62]''.

"(iv) When one chooses the event that photons come from output mode pairs (10, 11) and ($1''$, 11), the state $|\varphi_3\rangle$ will collapse into $|\varphi_4^4\rangle$. And then, an HWP$^{0^\circ}$ is set in spatial mode $1''$ to complete the P-SWAP gate.'' [see the paragraph below Eq. (21)]

We also rewrite the realization of feed-forward operation for CNOT and Toffoli. [see the paragraphs below Eqs. (31) and (32), and the paragraphs below Eqs. (44) and (45)].

Comment 4: I believe that none of the steps above are possible. Modes can be switched based on classical information, which is not available for the superposition (16). The state (16) does not contain a sum of the states (17) to (20), because the terms involving mode $1'$ appear only once in (16). And the feed-forward must be triggered by definition.

In summary, the main part of the manuscript does not present a correct analysis. I believe that addressing the correctness is a necessary condition for publishing in any scientific journal. For details and elaborations on the above arguments, I encourage the authors to refer to past reviews of this work.

Reply: We thank Reviewer 1 for pointing above questions out. We have expanded and rewritten Eq. (16) in Eq. (17), and modified Eqs. (18-21). We also defined the feed-forward.

Modification: See the modifications for above comments 2 and 3.