Microsoft.Quantum.Diagnostics namespace

Operations

Name Summary
AllowAtMostNCallsCA Between a call to this operation and its adjoint, asserts that a given operation is called at most a certain number of times.
AllowAtMostNQubits Between a call to this operation and its adjoint, asserts that at most a given number of additional qubits are allocated with using statements.
AssertAllZero Assert that given qubits are all in $\ket{0}$ state.
AssertAllZeroWithinTolerance Assert that given qubits are all in $\ket{0}$ state up to a given tolerance.
AssertMeasurement Asserts that measuring the given qubits in the given Pauli basis will always have the given result.
AssertMeasurementProbability Asserts that measuring the given qubits in the given Pauli basis will have the given result with the given probability, within some tolerance.
AssertOperationsEqualInPlace Given two operations, asserts that they act identically for all input states.
AssertOperationsEqualInPlaceCompBasis Checks if the operation givenU is equal to the operation expectedU on the given input size by checking the action of the operations only on the vectors from the computational basis. This is a necessary, but not sufficient, condition for the equality of two unitaries.
AssertOperationsEqualReferenced Given two operations, asserts that they act identically for all input states.
AssertPhase Asserts that the phase of an equal superposition state has the expected value.
AssertQubit Asserts that the qubit q is in the expected eigenstate of the Pauli Z operator.
AssertQubitIsInStateWithinTolerance Asserts that a qubit in the expected state.
AssertQubitWithinTolerance Asserts that the qubit q is in the expected eigenstate of the Pauli Z operator up to a given tolerance.
DumpOperation Given an operation, displays diagnostics about the operation that are made available by the current execution target.

Functions

Name Summary
AllEqualityFactB Asserts that two arrays of boolean values are equal.
AllEqualityFactI Asserts that two arrays of integer values are equal.
Contradiction Declares that a classical condition is false.
DumpMachine Dumps the current target machine's status.
DumpRegister Dumps the current target machine's status associated with the given qubits.
EqualityFactB Asserts that a classical Bool variable has the expected value.
EqualityFactC Asserts that a complex number has the expected value.
EqualityFactCP Asserts that a complex number has the expected value.
EqualityFactI Asserts that a classical Int variable has the expected value.
EqualityFactL Asserts that a classical BigInt variable has the expected value.
EqualityFactR Asserts that a classical Result variable has the expected value.
EqualityWithinToleranceFact Represents the claim that a classical floating point value has the expected value up to a given absolute tolerance.
Fact Declares that a classical condition is true.
FiniteFact Declares that a given floating-point value represents a finite number, failing when this is not the case.
NearEqualityFactC Asserts that a classical complex number has the expected value up to a small tolerance of 1e-10.
NearEqualityFactCP Asserts that a classical complex number has the expected value up to a small tolerance of 1e-10.
NearEqualityFactD Asserts that a classical floating point value has the expected value up to a small tolerance of 1e-10.

User-defined types

Name Summary
EnableTestingViaName Compiler-recognized attribute via which an alternative name can be defined that may be used when loading a type or callable for testing purposes.
Test Compiler-recognized attribute used to mark a unit test.