Skip to content

Commit

Permalink
Add doc strings for rust implemented num_qubits and num_clbits
Browse files Browse the repository at this point in the history
  • Loading branch information
jlapeyre committed Jun 4, 2024
1 parent b087eb4 commit 2ffac76
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/circuit/src/circuit_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ impl CircuitData {
self.qubits.clone_ref(py)
}

/// Return the number of qubits. This is equivalent to the length of the list returned by
/// :meth:`.CircuitData.qubits`
///
/// Returns:
/// int: The number of qubits.
#[getter]
pub fn num_qubits(&self) -> usize {
self.qubits_native.len()
Expand All @@ -240,6 +245,11 @@ impl CircuitData {
self.clbits.clone_ref(py)
}

/// Return the number of clbits. This is equivalent to the length of the list returned by
/// :meth:`.CircuitData.clbits`.
///
/// Returns:
/// int: The number of clbits.
#[getter]
pub fn num_clbits(&self) -> usize {
self.clbits_native.len()
Expand Down

0 comments on commit 2ffac76

Please sign in to comment.