Skip to content

Commit

Permalink
Add doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
swernli committed Aug 5, 2024
1 parent eaf32a3 commit 19af3dd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions library/std/src/diagnostics.qs
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,28 @@ namespace Microsoft.Quantum.Diagnostics {
body intrinsic;
}

/// # Summary
/// Starts counting the number of qubits allocated. The counter is reset to zero.
///
/// # Description
/// This operation allows you to count the number of qubits allocated until `StopCountingQubits` is called.
/// As part of starting the counting, the counter is reset to zero, which may override a previous count.
/// The counter is incremented only when a new unique qubit is allocated, so reusing the same qubit multiple times
/// across separate allocations does not increment the counter.
@Config(Unrestricted)
operation StartCountingQubits() : Unit {
body intrinsic;
}

/// # Summary
/// Stops counting the number of qubits allocated and returns the count.
///
/// # Description
/// This operation allows you to stop counting the number of qubits allocated and returns the count since the
/// last call to `StartCountingQubits`.
///
/// # Output
/// The number of unique qubits allocated since the last call to `StartCountingQubits`.
@Config(Unrestricted)
operation StopCountingQubits() : Int {
body intrinsic;
Expand Down

0 comments on commit 19af3dd

Please sign in to comment.