Struct rustiq_core::structures::clifford_circuit::CliffordCircuit
source · pub struct CliffordCircuit {
pub nqbits: usize,
pub gates: Vec<CliffordGate>,
}
Fields§
§nqbits: usize
§gates: Vec<CliffordGate>
Implementations§
source§impl CliffordCircuit
impl CliffordCircuit
pub fn new(nqbits: usize) -> Self
pub fn random(nqubits: usize, ngates: usize) -> Self
pub fn extend_with(&mut self, other: &CliffordCircuit)
sourcepub fn cnot_count(&self) -> usize
pub fn cnot_count(&self) -> usize
Counts the number of CNOT gates
sourcepub fn entangling_count(&self) -> usize
pub fn entangling_count(&self) -> usize
Counts the number of CNOT gates
sourcepub fn cnot_depth(&self) -> usize
pub fn cnot_depth(&self) -> usize
Computes the CNOT depth of the circuit
sourcepub fn entangling_depth(&self) -> usize
pub fn entangling_depth(&self) -> usize
Computes the CNOT depth of the circuit
Trait Implementations§
source§impl Debug for CliffordCircuit
impl Debug for CliffordCircuit
source§impl PyClassImpl for CliffordCircuit
impl PyClassImpl for CliffordCircuit
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§type Layout = PyCell<CliffordCircuit>
type Layout = PyCell<CliffordCircuit>
Layout
§type ThreadChecker = ThreadCheckerStub<CliffordCircuit>
type ThreadChecker = ThreadCheckerStub<CliffordCircuit>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a CliffordCircuit
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a CliffordCircuit
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut CliffordCircuit
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut CliffordCircuit
source§impl PyTypeInfo for CliffordCircuit
impl PyTypeInfo for CliffordCircuit
§type AsRefTarget = PyCell<CliffordCircuit>
type AsRefTarget = PyCell<CliffordCircuit>
Utility type to make Py::as_ref work.
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object
is an instance of this type.Auto Trait Implementations§
impl Freeze for CliffordCircuit
impl RefUnwindSafe for CliffordCircuit
impl Send for CliffordCircuit
impl Sync for CliffordCircuit
impl Unpin for CliffordCircuit
impl UnwindSafe for CliffordCircuit
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more