pub struct PyMultiDeterminantsComplex { /* private fields */ }Expand description
Python-exposed structure to marshall complex multi-determinant information between Rust and Python.
Implementations§
Source§impl PyMultiDeterminantsComplex
impl PyMultiDeterminantsComplex
Sourcepub fn new(
basis: Vec<PySlaterDeterminantComplex>,
coefficients: Bound<'_, PyArray2<Complex<f64>>>,
energies: Bound<'_, PyArray1<Complex<f64>>>,
density_matrices: Option<Vec<Bound<'_, PyArray2<Complex<f64>>>>>,
threshold: f64,
) -> Self
pub fn new( basis: Vec<PySlaterDeterminantComplex>, coefficients: Bound<'_, PyArray2<Complex<f64>>>, energies: Bound<'_, PyArray1<Complex<f64>>>, density_matrices: Option<Vec<Bound<'_, PyArray2<Complex<f64>>>>>, threshold: f64, ) -> Self
Constructs a set of complex Python-exposed multi-determinants.
§Arguments
basis- The basis of Slater determinants in which the multi-determinantal states are expressed.coefficients- The coefficients for the multi-determinantal states in the specified basis. Each column of the coefficient matrix contains the coefficients for one state.energies- The energies of the multi-determinantal states.density_matrices- The optional density matrices of the multi-determinantal states.threshold- The threshold for comparisons.
pub fn coefficients<'py>( &self, py: Python<'py>, ) -> PyResult<Bound<'py, PyArray2<Complex<f64>>>>
pub fn energies<'py>( &self, py: Python<'py>, ) -> PyResult<Bound<'py, PyArray1<Complex<f64>>>>
pub fn density_matrices<'py>( &self, py: Python<'py>, ) -> PyResult<Option<Vec<Bound<'py, PyArray2<Complex<f64>>>>>>
Sourcepub fn complex_symmetric<'py>(&self, _py: Python<'py>) -> PyResult<bool>
pub fn complex_symmetric<'py>(&self, _py: Python<'py>) -> PyResult<bool>
Boolean indicating whether inner products involving these multi-determinantal states are complex-symmetric.
Sourcepub fn state_coefficients<'py>(
&self,
py: Python<'py>,
state_index: usize,
) -> PyResult<Bound<'py, PyArray1<Complex<f64>>>>
pub fn state_coefficients<'py>( &self, py: Python<'py>, state_index: usize, ) -> PyResult<Bound<'py, PyArray1<Complex<f64>>>>
Returns the coefficients for a particular state.
Sourcepub fn state_energy<'py>(
&self,
_py: Python<'py>,
state_index: usize,
) -> PyResult<Complex<f64>>
pub fn state_energy<'py>( &self, _py: Python<'py>, state_index: usize, ) -> PyResult<Complex<f64>>
Returns the energy for a particular state.
Sourcepub fn state_density_matrix<'py>(
&self,
py: Python<'py>,
state_index: usize,
) -> PyResult<Bound<'py, PyArray2<Complex<f64>>>>
pub fn state_density_matrix<'py>( &self, py: Python<'py>, state_index: usize, ) -> PyResult<Bound<'py, PyArray2<Complex<f64>>>>
Returns the density matrix for a particular state.
Source§impl PyMultiDeterminantsComplex
impl PyMultiDeterminantsComplex
Sourcepub fn to_qsym2<'b, 'a: 'b, SC>(
&'b self,
baos: &[&'a BasisAngularOrder<'_>],
mol: &'a Molecule,
) -> Result<Vec<MultiDeterminant<'b, Complex<f64>, EagerBasis<SlaterDeterminant<'b, Complex<f64>, SC>>, SC>>, Error>where
SC: StructureConstraint + Eq + Hash + Clone + Display + TryFrom<PyStructureConstraint, Error = Error>,
pub fn to_qsym2<'b, 'a: 'b, SC>(
&'b self,
baos: &[&'a BasisAngularOrder<'_>],
mol: &'a Molecule,
) -> Result<Vec<MultiDeterminant<'b, Complex<f64>, EagerBasis<SlaterDeterminant<'b, Complex<f64>, SC>>, SC>>, Error>where
SC: StructureConstraint + Eq + Hash + Clone + Display + TryFrom<PyStructureConstraint, Error = Error>,
Extracts the information in the PyMultiDeterminantsComplex structure into QSym2’s native
MultiDeterminant structure.
§Arguments
baos- TheBasisAngularOrders for the basis set in which the Slater determinant is given, one for each explicit component per coefficient matrix.mol- The molecule with which the Slater determinant is associated.
§Returns
The A vector of MultiDeterminant structures, one for each multi-determinantal state
contained in the Python version.
§Errors
Errors if the MultiDeterminant structures fail to build.
Trait Implementations§
Source§impl Clone for PyMultiDeterminantsComplex
impl Clone for PyMultiDeterminantsComplex
Source§fn clone(&self) -> PyMultiDeterminantsComplex
fn clone(&self) -> PyMultiDeterminantsComplex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'py> IntoPyObject<'py> for PyMultiDeterminantsComplex
impl<'py> IntoPyObject<'py> for PyMultiDeterminantsComplex
Source§type Target = PyMultiDeterminantsComplex
type Target = PyMultiDeterminantsComplex
The Python output type
Source§type Output = Bound<'py, <PyMultiDeterminantsComplex as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <PyMultiDeterminantsComplex as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
Source§impl PyClass for PyMultiDeterminantsComplex
impl PyClass for PyMultiDeterminantsComplex
Source§impl PyClassImpl for PyMultiDeterminantsComplex
impl PyClassImpl for PyMultiDeterminantsComplex
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)]
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
Source§const RAW_DOC: &'static CStr = c"Python-exposed structure to marshall complex multi-determinant information between Rust and\nPython.\x00"
const RAW_DOC: &'static CStr = c"Python-exposed structure to marshall complex multi-determinant information between Rust and\nPython.\x00"
Docstring for the class provided on the struct or enum. Read more
Source§const DOC: &'static CStr
const DOC: &'static CStr
Fully rendered class doc, including the
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<PyMultiDeterminantsComplex>
type ThreadChecker = SendablePyClass<PyMultiDeterminantsComplex>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§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 PyClassNewTextSignature for PyMultiDeterminantsComplex
impl PyClassNewTextSignature for PyMultiDeterminantsComplex
const TEXT_SIGNATURE: &'static str = "(basis, coefficients, energies, density_matrices, threshold)"
Source§impl<'a, 'holder, 'py> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder PyMultiDeterminantsComplex
impl<'a, 'holder, 'py> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder PyMultiDeterminantsComplex
Source§impl<'a, 'holder, 'py> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder mut PyMultiDeterminantsComplex
impl<'a, 'holder, 'py> PyFunctionArgument<'a, 'holder, 'py, false> for &'holder mut PyMultiDeterminantsComplex
Source§impl PyMethods<PyMultiDeterminantsComplex> for PyClassImplCollector<PyMultiDeterminantsComplex>
impl PyMethods<PyMultiDeterminantsComplex> for PyClassImplCollector<PyMultiDeterminantsComplex>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for PyMultiDeterminantsComplex
impl PyTypeInfo for PyMultiDeterminantsComplex
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type.impl DerefToPyAny for PyMultiDeterminantsComplex
Auto Trait Implementations§
impl Freeze for PyMultiDeterminantsComplex
impl RefUnwindSafe for PyMultiDeterminantsComplex
impl Send for PyMultiDeterminantsComplex
impl Sync for PyMultiDeterminantsComplex
impl Unpin for PyMultiDeterminantsComplex
impl UnwindSafe for PyMultiDeterminantsComplex
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
§impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
§fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
Converts
self into a Python object. Read more§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.