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

OSCHINA-MIRROR/mirrors-quantum

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
README.md 2.9 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Chris Granade Отправлено 20.07.2021 02:51 f04301e

Unit Testing Sample

This sample set illustrates techniques for testing the correctness of the circuits and computing metrics describing circuits such as number of qubits used, gate counts and depth. We implement, test and compute metrics for the circuits from the following categories

Each file illustrating the category is accompanied with the file ending "Tests" with test for the circuits. The list of the test files is below:

Operations and functions from the Q# standard library used for testing

The correctness of all the programs in this sample is tested using functionality from the Q# standard library:

  • AssertOperationsEqualReferenced
  • AssertOperationsEqualInPlace
  • AssertQubitState

Test harness

This sample uses Microsoft.Quantum.Xunit extension to xUnit.net framework to automatically discover Q# tests. The tests are all the operations with signature "() => ()" with suffix "Test". The test harness located in QuantumSimulatorTestTargets.cs.

Metrics calculation

In addition to testing the correctness of the circuit we also compute their metrics such as gate counts, depth and number of qubit used. Metrics calculation is illustrated in files ending "Metrics":

File MetricCalculationUtils.cs contains the function that creates QCTraceSimulator configured for metric calculation.

Sample dependencies

This samples uses Microsoft.Quantum.Canon library and depends on the following NuGet packages:

  • Microsoft.Quantum.Development.Kit: Q# runtime framework
  • Microsoft.Quantum.Xunit: xUnit.net extension for discovering Q# tests
  • xunit: xUnit.net testing framework for .NET

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