본문 바로가기
양자컴퓨터

Quantum computing - Quantum circuits (SWAP gate, Measurement, and Toffoli gate)

by 프로그래밍하겠습니다 2025. 1. 12.
728x90
반응형

 🎶Quantum circuits에 대해 알아보자!

 

(🎞️ Let's find out about Quantum circuits.)

 

1. Circuit swapping two qubits

: 두 qubits의 상태를 바꾸는 회로로써, 다음과 같이 3개의 CNOT gate를 사용해 구현한다.

 

(🎞️ It is a circuit that changes the state of the two qubits, and is implemented using three CNOT gates as follows.)

swap gate
[사진 1] Swap

 

swap gate는 quantum system에서 오류를 발생시키는 가장 근본적인 원인 중 하나이므로, 이 swap gate의 사용을 줄이는 것이 양자 컴퓨터 상용화에 있어서 무엇보다도 중요한 과제이다.

 

(🎞️ Since the swap gate is one of the most fundamental causes of errors in the quantum system, reducing the use of the swap gate is the most important task in the commercialization of quantum computers.)

 

2. Measurement

: qubit의 상태를 측정하는 회로로써, 양자 회로의 계산 결과값을 얻기 위해 마지막 단계에 사용된다. 즉, measurement를 통해 중첩(superposition) 또는 얽힘(entanglement) 상태에 있는 양자를 고전적인 값으로 붕괴시키는 역할을 맡는다.

 

(🎞️ It is a circuit that measures the state of qubits and is used at the last step to obtain a calculation result of a quantum circuit. In other words, it plays a role of collapsing a quantum in a superposition or entanglement state into a classical value through measurement.)

measurement
[사진 2] Measurement

 

 

그렇다면 위처럼 양자 게이트들을 활용해서, 고전적 회로의 모든 것을 대체시킬 수 있을까? 

 

(🎞️  Then, can quantum gates be used as above to replace everything in classical circuits?)

 

일반적으로는 고전적인 회로를 직접적으로 양자 회로로 대체하는 것을 불가능하다. 그 이유는 바로, 고전적 회로에서는 비가역적인 게이트들, unitary하지 못한 gate들도 존재하기 때문이다!

(🎃 일반적으로 quantum circuit은 가역적인(reversible) gate들로만 구성돼 있다.)

 

(🎞️ In general, it is impossible to directly replace a classical circuit with a quantum circuit. The reason is that in a classical circuit, there are irreversible gates i.e non-unitary gates!)

(🎞️ In general, quantum circuit is made of some reversible gates.)

 

그래서, 양자회로에서는 다음과 같은 '특별한 게이트'를 추가해 비가역적인 고전적 게이트들을 가역적으로 대체할 수 있게 만들어 준다.

 

(🎞️ Therefore, in quantum circuits, the following special gates are added to make irreversible classical gates reversible.)

 

toffoli gate
[사진 3] Toffoli gate

 

위 게이트는 'Toffoli gate'라고 불리며, control qubit인 a와 b가 모두 1일 경우에만 target bit인 c의 결과값을 반대로 바꾸어준다.

 

(🎞️ The gate above is called the Toffoli gate, and the result of target bit c is reversed only when both a and b, which are control qubits, are 1.)

 

위 특성을 가지고, 우리는 고전회로에서의 NAND gate를 다음과 같이 구현할 수 있다.

 

(🎞️ With the above characteristics, we can implement the NAND gate in the quantum circuit as follows.)

 

NAND gate
[사진 4] mplementation of NAND gate

 

고전적인 gate들은 NAND gate들을 통해 모두 구현 가능하므로, 결과적으로는 toffoli gate를 활용함으로써 quantum circuit을 통해 고전적 회로들을 모두 대체할 수 있게 되는 것이다!

 

(🎞️ Since all classical gates can be implemented through NAND gates, the result is that the quantum circuit can replace all classical circuits by utilizing the toffoli gate!)

 

다음 포스트에서는 quantum system에서 사용되는 선형대수의 기본적인 개념에 대해 살펴보도록 하겠다.

 

(🎞️ In the next post, I will cover the basic concept of linear algebra used in the quantum system.)

728x90
반응형