qemcmc.spectralgap

Classes

SpectralGap

Class that finds the spectral gap, and the acceptance and proposal matrices for a given mcmc.

Module Contents

class qemcmc.spectralgap.SpectralGap(proposal: qemcmc.sampler.Proposal, model: qemcmc.model.energy_model.EnergyModel, temp: float = 1.0)[source]

Bases: qemcmc.sampler.runners.Runner

Class that finds the spectral gap, and the acceptance and proposal matrices for a given mcmc.

proposal[source]
model[source]
temp = 1.0[source]
find_acceptance_matrix()[source]

Function to find the acceptance matrix for a given model instance.

Returns:

The acceptance matrix for the mcmc

Return type:

A (np.ndarray)

find_proposal_matrix_local()[source]

Function to find the proposal matrix for a given local chain.

Returns:

The Q matrix for local proposal

Return type:

Q (np.ndarray)

find_proposal_matrix_uniform()[source]

Function to find the proposal matrix for a given uniform chain.

Returns:

The Q matrix for uniform proposal

Return type:

Q (np.ndarray)

find_proposal_matrix_quantum()[source]

Function to find the proposal matrix for a given QeMCMCChain object.

Returns:

The Q matrix for quantum proposal

Return type:

Q (np.ndarray)

find_proposal_matrix_brute_force(multiple=100)[source]
find_proposal_matrix()[source]

Function to find the proposal matrix for a given mcmc. This is not done by brute force

find_spectral_gap(A=None, Q=None)[source]

Function to find the spectral gap of a given mcmc.

Parameters:
  • (np.ndarray) (Q) – The acceptance matrix for the mcmc (optional, if not given, will be calculated)

  • (np.ndarray) – The proposal matrix for the mcmc (optional, if not given, will be calculated)