Dynamics#
Belief dynamics: how a belief or preference evolves over time, and how intermediate judgements change later ones.
1. Evidence accumulation on N ordered belief states (Busemeyer, Kvam and Pleskac, 2019).
MarkovWalk: probability vector \(\phi\), \(\dot\phi = K\phi\), with \(K\) tridiagonal (up rate \(\alpha\), down rate \(\beta\); drift \(\mu = \alpha / (\alpha + \beta)\), rate \(\gamma = \alpha + \beta\)) and reflecting ends.QuantumWalk: amplitude vector \(\psi\), \(U(t) = e^{-iHt}\) with \(H_{jj} = \mu x_j\) (\(x_j = j/(N-1)\)) and \(H_{j,j+1} = H_{j+1,j} = \sigma\).OpenSystemWalk: the quantum walk plus Lindblad dephasing of rate \(\lambda\) in the state basis; \(\lambda = 0\) is the quantum walk, a large \(\lambda\) suppresses interference.
The N states are grouped into K response categories (equal bins). The design is
{condition: ('single', t)} for a distribution over the K categories, or
{condition: ('joint', t1, t2)} for the K x K joint distribution of judgements at t1 and t2
(flattened row-major). A judgement at t1 collapses the state onto the chosen category, which is how
an intermediate judgement can change a later one in the quantum and open-system models but not, on
average, in the Markov model.
2. Belief updating over discrete events, queried as yes/no (for example trust in an agent after its successes and failures).
MarkovBelief: P(yes) moves toward 1 after a positive event and toward 0 after a negative one; a query only reads the state.OpenSystemBelief: a qubit density matrix rotated by each event, then dephased; a query is a projective measurement.
The design is {condition: (events, queries)}, with events a tuple of 1/0 and queries the
event indices after which the question is asked. The prediction is a distribution over the
\(2^k\) answer sequences (yes = 1), in itertools.product() order with 1 first.
Classes
Classical baseline: Markov random walk over N belief states. |
|
Quantum walk over N belief states (Busemeyer, Kvam and Pleskac). |
|
Quantum walk with Lindblad dephasing. |
|
Classical baseline: a yes-probability updated by each event. |
|
Belief (for example trust) as a qubit. |
Functions
P(yes) at the last query, marginalised over the earlier answers. |
|
Effect of an intermediate question on a later answer. |
- class MarkovWalk(**kw)[source]#
Bases:
_WalkBaseClassical baseline: Markov random walk over N belief states.
A judgement reads the state without disturbing its distribution.
- Parameters:
mu (
float) – Drift, the probability of a step up, in (0, 1).gamma (
float) – Total transition rate.n_states (
int, optional) – Number of belief states (default 21).n_categories (
int, optional) – Number of response categories (default 3).initial_width (
float, optional) – Width of the initial Gaussian distribution (default 0.15).
- state_probs(t)[source]#
Distribution over belief states.
- Parameters:
t (
float) – Time.- Returns:
numpy.ndarray– \(e^{Kt}\phi_0\).
- joint(t1, t2)[source]#
Joint distribution of judgements at two times.
- Parameters:
- Returns:
numpy.ndarray– K x K matrix: rows are the category att1, columns the category att2.
- class QuantumWalk(**kw)[source]#
Bases:
_WalkBaseQuantum walk over N belief states (Busemeyer, Kvam and Pleskac).
Evolution is unitary, so an intermediate judgement (a collapse) changes later judgements.
- Parameters:
mu (
float) – Drift (diagonal potential strength).sigma (
float) – Diffusion (coupling between neighbouring states).n_states – As in
MarkovWalk.n_categories – As in
MarkovWalk.initial_width – As in
MarkovWalk.
- state_probs(t)[source]#
Distribution over belief states at time
t(Born rule).- Parameters:
t (
float) – Time.- Returns:
- joint(t1, t2)[source]#
Joint distribution of judgements at
t1andt2, with collapse att1(Lüders rule).- Parameters:
- Returns:
numpy.ndarray– K x K joint distribution.
- class OpenSystemWalk(**kw)[source]#
Bases:
QuantumWalkQuantum walk with Lindblad dephasing.
Interpolates between the quantum walk (
lam = 0) and Markov-like behaviour (largelam).- Parameters:
mu (
float) – As inQuantumWalk.sigma (
float) – As inQuantumWalk.lam (
float) – Dephasing rate in the state basis.
- state_probs(t)[source]#
Distribution over belief states at time
tunder Lindblad dynamics.- Parameters:
t (
float) – Time.- Returns:
- joint(t1, t2)[source]#
Joint distribution of judgements at
t1andt2, with collapse att1.- Parameters:
- Returns:
numpy.ndarray– K x K joint distribution.
- class MarkovBelief(**params)[source]#
Bases:
ModelClassical baseline: a yes-probability updated by each event.
Successes raise it, failures lower it; asking does not change it.
- Parameters:
- class OpenSystemBelief(**params)[source]#
Bases:
MarkovBeliefBelief (for example trust) as a qubit.
Each event rotates the belief about the y axis; dephasing
gammathen pulls it toward the measurement axis; asking collapses it (Lüders rule), so asking can change later answers.- Parameters:
- final_yes(model, events, queries)[source]#
P(yes) at the last query, marginalised over the earlier answers.
- Parameters:
model (
MarkovBelieforOpenSystemBelief) – Belief model.events (
sequenceofint) – Events.queries (
sequenceofint) – Query positions; the last one is reported.
- Returns:
- question_effect(model, events, last, intermediate)[source]#
Effect of an intermediate question on a later answer.
- Parameters:
model (
MarkovBelieforOpenSystemBelief) – Belief model.events (
sequenceofint) – Events.last (
int) – Position of the final question.intermediate (
int) – Position of the extra, earlier question.
- Returns:
float– P(yes atlast| also asked atintermediate) - P(yes atlast| not asked). Zero forMarkovBeliefon average; generally non-zero forOpenSystemBelief.