Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skill: Qiskit coding skills for Bell States and Deutsch algorithm #1323

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compositional_skills/technology/attribution.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Title of work: Basic quantum gates - Bell and Deutsch oracles
License of the work: MIT
Creator names: Sasha Lazarevic
37 changes: 37 additions & 0 deletions compositional_skills/technology/qna.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
created_by: lzrvc-ibm
version: 3
task_description: >-
This is code that will teach the student model on how to code Bell states and
Deutsch algorithm
seed_examples:
- question: give me the Qiskit code for the qubit gates for the first Bell state
answer: |-
qc.h(q[0])
qc.cx(q[0],q[1])
- question: give me the Qiskit code for the qubit gates for the second Bell state
answer: |-
qc.h(q[0])
qc.cx(q[0],q[1])
qc.z(q[0])
- question: give me the Qiskit code for the qubit gates for the third Bell state
answer: |-
qc.h(q[0])
qc.cx(q[0],q[1])
qc.x(q[1])
- question: give me the Qiskit code for the qubit gates for the fourth Bell state
answer: |-
qc.h(q[0])
qc.cx(q[0],q[1])
qc.z(q[0])
qc.x(q[1])
- question: >-
give me the Qiskit code for the qubit gates for the implementation of
oracle function for Deutsch algorithm
answer: |-
def blackbox(oracleType=None):

if oracleType == None:
oracleType = np.random.randint(4)

oracles = {0: 'qc.iden(q[1])', 1: 'qc.x(q[1])', 2: 'qc.cx(q[0], q[1])', 3: 'qc.cx(q[0], q[1]), qc.x(q[1])'}
return oracles[oracleType]