Skip to content

pmm_tools.partial_trace

Functions

NameDescription
compute_basisCompute the basis of the fermionic operators in the Hilbert space.
reduced_operatorCompute the operator defined as the outer product of state_e and state_o.
remove_termsRemove the terms in the expression that have support over the subspace.
separate_subspaceSeparate the operators in the state into two lists: one for the subspace

compute_basisfunction#

def compute_basis(fermions)

Compute the basis of the fermionic operators in the Hilbert space.

Parameters

NameTypeDescription
fermionslist

List of FermionOp objects representing the fermionic operators.

Returns

symbolic_listlist

List of products of fermionic operators corresponding to the basis states.

reduced_operatorfunction#

def reduced_operator(state_e, state_o, subspace, complement, prefactor=sympy.S.One)

Compute the operator defined as the outer product of state_e and state_o. The reduced operator has support only over the complement of the subspace.

Parameters

NameTypeDescription
state_esympy.Expression

Even ground state.

state_osympy.Expression

Odd ground state.

subspacelist

List of fermionic operators in the subspace.

complementlist

List of fermionic operators in the complement of the subspace.

Returns

operatorsympy.Expression

Outer product as fermionic operator.

remove_termsfunction#

def remove_terms(expr, subspace)

Remove the terms in the expression that have support over the subspace.

Parameters

NameTypeDescription
exprsympy.Expression

The expression to be modified.

subspacelist

List of fermionic operators in the subspace.

Returns

exprsympy.Expression

The modified expression.

separate_subspacefunction#

def separate_subspace(state, subspace)

Separate the operators in the state into two lists: one for the subspace and one for the complement of the subspace.

Parameters

NameTypeDescription
statesympy.Expression

The state to be separated.

subspacelist

List of fermionic operators in the subspace.

Returns

ops_subspacesympy.Expression

Terms in the subspace.

ops_complementsympy.Expression

Terms in the complement of the subspace.