Tamil
மொழிகள்
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

Note

இந்த பக்கம் tutorials/circuits/1_getting_started_with_qiskit.ipynb இல் இருந்து உருவாக்கப்பட்டது.

Quantum செயல்பாடுகளின் சுருக்கம்

இந்த பகுதியிலே Qiskit Terra இல் கிடைக்கும் பல்வேறு செயல்பாடுகளுக்குச் செல்லலாம். இவை:

  • ஒற்றை-கிட் குவாண்டம் வாயுக்கள்

  • மல்டி-க்விட் குவாண்டம் வாயில்கள்

  • மேற்கோள்கள்

  • மீட்டமை

  • நிலை

  • கூறு ஆரம்பம்

மூன்று வெவ்வேறு சிமுலேட்டர்களை எவ்வாறு பயன்படுத்துவது என்பதையும் நாங்கள் உங்களுக்குக் காண்பிப்போம்:

  • unitary_simulator

  • qasm_ simulator

  • statevector_simulator

[1]:
# Useful additional packages
import matplotlib.pyplot as plt
import numpy as np
from math import pi
[2]:
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, transpile
from qiskit.tools.visualization import circuit_drawer
from qiskit.quantum_info import state_fidelity
from qiskit import BasicAer

backend = BasicAer.get_backend('unitary_simulator')

ஒற்றை குப்ட் குவாண்டம் நிலைகள்

ஒரே ஒரு குவிட் குவாண்டம் கூறு என எழுதலாம்

\[\left|\psi\right\rangle = \alpha\left|0\right\rangle + \beta \left|1\right\rangle\]

எங்கே \(\alpha\) மற்றும் \(\beta\) என்பது சிக்கலான எண்கள். ஒரு அளவீட்டில் பிட் இருப்பதற்கான நிகழ்தகவு \(\left|0\right\rangle\) is \(|\alpha|^2\) and \(\left|1\right\rangle\) is \(|\beta|^2\). ஒரு திசையன் இது

\[\begin{split}\left|\psi\right\rangle = \begin{pmatrix} \alpha \\ \beta \end{pmatrix}.\end{split}\]

Note, due to the conservation of probability \(|\alpha|^2+ |\beta|^2 = 1\) and since global phase is undetectable \(\left|\psi\right\rangle := e^{i\delta} \left|\psi\right\rangle\) நாம் மட்டும் இரண்டு உண்மையான எண்களை மட்டும் தேவை.

ஒரு சுலபமான பிரதிநிதிபதி உள்ளது

\[\left|\psi\right\rangle = \cos(\theta/2)\left|0\right\rangle + \sin(\theta/2)e^{i\phi}\left|1\right\rangle\]

எங்கே \(0\leq \phi < 2\pi\), மற்றும் \(0\leq \theta \leq \pi\). இதிலிருந்து, க்யூபிட் மாநிலங்களுக்கும் (\(\mathbb{C}^2\)) மற்றும் ஒரு அலகு கோளத்தின் மேற்பரப்பில் உள்ள புள்ளிகளுக்கும் (\(\mathbb{R}^3\)). இது ஒரு க்யூபிட் மாநிலத்தின் ப்ளொச் கோள பிரதிநிதித்துவம் என்று அழைக்கப்படுகிறது.

குவாண்டம் கோடுகள்/செயல்பாடுகள் பொதுவாக மாடிகளாக பிரதிபடுத்தப்படுகின்றன. ஒரு விகிதத்தில் செயல்படும் ஒரு வாயில் ஒரு \(2\times 2\) ஒற்றையாட்சி அணி \(U\). குவாண்ட் கோட்டின் நடவடிக்கை, குவாண்டம் கூறை குறிக்கும் வெக்டர் கொண்டு வாயில் பிரதிநிதித்துவம் செய்கிறது.

\[\left|\psi'\right\rangle = U\left|\psi\right\rangle\]

ஒரு பொதுவான அதனை \(\left|0\right\rangle\) அதாவது

\[\begin{split}U = \begin{pmatrix} \cos(\theta/2) & a \\ e^{i\phi}\sin(\theta/2) & b \end{pmatrix}\end{split}\]

\(a\) and \(b\) எனும் சிக்கல் எண்கள் \(U^\dagger U = I\) for all \(0\leq\theta\leq\pi\) and \(0\leq \phi<2\pi\). இது 3 கட்டுப்பாட்டுகள் மற்றும் \(a\rightarrow-e^{i\lambda}\sin(\theta/2)\) and \(b\rightarrow e^{i\lambda+i\phi}\cos(\theta/2)\) where \(0\leq\lambda<2\pi\) giving

\[\begin{split}U(\theta, \phi, \lambda) = \begin{pmatrix} \cos\left(\frac{\theta}{2}\right) & -e^{i\lambda}\sin\left(\frac{\theta}{2}\right) \\ e^{i\phi}\sin\left(\frac{\theta}{2}\right) & e^{i(\phi+\lambda)}\cos\left(\frac{\theta}{2}\right) \end{pmatrix}\end{split}\]

இது மிகவும் பொதுவான வடிவம் ஒரே விரைவான தனிமங்களாகும்.

ஒற்றை-க்யூபிட் கேட்ஸ்

கிடைக்கக்கூடிய ஒற்றை குவிட் வாயில்கள்: - U கேட் - பி கேட் - அடையாள வாயில் - பாலி கேட்ஸ் - கிளிஃபோர்ட் கேட்ஸ் - \(C3\) வாயில்கள் - நிலையான சுழற்சி வாயில்கள்

நாங்கள் ஒரு பின்னணி வழங்கியுள்ளது: ` ` unitary_simulator ` ` unitary matrices கணக்கிட அனுமதிக்கிறது.

[3]:
q = QuantumRegister(1)

U gate

#: ../../tutorials/circuits/3_குவாண்டம்_செயல்பாடுகளின்_சுருக்கம்.ipynb:163 கோப்பு: 3_summary_of_quantum_operations.po

\[\begin{split}U(\theta, \phi, \lambda) = \begin{pmatrix} \cos\left(\frac{\theta}{2}\right) & -e^{i\lambda}\sin\left(\frac{\theta}{2}\right) \\ e^{i\phi}\sin\left(\frac{\theta}{2}\right) & e^{i(\phi+\lambda)}\cos\left(\frac{\theta}{2}\right) \end{pmatrix}\end{split}\]
[4]:
qc = QuantumCircuit(q)
qc.u(pi/2,pi/4,pi/8,q)
qc.draw()
[4]:
    ┌────────────────┐
q0: ┤ U(π/2,π/4,π/8) ├
    └────────────────┘
[5]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[5]:
array([[ 0.707+0.j   , -0.653-0.271j],
       [ 0.5  +0.5j  ,  0.271+0.653j]])

U கேட் நீக்கம் பற்றிய குறிப்பு

QuantumCircuit முறைகள் \(u1\), \(u2\) மற்றும் \(u3\) ஆகியவை இப்போது நிறுத்தப்பட்டுள்ளன. அதற்குப் பதிலாக, பின்வரும் மாற்றீடுகள் பயன்படுத்தப்பட வேண்டும்.

  • \(u1(\lambda) = p(\lambda) = u(0, 0, \lambda)\)

  • \(u2(\phi, \lambda) = u(\frac{\pi}{2}, \phi, \lambda) = p(\frac{\pi}{2} + \phi) \cdot sx \cdot p(\frac{\pi}{2} - \lambda)\)

  • \(u3(\theta, \phi, \lambda) = u(\theta, \phi, \lambda) = p(\phi + \pi) \cdot sx \cdot p(\theta + \pi) \cdot sx \cdot p(\lambda)\)

# qc.u1(lambda) is now:
qc.p(lambda)

# qc.u2(phi, lambda) is now:
qc.u(pi/2, phi, lambda)

# qc.u3(theta, phi, lambda) is now:
qc.u(theta, phi, lambda)

P கேட்

\(p(\lambda)= u(0, 0, \lambda)\) கேட் அணி வடிவத்தைக் கொண்டுள்ளது

\[\begin{split}p(\lambda) = \begin{pmatrix} 1 & 0 \\ 0 & e^{i \lambda} \end{pmatrix},\end{split}\]

இது ஒரு குவாண்டம் கட்டத்தைப் பயன்படுத்த எங்களுக்கு அனுமதிப்பதால் இது பயனுள்ளதாக இருக்கும்.

[13]:
qc = QuantumCircuit(q)
qc.p(pi/2,q)
qc.draw()
[13]:
    ┌────────┐
q0: ┤ P(π/2) ├
    └────────┘
[14]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[14]:
array([[1.+0.j, 0.+0.j],
       [0.+0.j, 0.+1.j]])

அடையாள வாயில்

அடையாள வாயில் \(Id = p(0)\).

[15]:
qc = QuantumCircuit(q)
qc.id(q)
qc.draw()
[15]:
    ┌───┐
q0: ┤ I ├
    └───┘
[16]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[16]:
array([[1.+0.j, 0.+0.j],
       [0.+0.j, 1.+0.j]])

பல்ஸ் வாயில்கள்

:math:`X `: bit-flip gate

இந்த bit-flip gate \(X\) என வரையறுக்கப்படுகிறது:

\[\begin{split}X = \begin{pmatrix} 0 & 1\\ 1 & 0 \end{pmatrix}= u(\pi,0,\pi)\end{split}\]
[17]:
qc = QuantumCircuit(q)
qc.x(q)
qc.draw()
[17]:
    ┌───┐
q0: ┤ X ├
    └───┘
[18]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[18]:
array([[0.+0.j, 1.+0.j],
       [1.+0.j, 0.+0.j]])

\(Y\): பிட்- மற்றும் கட்ட-திருப்பு வாயில்

\(Y\) வாயில் வரையறுக்கப்பட்டுள்ளது:

\[\begin{split}Y = \begin{pmatrix} 0 & -i\\ i & 0 \end{pmatrix}=u(\pi,\pi/2,\pi/2)\end{split}\]
[19]:
qc = QuantumCircuit(q)
qc.y(q)
qc.draw()
[19]:
    ┌───┐
q0: ┤ Y ├
    └───┘
[20]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[20]:
array([[ 0.+0.j, -0.-1.j],
       [ 0.+1.j,  0.+0.j]])

\(Z\): phase-flip gate

இந்த phase-flip gate \(Z\) என வரையறுக்கப்படுகிறது:

\[\begin{split}Z = \begin{pmatrix} 1 & 0\\ 0 & -1 \end{pmatrix}=p(\pi)\end{split}\]
[21]:
qc = QuantumCircuit(q)
qc.z(q)
qc.draw()
[21]:
    ┌───┐
q0: ┤ Z ├
    └───┘
[23]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[23]:
array([[ 1.+0.j,  0.+0.j],
       [ 0.+0.j, -1.+0.j]])

Clifford வாயுக்கள்

ஹாட்மார்ட் கேட்

\[\begin{split}H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1\\ 1 & -1 \end{pmatrix}= u(\pi/2,0,\pi)\end{split}\]
[22]:
qc = QuantumCircuit(q)
qc.h(q)
qc.draw()
[22]:
    ┌───┐
q0: ┤ H ├
    └───┘
[23]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[23]:
array([[ 0.707+0.j,  0.707-0.j],
       [ 0.707+0.j, -0.707+0.j]])

\(S\) (or, \(\sqrt{Z}\) கட்டம்) வாயில்

\[\begin{split}S = \begin{pmatrix} 1 & 0\\ 0 & i \end{pmatrix}= p(\pi/2)\end{split}\]
[24]:
qc = QuantumCircuit(q)
qc.s(q)
qc.draw()
[24]:
    ┌───┐
q0: ┤ S ├
    └───┘
[29]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[29]:
array([[1.+0.j, 0.+0.j],
       [0.+0.j, 0.+1.j]])

\(S^{\dagger}\) (அல்லது, இணைத்தல் \(\sqrt{Z}\) கட்டம்) வாயில்

\[\begin{split}S^{\dagger} = \begin{pmatrix} 1 & 0\\ 0 & -i \end{pmatrix}= p(-\pi/2)\end{split}\]
[25]:
qc = QuantumCircuit(q)
qc.sdg(q)
qc.draw()
[25]:
    ┌─────┐
q0: ┤ Sdg ├
    └─────┘
[26]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[26]:
array([[1.+0.j, 0.+0.j],
       [0.+0.j, 0.-1.j]])

\(C3\) வாயுக்கள்

\(T\) (or, \(\sqrt{S}\) கட்டம்) வாயில்

\[\begin{split}T = \begin{pmatrix} 1 & 0\\ 0 & e^{i \pi/4} \end{pmatrix}= p(\pi/4)\end{split}\]
[27]:
qc = QuantumCircuit(q)
qc.t(q)
qc.draw()
[27]:
    ┌───┐
q0: ┤ T ├
    └───┘
[28]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[28]:
array([[1.   +0.j   , 0.   +0.j   ],
       [0.   +0.j   , 0.707+0.707j]])

\(T^{\dagger}\) (or, conjugate of \(\sqrt{S}\) phase) gate

\[\begin{split}T^{\dagger} = \begin{pmatrix} 1 & 0\\ 0 & e^{-i \pi/4} \end{pmatrix}= p(-\pi/4)\end{split}\]
[29]:
qc = QuantumCircuit(q)
qc.tdg(q)
qc.draw()
[29]:
    ┌─────┐
q0: ┤ Tdg ├
    └─────┘
[30]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[30]:
array([[1.   +0.j   , 0.   +0.j   ],
       [0.   +0.j   , 0.707-0.707j]])

நிலையான சுழல்

நிலையான சுழற்சி வாயுக்கள் பாலஸ் :math:` P ={X, Y, Z} `.அவை என வரையறுக்கப்படுகின்றன

\[R_P(\theta) = \exp(-i \theta P/2) = \cos(\theta/2)I -i \sin(\theta/2)P\]

X-அச்சை சுற்றி சுழற்று

\[\begin{split}R_x(\theta) = \begin{pmatrix} \cos(\theta/2) & -i\sin(\theta/2)\\ -i\sin(\theta/2) & \cos(\theta/2) \end{pmatrix} = u(\theta, -\pi/2,\pi/2)\end{split}\]
[31]:
qc = QuantumCircuit(q)
qc.rx(pi/2,q)
qc.draw()
[31]:
    ┌─────────┐
q0: ┤ Rx(π/2) ├
    └─────────┘
[32]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[32]:
array([[ 0.707+0.j   , -0.   -0.707j],
       [ 0.   -0.707j,  0.707+0.j   ]])

Y-அச்சை சுற்றி சுழற்று

\[\begin{split}R_y(\theta) = \begin{pmatrix} \cos(\theta/2) & - \sin(\theta/2)\\ \sin(\theta/2) & \cos(\theta/2). \end{pmatrix} =u(\theta,0,0)\end{split}\]
[33]:
qc = QuantumCircuit(q)
qc.ry(pi/2,q)
qc.draw()
[33]:
    ┌─────────┐
q0: ┤ Ry(π/2) ├
    └─────────┘
[34]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[34]:
array([[ 0.707+0.j, -0.707+0.j],
       [ 0.707+0.j,  0.707+0.j]])

Z-அச்சை சுற்றி சுழற்று

\[\begin{split}R_z(\phi) = \begin{pmatrix} e^{-i \phi/2} & 0 \\ 0 & e^{i \phi/2} \end{pmatrix}\equiv p(\phi)\end{split}\]

உலகளாவிய கட்டம் \(e^{-i \phi/2}\) மூலம் \(p\) க்கு வித்தியாசமாக இருப்பதால், சமமான ஒன்றை இங்குப் பயன்படுத்தியுள்ளோம்.

[35]:
qc = QuantumCircuit(q)
qc.rz(pi/2,q)
qc.draw()
[35]:
    ┌─────────┐
q0: ┤ Rz(π/2) ├
    └─────────┘
[36]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[36]:
array([[0.707-0.707j, 0.   +0.j   ],
       [0.   +0.j   , 0.707+0.707j]])

இது ஒரு உலகளாவிய காலத்துக்கு மட்டுமே வேறுபடுகிறது.

பல க்யூபிட் கேட்ஸ்

கணித உரிமைகள்

The space of a quantum computer grows exponentially with the number of qubits. For \(n\) qubits the complex vector space has dimension \(d=2^n\). To describe states of a multi-qubit system, the tensor product is used to "glue together" operators and basis vectors.

Let’s start by considering a 2-qubit system. Given two operators \(A\) and \(B\) that each act on one qubit, the joint operator \(A \otimes B\) acting on two qubits is

\[\begin{split}\begin{equation} A\otimes B = \begin{pmatrix} A_{00} \begin{pmatrix} B_{00} & B_{01} \\ B_{10} & B_{11} \end{pmatrix} & A_{01} \begin{pmatrix} B_{00} & B_{01} \\ B_{10} & B_{11} \end{pmatrix} \\ A_{10} \begin{pmatrix} B_{00} & B_{01} \\ B_{10} & B_{11} \end{pmatrix} & A_{11} \begin{pmatrix} B_{00} & B_{01} \\ B_{10} & B_{11} \end{pmatrix} \end{pmatrix}, \end{equation}\end{split}\]

எங்கே \(A_{jk}\) மற்றும் \(B_{lm}\) ஆகியவை \(A\) மற்றும் \(B\).

அதாவது, 2-குவிட் முறைமைகளுக்கான அடிப்படை வெக்டர்ஸ் அடிப்படை வெக்டுகளைப் பயன்படுத்தி ஒரே குறும்படங்களுக்காக உருவாக்கப்படுகின்றன:

\[\begin{split}\begin{equation}\begin{split} \left|{00}\right\rangle &= \begin{pmatrix} 1 \begin{pmatrix} 1 \\ 0 \end{pmatrix} \\ 0 \begin{pmatrix} 1 \\ 0 \end{pmatrix} \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 0 \\0 \end{pmatrix}~~~\left|{01}\right\rangle = \begin{pmatrix} 1 \begin{pmatrix} 0 \\ 1 \end{pmatrix} \\ 0 \begin{pmatrix} 0 \\ 1 \end{pmatrix} \end{pmatrix} = \begin{pmatrix}0 \\ 1 \\ 0 \\ 0 \end{pmatrix}\end{split} \end{equation}\end{split}\]
\[\begin{split}\begin{equation}\begin{split}\left|{10}\right\rangle = \begin{pmatrix} 0\begin{pmatrix} 1 \\ 0 \end{pmatrix} \\ 1\begin{pmatrix} 1 \\ 0 \end{pmatrix} \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 1 \\ 0 \end{pmatrix}~~~ \left|{11}\right\rangle = \begin{pmatrix} 0 \begin{pmatrix} 0 \\ 1 \end{pmatrix} \\ 1\begin{pmatrix} 0 \\ 1 \end{pmatrix} \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\1 \end{pmatrix}\end{split} \end{equation}.\end{split}\]

Note we’ve introduced a shorthand for the tensor product of basis vectors, wherein \(\left|0\right\rangle \otimes \left|0\right\rangle\) is written as \(\left|00\right\rangle\). The state of an \(n\)-qubit system can be described using the \(n\)-fold tensor product of single-qubit basis vectors. Notice that the basis vectors for a 2-qubit system are 4-dimensional; in general, the basis vectors of an \(n\)-qubit system are \(2^{n}\)-dimensional, as noted earlier.

Qiskit இல் Basis வெக்டர்

Within the physics community, the qubits of a multi-qubit systems are typically ordered with the first qubit on the left-most side of the tensor product and the last qubit on the right-most side. For instance, if the first qubit is in state \(\left|0\right\rangle\) and second is in state \(\left|1\right\rangle\), their joint state would be \(\left|01\right\rangle\). Qiskit uses a slightly different ordering of the qubits, in which the qubits are represented from the most significant bit (MSB) on the left to the least significant bit (LSB) on the right (little-endian). This is similar to bitstring representation on classical computers, and enables easy conversion from bitstrings to integers after measurements are performed. For the example just given, the joint state would be represented as \(\left|10\right\rangle\). Importantly, this change in the representation of multi-qubit states affects the way multi-qubit gates are represented in Qiskit, as discussed below.

Qiskit இல் பயன்படுத்தப்படும் பிரதிநிதித்துப் புள்ளிவிவரங்களின் அடிப்படை வரிசைகளின் எண்ணிக்கை அதிகரிக்கும்.உதாரணமாக, 2-க்யூபிட் அமைப்புக்கான அடிப்படை திசையன்கள் என வரிசைப்படுத்தப்படும் \(\left|00\right\rangle\), \(\left|01\right\rangle\), \(\left|10\right\rangle\), and \(\left|11\right\rangle\). அடிப்படையிலான வெக்டர்ஸ் (பிட் ஸ்ட்ரிங்ஸ்) ஆகியவற்றின் அடிப்படையில், அவர்கள் எண்ணிக்கை 0,1,2 மற்றும் 3 ஆகியவற்றை குறியீடு செய்யும்.

க்யூட்டில் கட்டுப்படுத்தல் செயல்பாடுகள்

ஒரு பொதுவான பல-விகிதமான வாயிலாக ஒரு வாயிலாக ஒரு விரைவில் பயன்பாட்டை உள்ளடக்கி, மற்றொரு குறும்படத்தின் மாநிலத்தில் காத்திருந்தது. உதாரணமாக, முதல் குவிட் \(\left |0\right\rangle\). இத்தகைய வாயுக்கள் * கட்டுப்படுத்தப்பட்ட வாயுக்கள் * என அறியப்படுகின்றன. நிலையான பெரும்பாலான வாயுக்கள் இரு-கிபைட் வாயுக்கள் மற்றும் மூன்று-கிட் வாயுக்கள் கொண்டது. இரு-கிட் வாயுக்கள்: - கட்டுப்படுத்தப்பட்ட பவுலி வாயில்கள்-கட்டுப்படுத்தப்பட்ட ஹாமார்டு வாயில்-கட்டுப்படுத்தப்பட்ட சுழற்சி வாயில்கள்-கட்டுப்படுத்தப்பட்ட கட்டமைப்பின் வாயிலாக-கட்டுப்படுத்தப்பட்ட u3 வாயில்-swap வாயிலாக

மூன்று-கிட் வாயில்கள்: - Toffoli gate-Fredkin gate

இரண்டு-மேற்கோள் வாயுக்கள்

பெரும்பாலான இரு-கிட் வாயில்கள் கட்டுப்படுத்தப்பட்ட வகை (SWAP கிட்டத்தினை வித்தியாசமாக இருப்பது). பொதுவாக, ஒரு கட்டுப்படுத்தப்பட்ட இரண்டு-விகிதமான வாயில் \(C_{U}\) செயல்பாடு ஒற்றை-விகிதமான \(U\) க்கு இரண்டாவது குறும்படம் \(\left|1\right\rangle\). சாதாரண \(U\) க்கு மேட்ரிக்ஸ் பிரதிநிதித்துவம் உள்ளது

\[\begin{split}U = \begin{pmatrix} u_{00} & u_{01} \\ u_{10} & u_{11}\end{pmatrix}.\end{split}\]

We can work out the action of \(C_{U}\) as follows. Recall that the basis vectors for a two-qubit system are ordered as \(\left|00\right\rangle, \left|01\right\rangle, \left|10\right\rangle, \left|11\right\rangle\). Suppose the control qubit is qubit 0 (which, according to Qiskit’s convention, is one the right-hand side of the tensor product). If the control qubit is in \(\left|1\right\rangle\), \(U\) should be applied to the target (qubit 1, on the left-hand side of the tensor product). Therefore, under the action of \(C_{U}\), the basis vectors are transformed according to

\[\begin{split}\begin{align*} C_{U}: \underset{\text{qubit}~1}{\left|0\right\rangle}\otimes \underset{\text{qubit}~0}{\left|0\right\rangle} &\rightarrow \underset{\text{qubit}~1}{\left|0\right\rangle}\otimes \underset{\text{qubit}~0}{\left|0\right\rangle}\\ C_{U}: \underset{\text{qubit}~1}{\left|0\right\rangle}\otimes \underset{\text{qubit}~0}{\left|1\right\rangle} &\rightarrow \underset{\text{qubit}~1}{U\left|0\right\rangle}\otimes \underset{\text{qubit}~0}{\left|1\right\rangle}\\ C_{U}: \underset{\text{qubit}~1}{\left|1\right\rangle}\otimes \underset{\text{qubit}~0}{\left|0\right\rangle} &\rightarrow \underset{\text{qubit}~1}{\left|1\right\rangle}\otimes \underset{\text{qubit}~0}{\left|0\right\rangle}\\ C_{U}: \underset{\text{qubit}~1}{\left|1\right\rangle}\otimes \underset{\text{qubit}~0}{\left|1\right\rangle} &\rightarrow \underset{\text{qubit}~1}{U\left|1\right\rangle}\otimes \underset{\text{qubit}~0}{\left|1\right\rangle}\\ \end{align*}.\end{split}\]

மாட்ரிக்ஸ் வடிவில், \(C_{U}\)

\[\begin{split}\begin{equation} C_U = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & u_{00} & 0 & u_{01} \\ 0 & 0 & 1 & 0 \\ 0 & u_{10} &0 & u_{11} \end{pmatrix}. \end{equation}\end{split}\]

இந்த மாட்ரிக்ஸ் தனிமங்கள் வெளியே வேலை செய்யவும்

\[C_{(jk), (lm)} = \left(\underset{\text{qubit}~1}{\left\langle j \right|} \otimes \underset{\text{qubit}~0}{\left\langle k \right|}\right) C_{U} \left(\underset{\text{qubit}~1}{\left| l \right\rangle} \otimes \underset{\text{qubit}~0}{\left| m \right\rangle}\right),\]

\(C_{U}\) (மேலே கொடுக்கப்பட்ட) நடவடிக்கையை ஒழுங்குபடுத்தவும், மற்றும் உட்புற பொருட்களை கட்டமைக்கவும்.

கீழே எடுத்துக்காட்டாக காட்டப்பட்டதால், இந்த செயல்பாடு Qiskit இல் cu (q[0], q[1]).

குவிட் 1 என்பது கட்டுப்பாடாகவும், குவிட் 0 இலக்கு ஆகவும் இருந்தால், அடிப்படை திசையன்கள் அதற்கேற்ப மாற்றப்படுகின்றன

\[\begin{split}\begin{align*} C_{U}: \underset{\text{qubit}~1}{\left|0\right\rangle}\otimes \underset{\text{qubit}~0}{\left|0\right\rangle} &\rightarrow \underset{\text{qubit}~1}{\left|0\right\rangle}\otimes \underset{\text{qubit}~0}{\left|0\right\rangle}\\ C_{U}: \underset{\text{qubit}~1}{\left|0\right\rangle}\otimes \underset{\text{qubit}~0}{\left|1\right\rangle} &\rightarrow \underset{\text{qubit}~1}{\left|0\right\rangle}\otimes \underset{\text{qubit}~0}{\left|1\right\rangle}\\ C_{U}: \underset{\text{qubit}~1}{\left|1\right\rangle}\otimes \underset{\text{qubit}~0}{\left|0\right\rangle} &\rightarrow \underset{\text{qubit}~1}{\left|1\right\rangle}\otimes \underset{\text{qubit}~0}{U\left|0\right\rangle}\\ C_{U}: \underset{\text{qubit}~1}{\left|1\right\rangle}\otimes \underset{\text{qubit}~0}{\left|1\right\rangle} &\rightarrow \underset{\text{qubit}~1}{\left|1\right\rangle}\otimes \underset{\text{qubit}~0}{U\left|1\right\rangle}\\ \end{align*},\end{split}\]

இது \(C_{U}\)

\[\begin{split}\begin{equation} C_U = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & u_{00} & u_{01} \\ 0 & 0 & u_{10} & u_{11} \end{pmatrix}. \end{equation}\end{split}\]
[37]:
q = QuantumRegister(2)

கட்டுப்படுத்தப்பட்ட பவுலா ஜேட்ஸ்

கட்டுப்படுத்தப்பட்ட-X (அல்லது, கட்டுப்படுத்தப்பட்ட-NOT) குவாண்டம் லாஜிக் கேட்

The Controlled-NOT gate flips the target qubit when the control qubit is in the state \(\left|1\right\rangle\). If we take the MSB as the control qubit (e.g. cx(q[1],q[0])), then the matrix would look like

\[\begin{split}C_X = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 \end{pmatrix}.\end{split}\]

However, when the LSB is the control qubit, (e.g. cx(q[0],q[1])), this gate is equivalent to the following matrix:

\[\begin{split}C_X = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 \end{pmatrix}.\end{split}\]
[38]:
qc = QuantumCircuit(q)
qc.cx(q[0],q[1])
qc.draw()
[38]:
q60_0: ──■──
       ┌─┴─┐
q60_1: ┤ X ├
       └───┘
[39]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[39]:
array([[1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j],
       [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j],
       [0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j]])

கட்டுப்படுத்தல் \(Y\) வாயில்

கட்டுப்பாட்டு குறும்படம் MSB என்றால் \(Y\) வாயில் இலக்கு விகிதத்தை பயன்படுத்து

\[\begin{split}C_Y = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 0 & -i\\ 0 & 0 & i & 0 \end{pmatrix},\end{split}\]

அல்லது LSB கட்டுப்பாடு பொழுது

\[\begin{split}C_Y = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 0 & 0 & -i\\ 0 & 0 & 1 & 0\\ 0 & i & 0 & 0 \end{pmatrix}.\end{split}\]
[40]:
qc = QuantumCircuit(q)
qc.cy(q[0],q[1])
qc.draw()
[40]:
q60_0: ──■──
       ┌─┴─┐
q60_1: ┤ Y ├
       └───┘
[41]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[41]:
array([[1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.-1.j],
       [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j],
       [0.+0.j, 0.+1.j, 0.+0.j, 0.+0.j]])

கட்டுப்படுத்தப்பட்ட \(Z\) (அல்லது, கட்டுப்படுத்தப்பட்ட ஃபேஸ்-ஃபிளிப்) கேட்

அதேபோல், கட்டுப்படுத்தப்பட்ட Z வாயில் வெப்பம் சிக்குறுத்தும் விகிதத்தை \(\left|1\right\rangle\). MSB அல்லது LSB கட்டுப்பாட்டு குறும்படம் என்பதை இல்லையென்றால் மாட்ரிக்ஸ் ஒரே தெரிகிறது:

\[\begin{split}C_Z = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & -1 \end{pmatrix}\end{split}\]
[42]:
qc = QuantumCircuit(q)
qc.cz(q[0],q[1])
qc.draw()
[42]:
q60_0: ─■─
        │
q60_1: ─■─
          
[43]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[43]:
array([[ 1.-0.j,  0.+0.j,  0.+0.j,  0.+0.j],
       [ 0.+0.j,  1.-0.j,  0.+0.j,  0.+0.j],
       [ 0.+0.j,  0.+0.j,  1.-0.j,  0.+0.j],
       [ 0.+0.j,  0.+0.j,  0.+0.j, -1.+0.j]])

கட்டுப்படுத்தப்பட்ட ஹாட்மார்ட் வாயில்

\(H\) வாயில் இலக்கு விகிதத்தில் கட்டுப்பாட்டு விகிதத்தை \(\left|1\right\rangle\). கீழே, கட்டுமானம் LSB குவிட் எங்கே உள்ளது.

\[\begin{split}C_H = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & \frac{1}{\sqrt{2}} & 0 & \frac{1}{\sqrt{2}}\\ 0 & 0 & 1 & 0\\ 0 & \frac{1}{\sqrt{2}} & 0& -\frac{1}{\sqrt{2}} \end{pmatrix}\end{split}\]
[44]:
qc = QuantumCircuit(q)
qc.ch(q[0],q[1])
qc.draw()
[44]:
q60_0: ──■──
       ┌─┴─┐
q60_1: ┤ H ├
       └───┘
[45]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[45]:
array([[ 1.   +0.j,  0.   +0.j,  0.   +0.j,  0.   +0.j],
       [ 0.   +0.j,  0.707+0.j,  0.   +0.j,  0.707-0.j],
       [ 0.   +0.j,  0.   +0.j,  1.   -0.j,  0.   +0.j],
       [ 0.   +0.j,  0.707+0.j,  0.   +0.j, -0.707+0.j]])

கட்டுப்படுத்தப்பட்ட சுழற்சி வாயுக்கள்

Z-அச்சு சுற்றி கட்டுப்படுத்தும் சுழற்சி

Z-அச்சின் சுழற்சி சுழற்சி சுழற்சி சுழற்சி விகிதத்தில்(இங்கு LSB) \(\left|1\right\rangle\).

\[\begin{split}C_{Rz}(\lambda) = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & e^{-i\lambda/2} & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & e^{i\lambda/2} \end{pmatrix}\end{split}\]
[46]:
qc = QuantumCircuit(q)
qc.crz(pi/2,q[0],q[1])
qc.draw()
[46]:
q60_0: ─────■─────
       ┌────┴────┐
q60_1: ┤ Rz(π/2) ├
       └─────────┘
[47]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[47]:
array([[1.   +0.j   , 0.   +0.j   , 0.   +0.j   , 0.   +0.j   ],
       [0.   +0.j   , 0.707-0.707j, 0.   +0.j   , 0.   +0.j   ],
       [0.   +0.j   , 0.   +0.j   , 1.   +0.j   , 0.   +0.j   ],
       [0.   +0.j   , 0.   +0.j   , 0.   +0.j   , 0.707+0.707j]])

கட்டுப்படுத்தப்பட்ட பக்க சுழற்சி

இரண்டு க்யூட்டுகள் \(\left|11\right\rangle\) மாநிலமாகும். MMSB அல்லது LSB கட்டுப்பாட்டு குறும்படம் இருந்ததா என்பதை இல்லையென்றால் மாட்ரிக்ஸ் ஒரே தெரிகிறது.

\[\begin{split}C_{p}(\lambda) = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & e^{i\lambda} \end{pmatrix}\end{split}\]
[48]:
qc = QuantumCircuit(q)
qc.cp(pi/2,q[0], q[1])
qc.draw()
[48]:
q60_0: ─■───────
        │P(π/2)
q60_1: ─■───────
                
[49]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[49]:
array([[1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+1.j]])

கட்டுப்படுத்தப்பட்டது \(u\) சுழற்சி

Perform controlled-\(u\) rotation on the target qubit if the control qubit (here LSB) is \(\left|1\right\rangle\).

\[\begin{split}C_{u}(\theta, \phi, \lambda) \equiv \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & e^{-i(\phi+\lambda)/2}\cos(\theta/2) & 0 & -e^{-i(\phi-\lambda)/2}\sin(\theta/2)\\ 0 & 0 & 1 & 0\\ 0 & e^{i(\phi-\lambda)/2}\sin(\theta/2) & 0 & e^{i(\phi+\lambda)/2}\cos(\theta/2) \end{pmatrix}.\end{split}\]
[53]:
qc = QuantumCircuit(q)
qc.cu(pi/2, pi/2, pi/2, 0, q[0], q[1])
qc.draw()
[53]:
q60_0: ─────────■──────────
       ┌────────┴─────────┐
q60_1: ┤ U(π/2,π/2,π/2,0) ├
       └──────────────────┘
[54]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[54]:
array([[ 1.   +0.j   ,  0.   +0.j   ,  0.   +0.j   ,  0.   +0.j   ],
       [ 0.   +0.j   ,  0.707+0.j   ,  0.   +0.j   ,  0.   -0.707j],
       [ 0.   +0.j   ,  0.   +0.j   ,  1.   -0.j   ,  0.   +0.j   ],
       [ 0.   +0.j   ,  0.   +0.707j,  0.   +0.j   , -0.707+0.j   ]])

SWAP கிட்டம்

SWAP கிட்டத்தட்ட இரண்டு க்விட்ஸை வெளியேற்றுகிறது. இது அடிப்படை வெக்டர்களை மாற்றுகிறது

\[\left|00\right\rangle \rightarrow \left|00\right\rangle~,~\left|01\right\rangle \rightarrow \left|10\right\rangle~,~\left|10\right\rangle \rightarrow \left|01\right\rangle~,~\left|11\right\rangle \rightarrow \left|11\right\rangle,\]

இது வடிவத்தின் ஒரு மாட்ரிக்ஸ் பிரதிநிதித்தைக் கொடுக்கிறது

\[\begin{split}\mathrm{SWAP} = \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1 \end{pmatrix}.\end{split}\]
[55]:
qc = QuantumCircuit(q)
qc.swap(q[0], q[1])
qc.draw()
[55]:
q60_0: ─X─
        │
q60_1: ─X─
          
[56]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[56]:
array([[1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j],
       [0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j]])

இரண்டு-மேற்கோள் வாயுக்கள்

இரு முக்கோணங்கள் மூன்று-பிட் வாயுக்களும் உள்ளன. மூன்று குறும்படங்களுக்காக, அடிப்படை வெக்டர்களை அளிக்கப்படுகின்றன

\[\left|000\right\rangle, \left|001\right\rangle, \left|010\right\rangle, \left|011\right\rangle, \left|100\right\rangle, \left|101\right\rangle, \left|110\right\rangle, \left|111\right\rangle,\]

இது,பிட்ஸ்ட்ரிங்ஸாக, முழு எண்களைக் குறிக்கிறது \(0,1,2, \cdots, 7\). மீண்டும், கிஸ்கிட் ஒரு பிரதிநிதித்துவத்தைப் பயன்படுத்துகிறது, இதில் முதல் குவிட் டென்சர் தயாரிப்பின் வலதுபுறத்திலும் மூன்றாவது குவிட் இடதுபுறத்திலும் உள்ளது:

\[\left|abc\right\rangle : \underset{\text{qubit 2}}{\left|a\right\rangle}\otimes \underset{\text{qubit 1}}{\left|b\right\rangle}\otimes \underset{\text{qubit 0}}{\left|c\right\rangle}.\]

Toffoli gate (\(ccx\) gate)

டோஃபோலி கேட் முதல் இரண்டு குவிட்கள் (LSB) இரண்டும் இருந்தால் மூன்றாவது குவிட்டைப் புரட்டுகிறது \(\left|1\right\rangle\):

\[\left|abc\right\rangle \rightarrow \left|bc\oplus a\right\rangle \otimes \left|b\right\rangle \otimes \left|c\right\rangle.\]

மாட்ரிக்ஸ் வடிவில் டோஃப்லோலி வாயிலாக உள்ளது

\[\begin{split}C_{CX} = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \end{pmatrix}.\end{split}\]
[57]:
q = QuantumRegister(3)
[58]:
qc = QuantumCircuit(q)
qc.ccx(q[0], q[1], q[2])
qc.draw()
[58]:
q105_0: ──■──
          │
q105_1: ──■──
        ┌─┴─┐
q105_2: ┤ X ├
        └───┘
[59]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[59]:
array([[1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.-0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.-0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.-0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.-0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j]])

கட்டுப்படுத்தப்பட்ட swap வாயில் (Fredkin Gate)

The Fredkin gate, அல்லது கட்டுப்படுத்தப்பட்ட இடமாற்று வாயில், முதல் குவிட் (LSB) என்றால் இரண்டாவது மற்றும் மூன்றாவது குவிட்களை பரிமாறிக்கொள்கிறது \(\left|1\right\rangle\):

\[\left|abc\right\rangle \rightarrow \begin{cases} \left|bac\right\rangle~~\text{if}~c=1 \cr \left|abc\right\rangle~~\text{if}~c=0 \end{cases}.\]

அணி வடிவத்தில், ஃப்ரெட்ரிக்ஸ் கேட் உள்ளது

\[\begin{split}C_{\mathrm{SWAP}} = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \end{pmatrix}.\end{split}\]
[60]:
qc = QuantumCircuit(q)
qc.cswap(q[0], q[1], q[2])
qc.draw()
[60]:
q105_0: ─■─
         │
q105_1: ─X─
         │
q105_2: ─X─
           
[61]:
job = backend.run(transpile(qc, backend))
job.result().get_unitary(qc, decimals=3)
[61]:
array([[1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.-0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.-0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.-0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.-0.j]])

கூடுதலான செயல்பாடுகள்

இப ் பொழுது நாம ் அனைத ் தத ் தில ் சென ் றோம ். இவை அளவீடுகள், குறும்படங்களின் மறுமலைகள், மற்றும் சாதாரண சம்பந்தமான செயல்பாடுகள் ஆகியவை அடங்கும்.

[62]:
q = QuantumRegister(1)
c = ClassicalRegister(1)

மேற்கோள்கள்

We don’t have access to all the information when we make a measurement in a quantum computer. The quantum state is projected onto the standard basis. Below are two examples showing a circuit that is prepared in a basis state and the quantum computer prepared in a superposition state.

[63]:
qc = QuantumCircuit(q, c)
qc.measure(q, c)
qc.draw()
[63]:
      ┌─┐
q124: ┤M├
      └╥┘
c0: 1/═╩═
       0 
[64]:
backend = BasicAer.get_backend('qasm_simulator')
job = backend.run(transpile(qc, backend))
job.result().get_counts(qc)
[64]:
{'0': 1024}

சிகிச்சை 100 சதவீதத்தின்படி, கிளாசிரியர் பதிவு 0 என்று காட்டும்.

[65]:
qc = QuantumCircuit(q, c)
qc.h(q)
qc.measure(q, c)
qc.draw()
[65]:
      ┌───┐┌─┐
q124: ┤ H ├┤M├
      └───┘└╥┘
c0: 1/══════╩═
            0 
[66]:
job = backend.run(transpile(qc, backend))
job.result().get_counts(qc)
[66]:
{'1': 532, '0': 492}

பாரம்பரியக் கோட்பாடு 50 சதவீதத்தின்படி நுழைவு பதிவு 0 அல்லது 1 என்று காட்டும்.

மீட்டமை

இது \(\left|0\right\rangle\) கணக்கீட்டின் நடுவில் நிலை. reset என்பதை ஒரு கேட் செயல்பாடு இல்லை என்பதை கவனிக்கவும், அது அறுதியாக உள்ளது.

[67]:
qc = QuantumCircuit(q, c)
qc.reset(q[0])
qc.measure(q, c)
qc.draw()
[67]:
           ┌─┐
q124: ─|0>─┤M├
           └╥┘
c0: 1/══════╩═
            0 
[68]:
job = backend.run(transpile(qc, backend))
job.result().get_counts(qc)
[68]:
{'0': 1024}
[69]:
qc = QuantumCircuit(q, c)
qc.h(q)
qc.reset(q[0])
qc.measure(q, c)
qc.draw()
[69]:
      ┌───┐     ┌─┐
q124: ┤ H ├─|0>─┤M├
      └───┘     └╥┘
c0: 1/═══════════╩═
                 0 
[70]:
job = backend.run(transpile(qc, backend))
job.result().get_counts(qc)
[70]:
{'0': 1024}

இந்த இரண்டு சுற்றுகளுக்கும் சிமுலேட்டர் எப்போதும் 0 நிலையில் வெளியீடு 100 சதவீதம் என்று கணிக்கிறது என்பதை இங்கே காண்கிறோம்.

நிபந்தனை செயல்பாடுகள்

செம்மொழி பதிவு நிலையிலான செயல்பாடுகள் கூட இயலாது

[71]:
qc = QuantumCircuit(q, c)
qc.x(q[0]).c_if(c, 0)
qc.measure(q,c)
qc.draw()
[71]:
       ┌───┐ ┌─┐
q124: ─┤ X ├─┤M├
       └─╥─┘ └╥┘
      ┌──╨──┐ ║
c0: 1/╡ 0x0 ╞═╩═
      └─────┘ 0 

இங்கு சாதாரண பிட் எப்போதும் மதிப்பு 0 எடுத்துக்கொள்ளும் எனவே குவிட் மாநிலம் எப்பொழுதும் ஒழுங்குபடுத்துகிறது.

[72]:
job = backend.run(transpile(qc, backend))
job.result().get_counts(qc)
[72]:
{'1': 1024}
[73]:
qc = QuantumCircuit(q, c)
qc.h(q)
qc.measure(q,c)
qc.x(q[0]).c_if(c, 0)
qc.measure(q,c)
qc.draw()
[73]:
      ┌───┐┌─┐ ┌───┐ ┌─┐
q124: ┤ H ├┤M├─┤ X ├─┤M├
      └───┘└╥┘ └─╥─┘ └╥┘
            ║ ┌──╨──┐ ║
c0: 1/══════╩═╡ 0x0 ╞═╩═
            0 └─────┘ 0 
[74]:
job = backend.run(transpile(qc, backend))
job.result().get_counts(qc)
[74]:
{'1': 1024}

இங்கு முதன்மையான அளவிலான அளவு ஒழுங்குபடுத்தப்பட்டுள்ளது ஆனால் குறும்படத்திலுள்ள செயல் முடிவுகளின் முடிவுகள் \(\left|1\right\rangle\).

மாநில ஆரம்பம்

ஒரு தன்னிச்சையான நிலைக்கு ஒரு குவிட் பதிவேட்டை தொடங்க விரும்பினால் என்ன செய்வது? இதற்கான ஒரு தன்னிச்சையான நிலை \(n\) குவிட்ஸ் ஒரு திசையன் மூலம் குறிப்பிடப்படலாம் \(2^n\) பெருக்கங்கள், அங்கு வீச்சு-விதிமுறைகள்-சதுரங்களின் தொகை சமம் 1. எடுத்துக்காட்டாக, பின்வரும் மூன்று-குவிட் நிலை ஆயத்தமாக இரு:

\[\left|\psi\right\rangle = \frac{i}{4}\left|000\right\rangle + \frac{1}{\sqrt{8}}\left|001\right\rangle + \frac{1+i}{4}\left|010\right\rangle + \frac{1+2i}{\sqrt{8}}\left|101\right\rangle + \frac{1}{4}\left|110\right\rangle\]
[79]:
# Initializing a three-qubit quantum state
import math
desired_vector = [
    1 / math.sqrt(16) * complex(0, 1),
    1 / math.sqrt(8) * complex(1, 0),
    1 / math.sqrt(16) * complex(1, 1),
    0,
    0,
    1 / math.sqrt(8) * complex(1, 2),
    1 / math.sqrt(16) * complex(1, 0),
    0]


q = QuantumRegister(3)

qc = QuantumCircuit(q)

qc.initialize(desired_vector, [q[0],q[1],q[2]])
qc.draw()
[79]:
        ┌───────────────────────────────────────────────────────────────────┐
q233_0: ┤0                                                                  ├
        │                                                                   │
q233_1: ┤1 Initialize(0.25j,0.35355,0.25+0.25j,0,0,0.35355+0.70711j,0.25,0) ├
        │                                                                   │
q233_2: ┤2                                                                  ├
        └───────────────────────────────────────────────────────────────────┘
[80]:
backend = BasicAer.get_backend('statevector_simulator')
job = backend.run(transpile(qc, backend))
qc_state = job.result().get_statevector(qc)
qc_state
[80]:
array([1.52655666e-16+2.50000000e-01j, 3.53553391e-01+5.55111512e-17j,
       2.50000000e-01+2.50000000e-01j, 0.00000000e+00+0.00000000e+00j,
       0.00000000e+00+0.00000000e+00j, 3.53553391e-01+7.07106781e-01j,
       2.50000000e-01-9.02056208e-17j, 0.00000000e+00+0.00000000e+00j])

Fidelity இரண்டு மாநிலங்கள் ஒரே அல்லது இல்லையா என்பதை சரிபார்க்கவும் பயன்படுகிறது.குவாண்டம் (தூய்மையான) நிலைகளுக்கு \(\left|\psi_1\right\rangle\) and \(\left|\psi_2\right\rangle\), நம்பகத்தன்மை

\[F\left(\left|\psi_1\right\rangle,\left|\psi_2\right\rangle\right) = \left|\left\langle\psi_1\middle|\psi_2\right\rangle\right|^2.\]

இரு மாநிலங்களும் சமம் என்றால் மட்டுமே \(1\) க்கு சமமானது.

[81]:
state_fidelity(desired_vector,qc_state)
[81]:
1.0000000000000004

மேலும் விவரங்கள்:

திரைக்கு பின்னால் விரும்பிய நிலை எவ்வாறு உருவாகிறது? இதைச் செய்ய பல முறைகள் உள்ளன. கிஸ்கிட் ஷெண்டே மற்றும் பலர் முன்மொழியப்பட்ட ஒரு முறையைப் பயன்படுத்துகிறார். இங்கே, குவாண்டம் பதிவேட்டை நாம் விரும்பிய நிலையிலிருந்து ஆரம்பித்ததாகக் கருதி, அதை எடுத்துச் செல்லும் ஒரு சுற்று ஒன்றை உருவாக்குதல் \(\left|00..0\right\rangle\) நிலை. துவக்க சுற்று பின்னர் அத்தகைய சுற்றுக்கு தலைகீழ் ஆகும்.

கணக்கீட்டு அடிப்படையில் ஒரு தன்னிச்சையான குவாண்டம் நிலையை பூஜ்ஜிய நிலைக்கு எடுத்துச் செல்ல, பதிவேட்டில் இருந்து குவிட்களை ஒவ்வொன்றாக பிரிக்கும் ஒரு செயல்பாட்டு செயல்முறையை நாங்கள் செய்கிறோம். எந்தவொரு தன்னிச்சையான ஒற்றை-குவிட் நிலை \(\left|\rho\right\rangle\)\(\left|0\right\rangle\) நிலைக்கு ஒரு \(\phi\)-இசட் அச்சைப் பற்றிய டிகிரி சுழற்சி தொடர்ந்து ஒரு: math:` தீட்டா` டிகிரி சுழற்சி Y அச்சு பற்றி:

\[R_y(-\theta)R_z(-\phi)\left|\rho\right\rangle = re^{it}\left|0\right\rangle\]

இப்போது நாம் \(n\) qubits க்கு பதிலாக 1, நாம் ஒரு மாநில வெக்டரை தனிப்பயனாக்க வேண்டும், Least Significant Bit (LSB):

\[\begin{split}\begin{align*} \left|\psi\right\rangle =& \alpha_{0_0}\left|00..00\right\rangle + \alpha_{0_1}\left|00..01\right\rangle + \alpha_{1_0}\left|00..10\right\rangle + \alpha_{1_1}\left|00..11\right\rangle + ... \\&+ \alpha_{(2^{n-1}-1)_0}\left|11..10\right\rangle + \alpha_{(2^{n-1}-1)_1}\left|11..11\right\rangle \\ =& \left|00..0\right\rangle (\alpha_{0_0}\left|0\right\rangle + \alpha_{0_1}\left|1\right\rangle) + \left|00..1\right\rangle (\alpha_{1_0}\left|0\right\rangle + \alpha_{1_1}\left|1\right\rangle) + ... \\&+ \left|11..1\right\rangle (\alpha_{(2^{n-1}-1)_0}(\left|0\right\rangle + \alpha_{(2^{n-1}-1)_1}\left|1\right\rangle) \\ =& \left|00..0\right\rangle\left|\rho_0\right\rangle + \left|00..1\right\rangle\left|\rho_1\right\rangle + ... + \left|11..1\right\rangle\left|\rho_{2^{n-1}-1}\right\rangle \end{align*}\end{split}\]

இப்போது ஒற்றை-குவிட் ஒவ்வொன்றும் கூறுகிறது \(\left|\rho_0\right\rangle,..., \left|\rho_{2^{n-1}-1}\right\rangle\) to \(\left|0\right\rangle\) பொருத்தமானதைக் கண்டுபிடிப்பதன் மூலம் \(\phi\) மற்றும் \(\theta\) மேலே உள்ள சமன்பாட்டின் கோணங்கள்.. எல்லா மாநிலங்களிலும் ஒரே நேரத்தில் இதைச் செய்வது பின்வரும் ஒற்றுமைக்கு சமம், இது LSB ஐத் துண்டிக்கிறது:

\[\begin{split}U = \begin{pmatrix} R_{y}(-\theta_0)R_{z}(-\phi_0) & & & &\\ & R_{y}(-\theta_1)R_{z}(-\phi_1) & & &\\ & . & & &\\ & & . & &\\ & & & & R_y(-\theta_{2^{n-1}-1})R_z(-\phi_{2^{n-1}-1}) \end{pmatrix}\end{split}\]

எனவே,

\[\begin{split}U\left|\psi\right\rangle = \begin{pmatrix} r_0e^{it_0}\\ r_1e^{it_1}\\ . \\ . \\ r_{2^{n-1}-1}e^{it_{2^{n-1}-1}} \end{pmatrix}\otimes\left|0\right\rangle\end{split}\]

U can be implemented as a "quantum multiplexor" gate, since it is a block diagonal matrix. In the quantum multiplexor formalism, a block diagonal matrix of size \(2^n \times 2^n\), and consisting of \(2^s\) blocks, is equivalent to a multiplexor with \(s\) select qubits and \(n-s\) data qubits. Depending on the state of the select qubits, the corresponding blocks are applied to the data qubits. A multiplexor of this kind can be implemented after recursive decomposition to primitive gates of cx, rz and ry.

[82]:
import qiskit.tools.jupyter
%qiskit_version_table
%qiskit_copyright

Version Information

Qiskit SoftwareVersion
qiskit-terra0.20.2
qiskit-aer0.10.4
qiskit-ignis0.7.1
qiskit-ibmq-provider0.19.1
qiskit0.36.2
qiskit-optimization0.3.2
qiskit-machine-learning0.4.0
System information
Python version3.10.4
Python compilerMSC v.1916 64 bit (AMD64)
Python buildmain, Mar 30 2022 08:38:02
OSWindows
CPUs6
Memory (Gb)15.869640350341797
Sat May 28 10:03:32 2022 Eastern Daylight Time

This code is a part of Qiskit

© Copyright IBM 2017, 2022.

This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.

Any modifications or derivative works of this code must retain this
copyright notice, and modified files need to carry a notice indicating
that they have been altered from the originals.

[ ]: