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

OSCHINA-MIRROR/mirrors-quantum

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
TeleportationTests.qs 1.1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Chris Granade Отправлено 21.07.2021 03:24 bebdfc9
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.Quantum.Samples.UnitTesting {
open Microsoft.Quantum.Canon;
open Microsoft.Quantum.Intrinsic;
open Microsoft.Quantum.Diagnostics;
/// # Summary
/// If the Teleportation circuit is correct this operation must be an identity
operation ApplyIdentityWithTeleport(arg : Qubit[]) : Unit {
EqualityFactI(Length(arg), 1, "Helper is defined only on single qubit input");
use auxiliary = Qubit();
RunTeleportation(arg[0], auxiliary);
SWAP(arg[0], auxiliary);
}
/// # Summary
/// Tests the correctness of the teleportation circuit from Teleportation.qs
@Test("QuantumSimulator")
operation CheckTeleportIdentityIsNoOp() : Unit {
// given that there is randomness involved in the Teleportation,
// repeat the tests several times.
for idxIteration in 1 .. 8 {
for assertion in [AssertOperationsEqualInPlace, AssertOperationsEqualReferenced] {
assertion(1, ApplyIdentityWithTeleport, NoOp<Qubit[]>);
}
}
}
}

Опубликовать ( 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