1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/mirrors-quantum

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
host.py 737
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Chris Granade Отправлено 20.08.2020 19:41 b3fc88d
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# # Reversible Logic Synthesis
#
# This sample demonstrates:
# - How to use Q# to decompose permutations into quantum operations.
# - How to apply decomposed permutations in algorithms such as hidden shift.
import qsharp
from Microsoft.Quantum.Samples.ReversibleLogicSynthesis import SimulatePermutation, FindHiddenShift
if __name__ == "__main__":
perm = [0, 2, 3, 5, 7, 1, 4, 6]
res = SimulatePermutation.simulate(perm=perm)
print(f'Does circuit realize permutation: {res}')
for shift in range(len(perm)):
measure = FindHiddenShift.simulate(perm=perm, shift=shift)
print(f'Applied shift = {shift} Measured shift: {measure}')

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/mirrors-quantum.git
git@api.gitlife.ru:oschina-mirror/mirrors-quantum.git
oschina-mirror
mirrors-quantum
mirrors-quantum
main