Note
இந்த பக்கம் tutorials/circuits_advanced/07_pulse_scheduler.ipynb இலிருந்து உருவாக்கப்பட்டது.
திட்டமிடுபவரைப் பயன்படுத்துதல்¶
கேட் மற்றும் அளவீட்டு calibrations களைப் பயன்படுத்தி, QuantumCircuit
ஐ ஒரு பல்ஸுக்கு Schedule
என்று திட்டமிடுபவர் மொழிபெயர்ப்பார்: குறிப்பிட்ட க்யூபிட்களில் ஒரு செயல்பாட்டின் உகந்த பல்ஸ்-நிலை விளக்கம்.
ஓப்பன் பல்ஸ் இயக்கப்பட்ட பின்தளத்தில் பொதுவாக அளவீடுகள் மற்றும் அதன் ஒவ்வொரு அடிப்படை வாயில்களுக்கும் வரையறுக்கப்பட்ட அளவுத்திருத்தங்கள் இருக்கும். அளவுத்திருத்தங்களை பயனரால் வரையறுக்கலாம் அல்லது புதுப்பிக்கலாம்.
அடிப்படை பயன்பாடு¶
தொடங்க, நீங்கள் சாதாரணமாக ஒரு குவாண்டம் சுற்று உருவாக்க. கீழே உள்ள எங்கள் எடுத்துக்காட்டுக்கு, நாங்கள் ஒரு எளிய பெல் நிலையை உருவாக்குகிறோம்.
[1]:
from qiskit import QuantumCircuit
circ = QuantumCircuit(2, 2)
circ.h(0)
circ.cx(0, 1)
circ.measure([0, 1], [0, 1])
circ.draw("mpl")
[1]:

We’ll use the mocked backend, FakeHanoi
, to demonstrate how to use the scheduler. It contains default calibrations for measurement and for its basis gates. The Hadamard operation is not one of those basis gates, so we use the transpiler to compile our input circuit to an equivalent circuit in terms of the basis gates of the device.
[2]:
from qiskit import transpile, schedule as build_schedule
from qiskit.providers.fake_provider import FakeHanoi
backend = FakeHanoi()
transpiled_circ = transpile(circ, backend) # Undefined Hadamard is replaced by U1
schedule = build_schedule(transpiled_circ, backend)
Let’s see how our schedule schedule
built from the circuit transpiled_circ
looks.
[3]:
schedule.draw()
[3]:

That covers the basics! We used the transpiler to rewrite the circuit in terms of the basis gates, and then used the backend’s default calibrations to schedule the transpiled circuit. Next we will go through scheduling with calibrations we will build ourselves.
தனிப்பயன் கேட் வரையறைகளுடன் திட்டமிடல்¶
உங்கள் உள்ளீட்டு சுற்று அளவீடுகள் வரையறுக்கப்பட்டிருந்தால், உங்கள் சுற்று திட்டமிடும்போது அது அந்த அளவுத்திருத்தங்களைப் பயன்படுத்தும்.
[4]:
from qiskit import pulse
with pulse.build() as h_q0:
pulse.play(pulse.library.Gaussian(duration=256, amp=0.2, sigma=50, name='custom'),
pulse.DriveChannel(0))
circ.add_calibration('h', [0], h_q0)
schedule = build_schedule(circ, backend)
schedule.draw()
[4]:

D0
இன் ஆரம்ப துடிப்பு, ஹடமார்ட் கேட் இப்போது எங்கள் தனிப்பயன் துடிப்புடன் செயல்படுத்தப்படுவதைக் கவனியுங்கள்.
திட்டமிடல் முறைகள்¶
திட்டமிடுபவர் பல நடைமுறைகளைப் பின்பற்றலாம். இயல்பாக, இது as late as possible (ALAP) விதியைப் பின்பற்றுகிறது. மற்றொரு திட்டமிடல் முறை as soon as possible, (ASAP). இரண்டு முறைகளுக்கும், வெளியீட்டு அட்டவணை மிகக் குறைவு: உள்ளீட்டு சுற்றுகளின் நீண்ட கால செயல்பாட்டு பாதையில், ஒவ்வொரு செயல்பாட்டின் தொடக்க நேரமும் முந்தைய செயல்பாட்டின் இறுதி நேரம். அந்த நீண்ட பாதைக்கு வெளியே செயல்பாடுகளை எவ்வாறு திட்டமிடுவது என்பதை முறைகள் தீர்மானிக்கின்றன.
இது ஒரு எடுத்துக்காட்டு மூலம் தெளிவுபடுத்தப்படுகிறது:
[5]:
circ = QuantumCircuit(2, 2)
circ.x(0)
circ.x(0)
circ.x(1)
circ.measure([0, 1], [0, 1])
circ.draw("mpl")
[5]:

எங்கள் கேலி செய்யப்பட்ட பின்தளத்தில், இவை \(X\) கேட் செயல்பாடுகள் ஒவ்வொன்றும் ஒரே கால அளவு (duration = 160 dt
). அட்டவணை மிகக் குறைவாக இருக்க, இரண்டு \(X\) க்யூபிட் 0 இல் X செயல்பாடுகள் பின்-பின்-திட்டமிடப்படும், மற்றும் அளவீட்டு துடிப்பு உடனடியாக அந்த பருப்புகளில் இரண்டைப் பின்தொடரும்.
குறைவான கட்டுப்பாட்டு செயல்பாடுகளை திட்டமிட சமீபத்திய சரியான நேரத்தை ALAP தேர்வு செய்யும், எனவே க்யூபிட் 1 இல் \(X\) கேட் கூபிட் 0 இல் இரண்டாவது \(X\) கேட்டுடன் ஒத்திசைவாக செயல்படும்.
[6]:
schedule = build_schedule(circ, backend, method="as_late_as_possible")
schedule.filter(channels=[pulse.DriveChannel(0), pulse.DriveChannel(1)]).draw()
[6]:

மறுபுறம், பெயர் குறிப்பிடுவது போல, ASAP அதன் வளங்கள் இலவசமானவுடன் செயல்பாடுகளை திட்டமிடும். எனவே, க்யூபிட் 1 இல் \(X\) கேட் time = 0
என திட்டமிடப்படும், இது க்யூபிட் 0 இல் முதல் \(X\) கேட் உடன் ஒத்திருக்கும்.
[7]:
schedule = build_schedule(circ, backend, method="as_soon_as_possible")
schedule.filter(channels=[pulse.DriveChannel(0), pulse.DriveChannel(1)]).draw()
[7]:

ALAP இயல்புநிலையாகும், ஏனெனில் இது க்யூபிட்களை முடிந்தவரை சும்மா இருக்க அனுமதிக்கிறது. இந்த வழக்கில், ALAP க்கும் ASAP க்கும் இடையிலான வேறுபாடு மிகக் குறைவாக இருக்கலாம், ஆனால் ALAP இல், அளவீட்டுக்கு முன் உற்சாகமான நிலையிலிருந்து சிதைவதற்கு க்யூபிட் 0 க்கு நேரம் இல்லை.
[8]:
import qiskit.tools.jupyter
%qiskit_version_table
%qiskit_copyright
Version Information
Qiskit Software | Version |
---|---|
qiskit-terra | 0.20.2 |
qiskit-aer | 0.10.4 |
qiskit-ignis | 0.7.1 |
qiskit-ibmq-provider | 0.19.1 |
qiskit | 0.36.2 |
System information | |
Python version | 3.9.9 |
Python compiler | GCC 11.1.0 |
Python build | main, Dec 29 2021 22:19:36 |
OS | Linux |
CPUs | 32 |
Memory (Gb) | 125.64827728271484 |
Wed Sep 21 09:33:41 2022 EDT |
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.