AdcMatrix

class adcc.AdcMatrix(method, hf_or_mp, block_orders=None, intermediates=None, diagonal_precomputed=None)

Bases: adcc.AdcMatrix.AdcMatrixlike

Initialise an ADC matrix.

Parameters
  • method (str or AdcMethod) – Method to use.

  • hf_or_mp (adcc.ReferenceState or adcc.LazyMp) – HF reference or MP ground state

  • block_orders (optional) – The order of perturbation theory to employ for each matrix block. If not set, defaults according to the selected ADC method are chosen.

  • intermediates (adcc.Intermediates or NoneType) – Allows to pass intermediates to re-use to this class.

  • diagonal_precomputed (adcc.AmplitudeVector) – Allows to pass a pre-computed diagonal, for internal use only.

Attributes Summary

axis_blocks

Return the blocks used along one of the axes of the ADC matrix (e.g.

blocks

default_block_orders

Methods Summary

block_apply(block, tensor)

Compute the application of a block of the ADC matrix with another AmplitudeVector or Tensor.

block_spaces(block)

block_view(block)

Return a view into the AdcMatrix that represents a single block of the matrix.

compute_apply(block, tensor)

compute_matvec(ampl)

Compute the matrix-vector product of the ADC matrix with an excitation amplitude and return the result.

construct_symmetrisation_for_blocks()

Construct the symmetrisation functions, which need to be applied to relevant blocks of an AmplitudeVector in order to symmetrise it to the right symmetry in order to be used with the various matrix-vector-products of this function.

dense_basis([axis_blocks, ordering])

Return the list of indices and their values of the dense basis representation

diagonal([block])

Return the diagonal of the ADC matrix

has_block(block)

matvec(*args, **kwargs)

Compute the matrix-vector product of the ADC matrix with an excitation amplitude and return the result.

rmatvec(v)

to_ndarray([out])

Return the ADC matrix object as a dense numpy array.

Attributes Documentation

axis_blocks

Return the blocks used along one of the axes of the ADC matrix (e.g. [‘ph’, ‘pphh’]).

blocks
default_block_orders = {'adc0': {'ph_ph': 0, 'ph_pphh': None, 'pphh_ph': None, 'pphh_pphh': None}, 'adc1': {'ph_ph': 1, 'ph_pphh': None, 'pphh_ph': None, 'pphh_pphh': None}, 'adc2': {'ph_ph': 2, 'ph_pphh': 1, 'pphh_ph': 1, 'pphh_pphh': 0}, 'adc2x': {'ph_ph': 2, 'ph_pphh': 1, 'pphh_ph': 1, 'pphh_pphh': 1}, 'adc3': {'ph_ph': 3, 'ph_pphh': 2, 'pphh_ph': 2, 'pphh_pphh': 1}}

Methods Documentation

block_apply(block, tensor)

Compute the application of a block of the ADC matrix with another AmplitudeVector or Tensor. Non-matching blocks in the AmplitudeVector will be ignored.

block_spaces(block)
block_view(block)

Return a view into the AdcMatrix that represents a single block of the matrix. Currently only diagonal blocks are supported.

compute_apply(block, tensor)
compute_matvec(ampl)

Compute the matrix-vector product of the ADC matrix with an excitation amplitude and return the result.

construct_symmetrisation_for_blocks()

Construct the symmetrisation functions, which need to be applied to relevant blocks of an AmplitudeVector in order to symmetrise it to the right symmetry in order to be used with the various matrix-vector-products of this function.

Most importantly the returned functions antisymmetrise the occupied and virtual parts of the doubles parts if this is sensible for the method behind this adcmatrix.

Returns a dictionary block identifier -> function

dense_basis(axis_blocks=None, ordering='adcc')

Return the list of indices and their values of the dense basis representation

ordering: adcc, spin, spatial

diagonal(block=None)

Return the diagonal of the ADC matrix

has_block(block)
matvec(*args, **kwargs)

Compute the matrix-vector product of the ADC matrix with an excitation amplitude and return the result.

rmatvec(v)
to_ndarray(out=None)

Return the ADC matrix object as a dense numpy array. Converts the sparse internal representation of the ADC matrix to a dense matrix and return as a numpy array.

Notes

This method is only intended to be used for debugging and visualisation purposes as it involves computing a large amount of matrix-vector products and the returned array consumes a considerable amount of memory.

The resulting matrix has no spin symmetry imposed, which means that its eigenspectrum may contain non-physical excitations (e.g. with linear combinations of α->β and α->α components in the excitation vector).

This function has not been sufficiently tested to be considered stable.