From 3a0721fb911ec63e7b310b0a233a92c5ea906f82 Mon Sep 17 00:00:00 2001 From: ddahlbom Date: Wed, 26 Jul 2023 11:35:47 -0400 Subject: [PATCH] Doc, example and @ref fixes --- docs/src/versions.md | 2 +- docs/src/writevtk.md | 12 ++++++------ examples/powder_averaging.jl | 4 ++-- src/Reshaping.jl | 2 +- src/SampledCorrelations/SampledCorrelations.jl | 13 ++++++++++--- src/Sunny.jl | 2 +- src/VTKExport.jl | 3 ++- 7 files changed, 23 insertions(+), 15 deletions(-) diff --git a/docs/src/versions.md b/docs/src/versions.md index 0e0000a2a..50f314171 100644 --- a/docs/src/versions.md +++ b/docs/src/versions.md @@ -55,7 +55,7 @@ can be resolved by passing an explicit `offset`. The function [`remove_periodicity!`](@ref) disables periodicity along specified dimensions. -Rename `StaticStructureFactor` to [`InstantStructureFactor`](@ref). +Rename `StaticStructureFactor` to [`InstantStructureFactor`]. # Version 0.4.2 diff --git a/docs/src/writevtk.md b/docs/src/writevtk.md index 4eb578940..3b859ec5a 100644 --- a/docs/src/writevtk.md +++ b/docs/src/writevtk.md @@ -14,7 +14,7 @@ ParaView supports volumetric rendering: First, generate some correlation data in Sunny. We will use a 2D lattice, since the correlation data ``S(Q_x,Q_y,\omega)`` is 3D and can be exported in its entirety. -The following code sets up the system, thermalizes it, and records the correlation data in a [`SampledCorrelations`](@ref) called `dsf`. +The following code sets up the system, thermalizes it, and records the correlation data in a `SampledCorrelations` called `dsf`. ```julia using Sunny @@ -44,11 +44,11 @@ end ωmax=10. -dsf = SampledCorrelations(sys - ;Δt=Δt - ,nω=48 - ,ωmax=ωmax - ,process_trajectory=:symmetrize) +dsf = dynamical_correlations(sys + ;Δt=Δt + ,nω=48 + ,ωmax=ωmax + ,process_trajectory=:symmetrize) nsamples = 10 for _ in 1:nsamples diff --git a/examples/powder_averaging.jl b/examples/powder_averaging.jl index c82fc3352..62c843037 100644 --- a/examples/powder_averaging.jl +++ b/examples/powder_averaging.jl @@ -27,7 +27,7 @@ for _ ∈ 1:3000 step!(sys, integrator) end; -# We can now estimate ``𝒮(𝐪,ω)`` with [`SampledCorrelations`](@ref). We +# We can now estimate ``𝒮(𝐪,ω)`` with [`dynamical_correlations`](@ref). We # will tell Sunny to symmetrize the sample trajectory along the time-axis to # minimize Fourier artifacts. @@ -125,7 +125,7 @@ fig1 # [`add_sample!`](@ref) # - Increasing the system size to improve momentum space resolution # - Increasing the energy resolution (`nω` keyword of -# [`SampledCorrelations`](@ref)) +# [`dynamical_correlations`](@ref)) # - Applying instrument-specific energy broadening by giving `broaden_energy` a # custom kernel function. # - Including [`FormFactor`](@ref) corrections diff --git a/src/Reshaping.jl b/src/Reshaping.jl index b1a9a8de3..764f2c7af 100644 --- a/src/Reshaping.jl +++ b/src/Reshaping.jl @@ -179,7 +179,7 @@ output from this function will typically be used as input to Because this function does not incorporate phase information in its averaging over sublattices, the printed weights are not directly comparable with -experiment. For that purpose, use [`InstantCorrelations`](@ref) instead. +experiment. For that purpose, use [`instant_correlations`](@ref) instead. The weights printed by `print_wrapped_intensities` may be given a physical interpretation as follows: All possible ``q``-vectors are periodically wrapped diff --git a/src/SampledCorrelations/SampledCorrelations.jl b/src/SampledCorrelations/SampledCorrelations.jl index 42bc5580f..adc20bc81 100644 --- a/src/SampledCorrelations/SampledCorrelations.jl +++ b/src/SampledCorrelations/SampledCorrelations.jl @@ -1,3 +1,10 @@ +""" + SampledCorrelations + +Basic data type for storing sampled correlation data. A `SampleCorrelations` is +initialized by calling either [`dynamical_correlations`](@ref) or +[`instant_correlations`](@ref). +""" struct SampledCorrelations{N} # 𝒮^{αβ}(q,ω) data and metadata data :: Array{ComplexF64, 7} # Raw SF data for 1st BZ (numcorrelations × natoms × natoms × latsize × energy) @@ -290,14 +297,14 @@ information. ``𝒮(𝐪)`` data can be retrieved by calling [`instant_intensities_interpolated`](@ref). _Important note_: When dealing with continuous (non-Ising) spins, consider -creating a full [`SampledCorrelations`](@ref) object instead of an -`InstantCorrelations`. The former will provide full ``𝒮(𝐪,ω)`` data, from +creating using [`dynamical_correlations`](@ref) instead of +`instant_correlations`. The former will provide full ``𝒮(𝐪,ω)`` data, from which ``𝒮(𝐪)`` can be obtained by integrating out ``ω``. During this integration step, Sunny can incorporate temperature- and ``ω``-dependent classical-to-quantum correction factors to produce more accurate ``𝒮(𝐪)`` estimates. See [`instant_intensities_interpolated`](@ref) for more information. -Prior to calling `InstantCorrelations`, ensure that `sys` represents a good +Prior to calling `instant_correlations`, ensure that `sys` represents a good equilibrium sample. Additional sample data may be accumulated by calling [`add_sample!`](@ref)`(sc, sys)` with newly equilibrated `sys` configurations. diff --git a/src/Sunny.jl b/src/Sunny.jl index 7ceff43a4..846749472 100644 --- a/src/Sunny.jl +++ b/src/Sunny.jl @@ -91,7 +91,7 @@ include("SampledCorrelations/FormFactor.jl") include("SampledCorrelations/BasisReduction.jl") include("Intensities/Types.jl") include("SampledCorrelations/DataRetrieval.jl") -export dynamical_correlations, instant_correlations, FormFactor, +export SampledCorrelations, dynamical_correlations, instant_correlations, FormFactor, add_sample!, broaden_energy, lorentzian, all_exact_wave_vectors, ωs, spherical_shell, merge!, intensity_formula, integrated_lorentzian diff --git a/src/VTKExport.jl b/src/VTKExport.jl index f55c70922..0fce84c5c 100644 --- a/src/VTKExport.jl +++ b/src/VTKExport.jl @@ -32,7 +32,8 @@ function export_vtk(filename,sys; coordinates = :physical, log_scale = false) ## Save S(Q) correlations - ic = InstantCorrelations(sys) + ic = instant_correlations(sys) + add_sample!(ic, sys) params = unit_resolution_binning_parameters(ic) formula = intensity_formula(ic,:trace)