This function computes the density matrix for a given object, optionally taking into account a grouping variable.
Usage
density_matrix(x, groups, ...)
Arguments
- x
The input object for which the density matrix should be computed.
- groups
An optional grouping variable to consider when computing the density matrix.
- ...
Additional arguments to be passed to the density matrix computation method.
Value
A density matrix representing the input object, taking into account the specified grouping variable if provided.
Examples
# Example usage of the density_matrix function
input_object <- # input object data
grouping_variable <- # optional grouping variable
result_density_matrix <- density_matrix(input_object, groups = grouping_variable)
#> Error: object 'input_object' not found