Numeric reference
NumericBraggInterferometer class
- class mwave.numeric.NumericBraggInterferometer(kmin, kmax, distance, kpad=10, x0=0, t0=0, k0=0)
A class for numerically simulating Bragg interferometers. This class allows for the definition of an interferometer geometry and the numerical propagation of wavefunctions through that geometry. See Numeric interferometer usage for example usage.
- get_nodes()
Returns a dictionary of nodes at the current level, organized by momentum and position.
- Returns:
A dictionary where keys are momentum states, values are dictionaries of positions, and values of those dictionaries are lists of nodes at that momentum and position.
- get_population_func(momentums, func_pop_init, func_wf_init, func_wf2_init)
Returns a function that computes the population for a given set of output momentums.
- Parameters:
momentums – A list of output momentums to compute the population for.
func_pop_init – A function that computes the initial population.
func_wf_init – A function that computes the initial wavefunction.
func_wf2_init – A function that computes the initial wavefunction (secondary, used in calculation).
- Returns:
A function that takes
comm_argsand returns the total population at the specified momentums.
- propagate(t)
Propagates the state of all nodes at the current level for a time
t.- Parameters:
t – The duration of the propagation.
- set_operation_funcs(funcs)
Sets the functions used to numerically evaluate the operations (split, propagate) performed on the interferometer.
- Parameters:
funcs – A list of functions corresponding to the operations performed on the interferometer, in order.
- split(klattice)
Applies a Bragg diffraction splitting operation to all nodes at the current level.
- Parameters:
klattice – The lattice wavevector(s) for the Bragg pulse. Can be a single value or a list of values.
NumericTreeNode class
- class mwave.numeric.NumericTreeNode(interferometer, x, t, k, parent=None)
Basic implementation of a directed tree. Children are stored in a list.
- Parameters:
parent_node – The parent node of the new node. Must be a
TreeNode. Optional.
- get_ancestry()
Returns a list of ancestor nodes from the root node to this node.
- Returns:
A list of
NumericTreeNodeobjects.
- get_trajectory()
Returns the trajectory (time and position) of the node and its ancestors.
- Returns:
A tuple
(times, positions)containing lists of times and positions.
- get_wf_func(func_init)
Returns a function that computes the wavefunction at this node by tracing back through its ancestry and applying the operation functions.
- Parameters:
func_init – The function to compute the initial wavefunction.
- Returns:
A function that computes the wavefunction.
- propagate(T)
Propagates the node for a time
T, creating a single child node.- Parameters:
T – The duration of propagation.
- split(klattice, distance=4, filter_func=<function NumericTreeNode.<lambda>>)
Splits the node based on Bragg diffraction, creating child nodes for the diffracted states.
- Parameters:
klattice – The lattice wavevector(s).
distance – The number of momentum states to keep around the diffraction orders. Defaults to 4.
filter_func – A function to filter which child nodes are created. Defaults to allowing all.