time_evolution module

class time_evolution.TimeEvolutionProblem(circuit: pyjjasim.josephson_circuit.Circuit, time_step=0.05, time_step_count=1000, current_phase_relation=<pyjjasim.static_problem.DefaultCPR object>, external_flux=0.0, current_sources=0.0, voltage_sources=0.0, temperature=0.0, store_time_steps=None, store_theta=True, store_voltage=True, store_current=True, config_at_minus_1: Optional[numpy.ndarray] = None, config_at_minus_2: Optional[numpy.ndarray] = None, config_at_minus_3: Optional[numpy.ndarray] = None, config_at_minus_4: Optional[numpy.ndarray] = None, stencil_width=3)[source]

Define multiple time evolution problems with varying parameters in a Josephson circuit.

  • All problems are computed in one call (ofter faster than computing one by one).

  • The problem count is abbreviated with the symbol W.

  • Use self.compute() to obtain a TimeEvolutionResult object containing the resulting time evolution.

  • Be careful input arrays for Is, f, etc. have the correct shape. See numpy broadcasting for details https://numpy.org/doc/stable/user/basics.broadcasting.html Remember Nj is number of junctions, Nn is number of nodes and Nf is number of faces.

Parameters
circuitCircuit

Josephson circuit on which the problem is based.

time_step=0.05 :

Time between consecutive steps (abbreviated dt).

time_step_count=1000Nt

Total number of time steps in evolution (abbreviated Nt).

current_phase_relation= DefaultCPR()

Current-phase relation (abbreviated cp).

external_flux=0.0array broadcastable to (Nf, W, Nt).

Normalized external flux per site, called external_flux (abbreviated f)

external_flux (alternative)f(i) -> array broadcastable to (Nf, W) for i in range(Nt)

Alternative input type for external_flux using a function.

current_sourcesarray broadcastable to (Nj, W, Nt)

Current source strength at each junction in circuit (abbreviated Is).

current_sources (alternative)Is(i) -> array broadcastable to (Nj, W) for i in range(Nt)

Alternative input type for current_sources using a function.

voltage_sources=0.0array broadcastable to (Nj, W, Nt)

Voltage source value at each junction in circuit (abbreviated Vs).

voltage_sources (alternative)Vs(i) -> array broadcastable to (Nj, W) for i in range(Nt)

Alternative input type for voltage_sources using a function.

temperature=0.0array broadcastable to (Nj, W, Nt)

Temperature at each junction in circuit (abbreviated T).

temperature (alternative)T(i) -> array broadcastable to (Nj, W) for i in range(Nt)

Alternative input type for temperature using a function.

store_time_steps=Nonearray in range(Nt), mask of shape (Nt,) or None

Indicate at which timesteps data is stored in the output array(s).

store_theta=Truebool

If true, theta (the gauge invarian t phase difference) is stored during a time evolution (at timesteps specified with store_time_steps) and returned when simulation is done.

store_voltage=Truebool

If true, voltage is stored during a time evolution (at timesteps specified with store_time_steps) and returned when simulation is done.

store_current=Truebool

If true, voltage is stored during a time evolution (at timesteps specified with store_time_steps) and returned when simulation is done.

config_at_minus_1=None(Nj, W) array or StaticConfiguration or None

initial condition at timestep=-1. set to self.get_static_problem(t=0,n=z).compute()

config_at_minus_2=None(Nj, W) array or StaticConfiguration or None

initial condition at timestep=-2

Notes

  • All physical quantities are dimensionless. See the UserManual (on github) for how all quantities are normalized.

  • It is assumed each junction has a current source and voltage source see user manual (on github) for diagram of junction. To omit the sources in particular junctions set the respective values to zero.

  • To use a node-based source current (represented as an (Nn,) array Is_node with current in/e-jected at each node), convert it to a junction-based source with Is = static_problem.node_to_junction_current(circuit, Is_node) and use Is as input for a time evolution.

  • The store parameters allow one to control what quantities are stored at what timesteps. Only the base quantities theta, voltage and current can be stored in the resulting TimeEvolutionResult; other quantities like energy or magnetic_flux are computed based on these. See documentation of TimeEvolutionResult to see per quantity which base quantities are required.

Methods

compute()

Compute time evolution on an Josephson Circuit.

get_circuit()

Returns the circuit.

get_current_phase_relation()

Returns the current-phase relation.

get_current_sources()

Returns the current sources (abbreviated Is).

get_external_flux()

Returns the external_flux (abbreviated f).

get_net_sourced_current(time_step)

Gets the sum of all (positive) current injected at nodes to create Is.

get_node_current_sources(time_step)

Returns (Nn,) array of currents injected at nodes to create Is.

get_phase_zone()

Returns the phase zone (In all of pyJJAsim phase_zone=0).

get_problem_count()

Return number of problems (abbreviated W).

get_static_problem(vortex_configuration[, ...])

Return a static problem with properties copied from this time evolution.

get_store_current()

Return if current is stored during a time evolution.

get_store_theta()

Return if theta is stored during a time evolution.

get_store_time_steps()

Return at which timesteps data is stored in the output array(s).

get_store_voltage()

Return if voltage is stored during a time evolution.

get_temperature()

Return temperature at each junction (abbreviated T)

get_time()

Return (Nt,) array with time value at each step of evolution.

get_time_step()

Return the timestep (abbreviated dt).

get_time_step_count()

Return the number of timesteps (abbreviated Nt).

get_voltage_sources()

Return voltage sources at each junction (abbreviated Vs)

compute() time_evolution.TimeEvolutionResult[source]

Compute time evolution on an Josephson Circuit.

get_circuit() pyjjasim.josephson_circuit.Circuit[source]

Returns the circuit.

get_current_phase_relation()[source]

Returns the current-phase relation.

get_current_sources()[source]

Returns the current sources (abbreviated Is).

get_external_flux()[source]

Returns the external_flux (abbreviated f).

get_net_sourced_current(time_step)[source]

Gets the sum of all (positive) current injected at nodes to create Is.

Parameters
time_stepint

Time step at which to return net sourced current.

Returns
net_sourced_current(W,) array

Net sourced current through array for each problem at specified timestep.

get_node_current_sources(time_step)[source]

Returns (Nn,) array of currents injected at nodes to create Is.

Parameters
time_stepint

Time step at which to return node currents.

Returns
node_current(Nn, W) array

Node currents for each problem at specified timestep.

get_phase_zone()[source]

Returns the phase zone (In all of pyJJAsim phase_zone=0).

get_problem_count()[source]

Return number of problems (abbreviated W).

get_static_problem(vortex_configuration, problem_nr=0, time_step=0) pyjjasim.static_problem.StaticProblem[source]

Return a static problem with properties copied from this time evolution.

Parameters
vortex_configuration(Nf,) array or None

Vortex configuration of returned static problem.

problem_nr=0int in range(W)

Selected problem number to copy properties of.

time_step=0int in range(Nt)

Selected timestep to copy properties of.

Returns
——-
static_problemStaticProblem

Static problem where the parameters are copied from this time evolution.

get_store_current()[source]

Return if current is stored during a time evolution.

get_store_theta()[source]

Return if theta is stored during a time evolution.

get_store_time_steps()[source]

Return at which timesteps data is stored in the output array(s).

config_at_minus_1=None(Nj, W) array or StaticConfiguration or None

initial condition at timestep=-1. set to self.get_static_problem(t=0,n=z).compute()

config_at_minus_2=None(Nj, W) array or StaticConfiguration or None

initial condition at timestep=-2

get_store_voltage()[source]

Return if voltage is stored during a time evolution.

get_temperature()[source]

Return temperature at each junction (abbreviated T)

get_time()[source]

Return (Nt,) array with time value at each step of evolution.

get_time_step()[source]

Return the timestep (abbreviated dt).

get_time_step_count()[source]

Return the number of timesteps (abbreviated Nt).

get_voltage_sources()[source]

Return voltage sources at each junction (abbreviated Vs)

class time_evolution.TimeEvolutionResult(problem: time_evolution.TimeEvolutionProblem, theta, current, voltage)[source]

Represents data of simulated time evolution(s) on a Josephson circuit.

One can query several properties of the circuit configurations, like currents and voltages. TimeEvolutionResult only store theta, current and voltage data from which all quantities are computed. However, one can choose not to store all three to save memory. An error is raised if one attempts to compute a property for which the required data is not stored.

Methods

animate([problem_nr, time_points, fig, ...])

Animate time evolution of a problem as a movie.

get_capacitive_energy([select_time_points])

Return energy stored in capacitors at each junction.

get_circuit()

Return Josephson circuit.

get_current([select_time_points])

Return current through junctions.

get_cycle_current([select_time_points])

Return cycle-current J around faces.

get_energy([select_time_points])

Return total energy associated with each junction.

get_flux([select_time_points])

Return magnetic flux through faces.

get_josephson_energy([select_time_points])

Return Josephson energy of junctions.

get_magnetic_energy([select_time_points])

Return magnetic energy associated with wires.

get_phase([select_time_points])

Return node phases.

get_potential([select_time_points])

Return voltage potential at nodes.

get_problem_count()

Return number of problems (abbreviated W).

get_supercurrent([select_time_points])

Return supercurrent through junctions.

get_theta([select_time_points])

Return gauge invariant phase differences.

get_voltage([select_time_points])

Return voltage over junctions.

get_vortex_configuration([select_time_points])

Return vorticity at faces.

plot([problem_nr, time_point, fig, ...])

Visualize a problem at a specified timestep.

select_static_configuration(prob_nr, time_step)

Return a StaticConfiguration object with the data copied from this result for a given problem number at a given timestep.

animate(problem_nr=0, time_points=None, fig=None, node_quantity=None, junction_quantity='I', face_quantity=None, vortex_quantity='n', show_grid=True, show_nodes=True, return_plot_handle=False, **kwargs)[source]

Animate time evolution of a problem as a movie.

See circuit_visualize.TimeEvolutionMovie for documentation.

Returns
figmatplotlib figure handle

Returns figure handle

axmatplotlib axis handle

Returns axis handle

plot_handleTimeEvolutionMovie (optional)

Object used to create the movie

Attributes
return_plot_handle=Falsebool

If True this method returns the TimeEvolutionMovie object used to create the movie.

get_capacitive_energy(select_time_points=None)[source]

Return energy stored in capacitors at each junction. Requires voltage to be stored.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
EC(Nj, W, nr_of_selected_timepoints) array

Energy stored in capacitors

get_circuit() pyjjasim.josephson_circuit.Circuit[source]

Return Josephson circuit.

get_current(select_time_points=None) numpy.ndarray[source]

Return current through junctions.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
I(Nj, W, nr_of_selected_timepoints) array

Current.

get_cycle_current(select_time_points=None) numpy.ndarray[source]

Return cycle-current J around faces. Requires current to be stored. Defined as I = A.T @ J + I_source.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
J(Nf, W, nr_of_selected_timepoints) array

Cycle-current around faces.

get_energy(select_time_points=None) numpy.ndarray[source]

Return total energy associated with each junction. Requires theta, current and voltage to be stored.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
Etot(Nj, W, nr_of_selected_timepoints) array

Total energy associated with each junction.

get_flux(select_time_points=None) numpy.ndarray[source]

Return magnetic flux through faces. Requires current to be stored. Defined as f + (A @ L @ I) / (2 * pi).

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
flux(Nf, W, nr_of_selected_timepoints) array

Magnetic flux through faces

get_josephson_energy(select_time_points=None) numpy.ndarray[source]

Return Josephson energy of junctions. Requires theta to be stored.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
EJ(Nf, W, nr_of_selected_timepoints) array

Josephson energy.

get_magnetic_energy(select_time_points=None) numpy.ndarray[source]

Return magnetic energy associated with wires. Requires current to be stored.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
EM(Nf, W, nr_of_selected_timepoints) array

Magnetic energy associated with wires.

get_phase(select_time_points=None) numpy.ndarray[source]

Return node phases. Last node is grounded. Requires theta to be stored.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
phi(Nn, W, nr_of_selected_timepoints) array

Node phases.

get_potential(select_time_points=None)[source]

Return voltage potential at nodes. Last node is groudend.Requires voltage to be stored.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
U(Nn, W, nr_of_selected_timepoints) array

Voltage potential at nodes.

get_problem_count()[source]

Return number of problems (abbreviated W).

get_supercurrent(select_time_points=None) numpy.ndarray[source]

Return supercurrent through junctions. Requires theta to be stored.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
Isup(Nj, W, nr_of_selected_timepoints) array

Supercurrent.

get_theta(select_time_points=None) numpy.ndarray[source]

Return gauge invariant phase differences.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
theta(Nj, W, nr_of_selected_timepoints) array

Gauge invariant phase differences.

get_voltage(select_time_points=None)[source]

Return voltage over junctions.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
V(Nj, W, nr_of_selected_timepoints) array

Voltage.

get_vortex_configuration(select_time_points=None) numpy.ndarray[source]

Return vorticity at faces. Requires theta to be stored.

Parameters
select_time_points=Nonearray in range(Nt), (Nt,) mask or None

Selected time_points at which to return data. If None, all stored timepoints are returned. Raises error if no data is available at requested timepoint.

Returns
n(Nf, W, nr_of_selected_timepoints) int array

Vorticity.

plot(problem_nr=0, time_point=0, fig=None, node_quantity=None, junction_quantity='I', face_quantity=None, vortex_quantity='n', show_grid=True, show_nodes=True, return_plot_handle=False, **kwargs)[source]

Visualize a problem at a specified timestep.

See circuit_visualize.CircuitPlot for documentation.

Returns
figmatplotlib figure handle

Returns figure handle

axmatplotlib axis handle

Returns axis handle

plot_handleConfigPlot (optional)

Object used to create the plot

Attributes
return_plot_handle=Falsebool

If True this method returns the ConfigPlot object used to create the plot.

select_static_configuration(prob_nr, time_step) pyjjasim.static_problem.StaticConfiguration[source]

Return a StaticConfiguration object with the data copied from this result for a given problem number at a given timestep.

Parameters
prob_nrint

Selected problem.

time_stepint

Selected timestep.

Returns
static_confStaticConfiguration

A StaticConfiguration object with the data copied from this result

class time_evolution.AnnealingProblem(circuit: pyjjasim.josephson_circuit.Circuit, time_step=0.5, interval_steps=10, external_flux=0.0, current_sources=0, problem_count=1, interval_count=1000, vortex_mobility=0.001, start_T=1.0, T_factor=1.03)[source]

Anneals a circuit by gradually lowering the temperature, with the goal for finding a stationairy state with reasonably low energy. The temperature profile is computed automatically based on the measured vortex mobility during the run. Annealing is executed with the .compute() method.

  • Does interval_count iterations of interval_steps timeseteps.

  • The first iteration is done at T=start_T

  • During each iteration it measures the average vortex mobility. If the target mobility is exceeded, the temperature is divided by T_factor, otherwise it is multiplied by it.

  • The target vortex mobility v_t at iter i is v_t(i) = v * ((N - i)/N) ** 1.5, so goes from v to 0.

  • At the end it does some steps at T=0 to ensure it is settled in a stationairy state.

  • vortex mobility is defined as abs(n(i+1) - n(i))) / dt averaged over space and time.

Parameters
circuitCircuit

Circuit used for annealing

time_step=0.5float

time step used in time evolution. Can be set quite large as the simulation does not need to be accurate.

external_flux=0.0float or (Nf,) array

Frustration at each face. If scalar; same external_flux is assumed for each face.

current_sources=0float or (Nj,) array

Current sources. Note that if this is set too high, a static configuration may not exist, so likely the temperature will go to zero.

problem_count=1int

Number of problems computed simultaneously. The problems are identical, but will likely end up in different state.

interval_steps=10int

Number of timesteps for every iteration.

interval_count=1000int

Number of iterations. After each iteration the temperature is recomputed.

vortex_mobility=0.001float

Target vortex mobility is vortex_mobility at iteration and lowered to zero by the last iteration. Temperature is adjusted such that this target mobility is achieved.

start_T=1.0float

Temperature at first iteration.

T_factor=1.03float

Factor with which temperature is multiplied or divided by every iteration.

Methods

compute()

Executes the annealing procedure.

get_vortex_mobility(n)

Computes vortex mobility on a set of consecutive vortex configurations.

compute() tuple[numpy.ndarray, typing.List[pyjjasim.static_problem.StaticConfiguration], numpy.ndarray][source]

Executes the annealing procedure.

Returns
status(problem_count,) int array

The value 0 means converged, 1 means diverged, 2 means indeterminate status.

configurations(problem_count,) list

A list of StaticConfiguration objects containing the resulting configurations.

temperature_profiles(interval_count, problem_count) array

For each problem the temperature profile used for the annealing.

get_vortex_mobility(n)[source]

Computes vortex mobility on a set of consecutive vortex configurations.