drawing

Constructors

QuantumEpisodicMemory.GQEMType
GQEM{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

  1. gist: respond "yes" to semantically related words (G)
  2. verbatim: respond "yes" to old (i.e. studied) words (V)
  3. gist + verbatim: respond "yes" to semantically related and old words (G ∪ V)
  4. 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.

source

Core Functions

QuantumEpisodicMemory.compute_predsFunction
compute_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
conditionoldrelatedunrelated
gist0.650.650.9
verbatim0.350.350.65
Gist + verbatim0.690.690.91
unrelated new0.90.91

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)
source
Distributions.logpdfFunction
logpdf(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
conditionoldrelatedunrelated
gist359
verbatim012
gist + verbatim4110
unrelated new582

Arguments

  • dist::AbstractGQEM: a GQEM distribution object
  • n::Union{Int, Array{Int, N}}: the number of trials
  • data::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)
source
Base.randFunction
rand(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
conditionoldrelatedunrelated
gist359
verbatim012
gist + verbatim4110
unrelated new582

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)
source

Utilities

QuantumEpisodicMemory.to_tableFunction
to_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         91
source

Plots

RecipesBase.plotFunction
plot(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 labels
  • kwargs...: optional keyword arguments passed to the plot functions

Example

dist = GQEM(; 
    θG = -.5,
    θU = 2,
    θψO = .90,
    θψR = .15,
    θψU = -1.5,
)
       
plot(dist)
source
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 ket
  • font_size = 10: font size of the vector labels
  • kwargs...: optional keyword arguments passed to the plot functions

Example

dist = GQEM(; 
    θG = -.5,
    θU = 2,
    θψO = .90,
    θψR = .15,
    θψU = -1.5,
)
       
plot(dist, .1, -.5)
source
QuantumEpisodicMemory.plot_predictionsFunction
plot_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 simulation
  • responses::Matrix{<:Int}: a matrix of yes responses where rows correspond to instruction conditions, and columns correspond to word types
  • n_trials::Int: the number of trials per condition.

Keywords

  • row_labels = ["Gist", "Verbatim", "Gist+Verbatim", "Unrelated"]: row labels for the grid plot
  • col_labels = ["Old", "Related", "Unrelated"]: column labels of the grid plot
  • kwargs...: optional keyword options passed to override default values for histogram
source