
Constructors
QuantumEpisodicMemory.GQEM — TypeGQEM{T<:Real} <: AbstractGQEM{T}A model object for the Generalized Quantum Episodic Memory (GQEM) model of item recognition. In the recognition memory task, subjects study a list of words. In the test phase, three types of words are presented: old words from the study list, new but semantically related words, and new but unrelated words. Subjects are given four sets of instructions
- gist: respond "yes" to semantically related words (G)
- verbatim: respond "yes" to old (i.e. studied) words (V)
- gist + verbatim: respond "yes" to semantically related and old words (G ∪ V)
- unrelated: respond "yes" to unrelated words (U)
The law of total probability is violated in experiments, such that Pr(G) + Pr(V) > Pr(G ∪ V). Similarly, the judgments are subadditive: Pr(G) + Pr(V) + Pr(U) > 1. These effects emerge in the GQEM because the memory representations are incompatible, meaning they are represented with different, non-orthogonal bases and evaluated sequentially. As a result, LOTP and additivity do not necessarily hold.
Fields
θG::T: angle in radians between the verbatim and gist basesθU::T: angle in radians between the verbatim and new unrelated basesθψO::T: angle in radians between verbatim basis and the initial state for old wordsθψR::T: angle in radians between verbatim basis and the initial state for related new wordsθψU::T: angle in radians between verbatim basis and the initial state for new unrelated words
Example
using QuantumEpisodicMemory
θG = -.12
θU = -1.54
θψO = -.71
θψR = -.86
θψU = 1.26
dist = GQEM(; θG, θU, θψO, θψR, θψU)
preds = compute_preds(dist)
table = to_table(preds)
# violation of LOPT
sum(table[["gist","verbatim"],:], dims=1) - table["gist+verbatim", :]'References
Trueblood, J. S., & Hemmer, P. (2017). The generalized quantum episodic memory model. Cognitive Science, 41(8), 2089-2125.
Core Functions
QuantumEpisodicMemory.compute_preds — Functioncompute_preds(dist::AbstractGQEM)Returns a matrix of predictions for the GQEM model.
The output is organized in a matrix where rows correspond to instructions and columns correspond to word type:
| word type | |||
|---|---|---|---|
| condition | old | related | unrelated |
| gist | 0.65 | 0.65 | 0.9 |
| verbatim | 0.35 | 0.35 | 0.65 |
| Gist + verbatim | 0.69 | 0.69 | 0.91 |
| unrelated new | 0.9 | 0.9 | 1 |
Arguments
dist::AbstractGQEM: a GQEM distribution object
Example
using QuantumEpisodicMemory
# basis rotation parameters relative to the standard verbatim basis, V
θG = -.12
θU = -1.54
θψO = -.71
θψR = -.86
θψU = 1.26
dist = GQEM(; θG, θU, θψO, θψR, θψU)
preds = compute_preds(dist)
preds = to_table(preds)Distributions.logpdf — Functionlogpdf(dist::AbstractGQEM, n::Union{Int,Array{Int,N}}, data::Array{Int,N})Returns the log likelihood of the data for the GQEM model.
The data are organized in a matrix where rows correspond to instructions and columns correspond to word type:
| word type | |||
|---|---|---|---|
| condition | old | related | unrelated |
| gist | 3 | 5 | 9 |
| verbatim | 0 | 1 | 2 |
| gist + verbatim | 4 | 1 | 10 |
| unrelated new | 5 | 8 | 2 |
Arguments
dist::AbstractGQEM: a GQEM distribution objectn::Union{Int, Array{Int, N}}: the number of trialsdata::Array{Int, N}: number of "yes" responses
Example
using QuantumEpisodicMemory
# basis rotation parameters relative to the standard verbatim basis, V
θG = -.12
θU = -1.54
θψO = -.71
θψR = -.86
θψU = 1.26
dist = GQEM(; θG, θU, θψO, θψR, θψU)
data = rand(dist, 100)
logpdf(dist, 100, data)Base.rand — Functionrand(dist::AbstractGQEM, n::Union{Int,Array{Int,N}})Generates data from the GQEM model
The output is organized in a matrix where rows correspond to instructions and columns correspond to word type:
| word type | |||
|---|---|---|---|
| condition | old | related | unrelated |
| gist | 3 | 5 | 9 |
| verbatim | 0 | 1 | 2 |
| gist + verbatim | 4 | 1 | 10 |
| unrelated new | 5 | 8 | 2 |
Arguments
dist::AbstractGQEM: a GQEM distribution object
Example
using QuantumEpisodicMemory
# basis rotation parameters relative to the standard verbatim basis, V
θG = -.12
θU = -1.54
θψO = -.71
θψR = -.86
θψU = 1.26
dist = GQEM(; θG, θU, θψO, θψR, θψU)
data = rand(dist, 100)
table = to_table(data)Utilities
QuantumEpisodicMemory.to_table — Functionto_table(x)Converts matrix to table with labeled dimensions and indices.
Example
using QuantumEpisodicMemory
# basis rotation parameters relative to the standard verbatim basis, V
θG = -.12
θU = -1.54
θψO = -.71
θψR = -.86
θψU = 1.26
dist = GQEM(; θG, θU, θψO, θψR, θψU)
data = rand(dist, 100)
to_table(data)4×3 Named Matrix{Int64}
condition ╲ word type │ old related unrelated
──────────────────────┼────────────────────────────────
gist │ 65 51 2
verbatim │ 66 41 9
gist+verbatim │ 58 52 5
unrelated new │ 50 57 91Plots
RecipesBase.plot — Functionplot(dist::AbstractGQEM; font_size = 10, kwargs...)Plots the projection of an AbstractGQEM model as a 3 x 3 set of unit circles. Across all unit circles, the bases are the same. However, the state vector varies by row and the basis vector onto which the state vector is projected varies by column.
Arguments
dist::AbstractGQEM: a GQEM distribution object
Keywords
font_size = 10: font size of the vector labelskwargs...: optional keyword arguments passed to theplotfunctions
Example
dist = GQEM(;
θG = -.5,
θU = 2,
θψO = .90,
θψR = .15,
θψU = -1.5,
)
plot(dist)plot(
dist::AbstractGQEM,
θψ,
θ_basis;
state_label = L"psi",
font_size = 10,
kwargs...
)Plots the projection from a given state vector onto a given basis vector within a unit circle.
Arguments
dist::AbstractGQEM: a GQEM distribution objectθψ: the angle of the state vector with respect to the verbatim basisθ_basis: the angle of the basis onto which the state vector is projected. The angle is with respect to the verbatim basis.
Keywords
state_label = "L"psi": the label of the state vector ketfont_size = 10: font size of the vector labelskwargs...: optional keyword arguments passed to theplotfunctions
Example
dist = GQEM(;
θG = -.5,
θU = 2,
θψO = .90,
θψR = .15,
θψU = -1.5,
)
plot(dist, .1, -.5)QuantumEpisodicMemory.plot_predictions — Functionplot_predictions(
preds::Matrix{<:Matrix{<:Real}}`,
responses::Vector{<:Int},
n_trials::Int;
row_labels = ["Gist", "Verbatim", "Gist+Verbatim", "Unrelated"],
col_labels = ["Old", "Related", "Unrelated"],
kwargs...
)Generates a plot of posterior or prior predictive distributions for each condition.
Arguments
preds::Matrix{<:Matrix{<:Real}}: predictions for the GQEM where each sub-matrix is contains the predictions across all conditions for a single simulationresponses::Matrix{<:Int}: a matrix of yes responses where rows correspond to instruction conditions, and columns correspond to word typesn_trials::Int: the number of trials per condition.
Keywords
row_labels = ["Gist", "Verbatim", "Gist+Verbatim", "Unrelated"]: row labels for the grid plotcol_labels = ["Old", "Related", "Unrelated"]: column labels of the grid plotkwargs...: optional keyword options passed to override default values forhistogram