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

дописать алгоритм Саймона с Qiskit на Pennylane #355

Closed
Yorko opened this issue Dec 20, 2021 · 10 comments · Fixed by #370
Closed

дописать алгоритм Саймона с Qiskit на Pennylane #355

Yorko opened this issue Dec 20, 2021 · 10 comments · Fixed by #370
Labels
next-run Issue for the next run of the course

Comments

@Yorko
Copy link
Collaborator

Yorko commented Dec 20, 2021

No description provided.

@Yorko Yorko added the next-run Issue for the next run of the course label Dec 20, 2021
@SemyonSinchenko
Copy link
Collaborator

А зачем? Диверсити это хорошо, Qiskit очень популярен и для штук, типа саймона он удобнее кмк

@vvssttkk
Copy link
Member

скорее это вызвано тем, что в начале курса пишем мол дальше только pennylane

@vvssttkk vvssttkk changed the title Переписать алгоритм Саймона с Qiskit на Pennylane дописать алгоритм Саймона с Qiskit на Pennylane Dec 22, 2021
@flatslm
Copy link
Contributor

flatslm commented Jan 14, 2022

Добрый день

Тут имеется в виду реализация qnode c единственным измерением в конце?
Что то навроде:
'''
NN = 3

dev = qml.device('default.qubit', shots=128, wires=NN*2)

def simon_start(N: int):
  for i in range(N):
          qml.Hadamard(wires=i)
def simon_oracle(N: int):
  qml.CNOT(wires=[0, N])

def simon_after_oracle(N: int):
  for i in range(N):
          qml.Hadamard(wires=i)
@qml.qnode(dev)
def simon_circuit(N: int):
  simon_start(N)
  simon_oracle(N)
  simon_after_oracle(N)
  wx = range(0, N)
  wy = range(N, N*2)
  return qml.sample(wires=wx),qml.sample(wires=wy)
x,y = simon_circuit(N=NN)
print(x)
print(y)

fig, ax = qml.draw_mpl(simon_circuit)(N=NN)
fig.show()


Или строгое соответствие описанию алгоритам (т.е. в конце измерение 2-го регистра, а затем снова Hadamar - что в рамках qnode пока не работает, и не понятно - будет ли)?

@vvssttkk
Copy link
Member

vvssttkk commented Jan 17, 2022

@flatslm извините что так долго отвечали, спасибо за сообщение

суть задачи состоит в том, чтобы код, который сейчас в https://quantum-ods.github.io/qmlcourse/book/qcalgo/simon_algorithm.html#id5 был написан и на pl, соответственно должен делать всё то же самое, что и на qiskit

@SemyonSinchenko
Copy link
Collaborator

Я может туплю, но в вики схемка с измерениями в конце. https://en.wikipedia.org/wiki/Simon%27s_problem
Оно так получится ведь?

@flatslm
Copy link
Contributor

flatslm commented Jan 17, 2022

Да, схемка такая получается, но если сравнить с последовательностью шагов 3-4-5 из лекции, (и скорее всего и из оригинальной статьи), то немного расходится. У слушаетелей должны возникнуть вопросы 8 -)
Если ок, то в ближайшие дни вставлю.
Пулл-реквесты лить на прямую или через свой форк?

@SemyonSinchenko
Copy link
Collaborator

Пулл-реквесты лить на прямую или через свой форк?

Через ветку в этом репозитории. Когда PR из форка у нас CI ломался раньше. Ты же в контрибьюторах тут? Или надо добавить?

@flatslm
Copy link
Contributor

flatslm commented Jan 17, 2022

Да, был в контрибьютерах.
Но сейчас получил - remote: Permission to SemyonSinchenko/qmlcourse.git denied to flatslm.

@flatslm
Copy link
Contributor

flatslm commented Jan 17, 2022

Как бы посмотреть результат мержа?
http://54.89.156.216/370_merge/_build/html/book/ как то не отображает

@SemyonSinchenko
Copy link
Collaborator

Вот результат:
https://gh-qmlc-deploy-branch.herokuapp.com/book/qcalgo/simon_algorithm.html

Выглядит норм.

vvssttkk added a commit that referenced this issue Jan 22, 2022
* implement #355, add pennylane implementaion of simon algorithm

* add an empty line

* add note about difference of schemes

* fix note

* minor correction of Note, and renaming and some spaces

* add to lec auth @flatslm and little bit refactor code

* Update qmlcourseRU/book/qcalgo/simon_algorithm.md

* Update qmlcourseRU/book/qcalgo/simon_algorithm.md

* detailing the result returned by the schema

* Update qmlcourseRU/book/qcalgo/simon_algorithm.md

* Update qmlcourseRU/book/qcalgo/simon_algorithm.md

* add returned type annotation

* style: apply

* Update qmlcourseRU/book/qcalgo/simon_algorithm.md

Co-authored-by: vtrokhymenko <8581044+vtrokhymenko@users.noreply.github.com>
Co-authored-by: viktor trokhymenko <trokhymenkoviktor@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next-run Issue for the next run of the course
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants