sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
5404304f74dd433351757f523100716bc2ef5d7e2619ff9ce70fb7936bd9c8bc
Julia
7,597
212
""" EigData A struct for storing eigenvalue data associated with k-points. # Fields - `kp::Matrix{Float64}`: A matrix where each column represents a k-point. - `Es::Matrix{Float64}`: A matrix where each column represents the eigenvalues corresponding to the respective k-point. """ struct EigData kp :: Matrix...
156aaf7efe88296ef814c73b6910638c00b9eb193b9b9c167490085abcf23c03
Julia
7,687
205
## using Pkg script_dir = @__DIR__ # Get the directory of the current script project_root = joinpath(script_dir, "..", "..") # Get the path to the parent directory (the project root) Pkg.activate(project_root) # Activate the project Pkg.instantiate() # download all the required packages using LinearRNNforFMRIdigitaltw...
a8c9b5464f71532de799b4b48b6d00ed6926dd9e46f1e1478c32eb89e474def2
Julia
7,760
160
""" run_calculation(::Val{:standard}, comm, conf::Config; rank=0, nranks=1) Performs a standard calculation for an effective Hamiltonian model. # Arguments - `::Val{:standard}`: A type parameter indicating that this function performs a standard calculation. - `comm`: The MPI communicator used for parallel process...
fc703c19f21834c6e4ff2c3bbb0ea846678b4af371dfb79dea0b407f800436ca
Julia
7,783
197
""" struct Config A configuration structure that holds options and blocks of tags in dictionaries. # Fields - `options::Dict{String, String}`: A dictionary holding configuration options. - `blocks::Dict{String, Dict{String, String}}`: A dictionary holding configuration blocks. """ struct Config options :: Dic...
533314f6ca82d27d69d1a0eafe1c35730f8303261feaef85a8198c4c07c4f667
Julia
7,884
178
mutable struct ZebrafishHMM_G3_NoSym_Full_Exp <: HiddenMarkovModels.AbstractHMM pinit_turn::Float64 const transition_matrix::Matrix{Float64} # T[i,j] = probability of transitions i -> j σforw::Float64 turn::Gamma{Float64} forward_displacement::Gamma{Float64} turn_displacement::Gamma{Float64} ...
b0616f935e22b302ad033a50f3bbd8508f52673af55223c3eb26a8926b3da22b
Julia
7,886
202
const loss_to_n = Dict{String, Int64}("MAE" => 1, "MSE" => 2) """ struct Loss A structure representing a (weighted) loss function for evaluating the difference between predicted and true values. The loss is calculated based on a given norm, with optional weights applied to the errors along the prediction and obse...
877f43c8ea577dd31fb428e18913bc86a6af5a15b1f0b744a39b5afb02b32f60
Julia
7,940
196
## using Pkg script_dir = @__DIR__ # Get the directory of the current script project_root = joinpath(script_dir, "..", "..", "..") # Get the path to the parent directory (the project root) Pkg.activate(project_root) # Activate the project #Pkg.instantiate() # download all the required packages using LinearAlgebra, Sta...
0c16c1b639ed9d26bb25709c4ba2be5b6207100603e2c0d18d77447efe4f67a5
Julia
8,169
180
""" write_hr(Hr, Rs; filename="hamster_hr", tol=1e-8, verbose=1) Writes Hamiltonian data `Hr` and corresponding lattice vectors `Rs` to a file. # Arguments: - `Hr`: A vector of matrices where each `Hr[R]` contains the Hamiltonian elements corresponding to the lattice vector `Rs[:, R]`. - `Rs`: A 2D array where ea...
1d8225591e7169568be56ff312dc76cf3b2bd360689c9e3cd4ab1b418e67e834
Julia
8,175
188
mutable struct ZebrafishHMM_G3_Sym_Full_Exp <: HiddenMarkovModels.AbstractHMM pinit_turn::Float64 const transition_matrix::Matrix{Float64} # T[i,j] = probability of transitions i -> j σforw::Float64 turn::Gamma{Float64} forward_displacement::Gamma{Float64} turn_displacement::Gamma{Float64} f...
bb4bdc20f1312633939e574c5328bea39e7909922a4e8a679c4813c2bff86ac3
Julia
8,214
305
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
59f2cc5e9b7d70e7ef62698f0258834357772a0c2563557753c77992943a8f3f
Julia
8,287
220
## using Pkg script_dir = @__DIR__ project_root = joinpath(script_dir, "..", "..") Pkg.activate(project_root) Pkg.instantiate() # Ensure dependencies are available using LinearRNNforFMRIdigitaltwins.FMRICommon using LinearRNNforFMRIdigitaltwins.Utils using LinearRNNforFMRIdigitaltwins.ESN using LinearAlgebra, Interpo...
dc100af7bd23b51fa147ef1d7ad300d7574c352733c234511d757949193d1d45
Julia
8,318
175
""" hyper_optimize(param_values, params, comm, conf; rank=0, nranks=1, verbosity=get_verbosity(conf)) -> Float64 Evaluate a given set of hyperparameters by updating a configuration and running an optimization calculation. # Arguments - `param_values::Vector{Float64}`: Numerical values for each parameter to be opt...
7d8d0ecfe14b009a1c20b4cc829c1b85b0480c960fe5916d5d6e4f491a718d68
Julia
8,320
356
""" str_to_orb(str::String) Convert an orbital name given as a string to its corresponding orbital object. # Arguments - `str::String`: The name of the orbital as a string. Valid strings include `"s"`, `"px"`, `"py"`, `"pz"`, `"dz2"`, `"dxy"`, `"dxz"`, `"dyz"`, `"dx2_y2"`, `"sp3"`, `"sp3dr2"`, `"pxdx2"`, `"pydy2"...
119185941d36972838865a312d36fafb4bce77f9b823757343efc3c2963a93eb
Julia
8,334
211
""" mutable struct SOCModel{V, M} A mutable struct representing a model for Spin-Orbit Coupling (SOC) effects. # Type Parameters - `V`: Type representing a structure-specific ion labeling or identifier. - `M`: Type of the matrices describing SOC interactions, e.g., `Matrix{ComplexF64}`. # Fields - `params::Vecto...
0d36594892bec642a609d7aec234aab37b498bee0298954974170f5150284fe3
Julia
8,367
358
""" str_to_orb(str::String) Convert an orbital name given as a string to its corresponding orbital object. # Arguments - `str::String`: The name of the orbital as a string. Valid strings include `"s"`, `"px"`, `"py"`, `"pz"`, `"dz2"`, `"dxy"`, `"dxz"`, `"dyz"`, `"dx2_y2"`, `"sp3"`, `"sp3dr2"`, `"pxdx2"`, `"pydy2"...
4e7fd4e87be19ad4586ea313bb15b30ac14c2452a2a818d87ac6921306794e56
Julia
8,409
186
const ndict = Dict(1=>R1, 2=>R2, 3=>R3, 4=>R4, 5=>R5, 6=>R6) const mdict = Dict(0=>"σ", 1=>"π", 2=>"δ") const mdict_inv = Dict('σ'=>0, 'π'=>1, 'δ'=>2) const ldict = Dict(0=>"s", 1=>"p", 2=>"d") const ldict_inv = Dict('s'=>0, 'p'=>1, 'd'=>2) """ IonLabel(types::SVector{2, UInt8}) A structure representing a label f...
bfc4a280d7f6eaeb63ede6923d170424e8713bd090d4f7e3a3cfd7c9566b48b1
Julia
8,740
217
struct EffectiveHamiltonian{T, S1, S2, IT} Nstrc :: Int64 models :: T systems :: Vector{String} sp_mode :: S1 sp_diag :: S2 sp_tol :: Float64 sp_iterators :: IT soc :: Bool Rs :: Vector{Matrix{Float64}} end function EffectiveHamiltonian(strcs, bases, comm, conf=get_empty_conf(); ...
814ee74c6ce69bc993e27eb9d82d5910259904a5999b20707da788d66dd4de9d
Julia
8,878
236
### A Pluto.jl notebook ### # v0.20.13 using Markdown using InteractiveUtils # ╔═╡ 66a6d5b1-729f-49ea-8404-9c0ce48d9973 import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ 9674b801-5acf-4f76-b494-4aa8cb8ab012 using Statistics: mean, std # ╔═╡ dca0d89a-744f-11ef-1dde-71bceb3d228e md"# Imports" # ╔═╡ 47c0...
ad90ed5cfe06166cfa6e4ee11072c32f21b9c957c4e1d19df3a83d226242bd6a
Julia
8,968
283
""" ewald_sum(pos, q, lattice; kwargs...) Compute electrostatic potentials and energies using Ewald-type methods (Ewald, Wolf, Zahn, etc.). This function combines real-space and reciprocal-space contributions (depending on `method`) and returns per-site potentials together with energy components. # Arguments - `...
1b4a29ed87f69bd078da354502561edefba6375c820ea4fc1d3082e0cd879569
Julia
9,024
233
""" mutable struct SOCModel{V, M} A mutable struct representing a model for Spin-Orbit Coupling (SOC) effects. # Type Parameters - `V`: Type representing a structure-specific ion labeling or identifier. - `M`: Type of the matrices describing SOC interactions, e.g., `Matrix{ComplexF64}`. # Fields - `params::Vecto...
afa0fdaddf1d7b1e3ec4b5b092e5c5eb337c5dbd4c2c118a45fea871a76a6470
Julia
9,211
226
struct EffectiveHamiltonian{T, S1, S2, IT} Nstrc :: Int64 models :: T systems :: Vector{String} sp_mode :: S1 sp_diag :: S2 sp_tol :: Float64 sp_iterators :: IT soc :: Bool Rs :: Vector{Matrix{Float64}} end function EffectiveHamiltonian(strcs, bases, comm, conf=get_empty_conf(); ...
b0f043977fa90fa2b48ade6f5d1ba23e0efdaac8c446faecd0cb72643fdbebd6
Julia
9,379
191
using Lux, Zygote, Distributions, Optimisers, Random, MLUtils using ComponentArrays using Statistics using DataFrames, CSV include("functions.jl") rng = Random.default_rng() Random.seed!(1) Nid = 3000 Nid_val = 1000 Nruns = 100 Sim_covs = 2 time_const = [] time_lin = [] time_NN = [] loss_const = [] loss_lin = [] l...
6be39d9fd7b217d8eb52dc71002939b0ce2a6d9afd8adf848dacd761b1e45944
Julia
9,451
269
""" struct Config A configuration structure that holds options and blocks of tags in dictionaries. # Fields - `options::Dict{String, String}`: A dictionary holding configuration options. - `blocks::Dict{String, Dict{String, String}}`: A dictionary holding configuration blocks. """ struct Config options :: Dic...
f4671cc18ee28457f46a547c3c9594d8570c5cf6f8316a64086bc1fe013815c9
Julia
9,518
198
""" PointGrid A data structure for organizing and managing points in a 3D simulation cell by dividing the space into equally-sized cubic boxes. The `PointGrid` structure stores grid points for atom positions, allowing for efficient spatial queries and neighbor searches. # Fields: - `grid_size::Float64`: The siz...
75236432c3d335e73e6eab2897f0bea26968591f02a3335a8a4d8c8bef130f5f
Julia
9,528
198
""" PointGrid A data structure for organizing and managing points in a 3D simulation cell by dividing the space into equally-sized cubic boxes. The `PointGrid` structure stores grid points for atom positions, allowing for efficient spatial queries and neighbor searches. # Fields: - `grid_size::Float64`: The siz...
ee753fa0173e21712aeb6387342d9162236722c5bd002a4ecddbdc08923832db
Julia
9,531
355
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
0a2c10ee0a58e40a7ec305e28d060e249723163ee0b7882b3c6ce0f04ed619eb
Julia
9,630
203
using Lux, Zygote, Distributions, Optimisers, Random, MLUtils using ComponentArrays using Statistics using DataFrames, CSV include("functions_real_data.jl") # df = CSV.read("e2.csv", DataFrame) # rename!(df, :status => :state) # df_validation, df_train = train_test_data_split(df, 0.2) df_train = CSV.read("training_...
f38bbba63f47e083de3e6eb1d21f5daa2b35a88251d8dd53a0f6d759e02558ea
Julia
9,632
285
""" EwaldOnsites{P,T,N} Container for electrostatic onsite corrections computed from Ewald-type methods (Ewald, Wolf, Zahn) over a set of structures. This struct stores per-atom electrostatic potentials (mean-centered per species) together with the metadata required to map them onto TB onsite parameters. # Field...
c64badc6dfa99c0c8a778934ca4cded07b01e8093ad0b54777c259c9687950fc
Julia
10,341
262
""" TBModel A mutable struct representing a tight-binding model. # Fields - `h::Matrix{SparseMatrixCSC{Float64, Int64}}`: A matrix where each element is a sparse matrix representing the geometry tensor. - `parameter_labels::Vector`: A vector containing the label for each parameter. - `V::Vector{Float64}`: A vecto...
64ae2cb819e9ea387c81c7626fd18b62077ad9968d3edc04a8c46f54e7397165
Julia
10,454
271
### A Pluto.jl notebook ### # v0.19.46 using Markdown using InteractiveUtils # ╔═╡ b5cd5128-01f9-4d63-a757-1ee9882a0f54 import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ 16867f62-2fd0-4e52-80c9-5962e615ee98 using Makie: @L_str # ╔═╡ d53d040f-5998-40cc-9b7f-69da402f1cce using DataFrames: DataFrame # ╔═...
f2ca6ec95790a66468f6c90cda19444b9e9b47be8a0b048f2f5ab25110638d3a
Julia
10,493
319
module FMRICommon using LinearAlgebra, MultivariateStats, StatsBase using LinearRNNforFMRIdigitaltwins.Utils using Interpolations, DelimitedFiles # Export constants and functions export load_patient_data, compute_area_indices, process_patient_data, process_patient_data_complete, process_patient_data_complete!, ...
0d42061b7fdcec630c29a3931e9fc58c892c73b438f0a8d33fc400b634580a1c
Julia
10,589
251
path = joinpath(@__DIR__, "test_files") @testset "Test Config indices" begin # Test 1: no validation, no Nconf_min conf = get_empty_config() set_value!(conf, "Nconf", "Supercell", 100) set_value!(conf, "Nconf_min", "Supercell", 1) set_value!(conf, "Nconf_max", "Supercell", 1000) config_indices,...
53f1da871cf3603a77023cf0815e79c3aa8e9a852f97541c3859be825113c81f
Julia
10,651
297
function train_test_data_split(df, frac) state = df.state unique_state = unique(state) Number_of_groups = length(unique_state) Nobs_grouped_state = similar(unique_state) for i in eachindex(unique_state) Nobs_grouped_state[i] = (count(state .== unique_state[i]) ) end Nobs_group_test...
3e8dba731707e956a4e083e4f72fb21d83a7b4ed94afe3bc3e8354b76bac84d9
Julia
10,678
323
# Needed packages using Microstructure, Fibers, Flux using Plots, Statistics using LaTeXStrings using Plots.PlotMeasures export axon_da_sensitivity, sensitivity_plot, eval_plt, logs_plt, nn_eval, nn_estimate, sigma_level_smt """ Calculate the sensitivity range for axon diameter index with PA signal from a single ...
bc4c8a0889692bd73d310f7ca3a87a7b8d5df049fc160428b55fe23fcfc81a96
Julia
10,699
262
## using Pkg script_dir = @__DIR__ # Get the directory of the current script project_root = joinpath(script_dir, "..", "..", "..") # Get the path to the parent directory (the project root) Pkg.activate(project_root) # Activate the project #Pkg.instantiate() # download all the required packages using LinearAlgebra, Sta...
479bd31f622146cbb32cf4b6e76df425d97dbde187e6b137a03ee8a2d933efdd
Julia
10,775
431
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
a5c58b2fd45e1a9e34f2f7370236a4ad1bc9143ba13520dc52ae54a35d8d0f2a
Julia
10,874
390
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
cfa8aa4652433a6211810dbb6cac7973bba2a0f17dcd4d7e5a51bcf413221b56
Julia
10,992
235
""" optimize_model!(ham_train, ham_val, optim, dl, prof, conf=get_empty_config(); verbosity=get_verbosity(conf), Nbatch=get_nbatch(conf), validate=get_validate(conf), rank=0, nranks=1) Optimizes the model by performing training and optional validation steps. # Arguments - `ham_train`: The Hamiltonian model used f...
ec38e3728ab8cdf7521416535d5b47ac0455f8a683865b60a76505c7f312bb9b
Julia
10,996
235
""" optimize_model!(ham_train, ham_val, optim, dl, prof, conf=get_empty_config(); verbosity=get_verbosity(conf), Nbatch=get_nbatch(conf), validate=get_validate(conf), rank=0, nranks=1) Optimizes the model by performing training and optional validation steps. # Arguments - `ham_train`: The Hamiltonian model used f...
0e00e4540fb693c33e7d04a7299ed2e855152df87badf4a6d8d965233289258f
Julia
11,029
320
using ProgressMeter export pre_allocate, empty_chain!, create_chain, threading """ This method runs multi-threads MCMC estimation on dMRI data using a specified biophysical model, calls the voxel threading method and save estimated parameters as nifti files. `savedir` includes both output path and file name prefix. ...
dc3dff869ff509fb6f3c5938576373b6f0e454d86cbb5e8f4130ce9952e8cb33
Julia
11,176
330
#= 3D lattice gas model, in the presence of an Ising surface (membrane), coupled via tethers. Hamiltonian: H = -Jb*sum(ni*nj) -Jm*sum(si*sj)-Jt*sum(ni)-mu*sum(ni), where the first and fourth terms are for bulk. The second term sums over all the Ising spins in the membrane. The third term is summed over all the indi...
a82a4e6b5b36955729dc64b0876222ef5bd3a9b029447184ab72443e4c550feb
Julia
11,202
457
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
9e0a1125fc4619f9b357e58b88fc5aeff97f72909e837d35a70dc69db5d7776a
Julia
11,277
291
""" mutable struct HamiltonianKernel{T1, T2} A kernel structure used for computing weighted similarity functions. # Fields - `ws :: Vector{Float64}`: Weights for each sample point. - `xs :: Vector{T1}`: Sample points. - `sim_params :: T2`: Parameters for the similarity function. """ mutable struct HamiltonianKern...
9633e275f0aa5e1adb914028a46e1c0d9777f4615ad3ccc27e79da33392b03c7
Julia
11,458
216
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # ╔═╡ c61f5cd6-023f-11ef-343e-6b895c2b8f54 import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ 4ec29bd5-35ca-4cf2-8305-148816cb2f5f using HiddenMarkovModels: logdensityof, baum_welch, transition_matrix, initial_distribution, viter...
9b9465693981fa8f13e988ab65827e65335fb6c6793f2d0fd497c9bf4f4ca51e
Julia
11,472
275
#––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––# # MACAQUE VS MARMOSET - DISTRIBUTED WORKING MEMORY # #––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––# #––––––––––––––––––––––––––––––––––––––––––––––––––––# # ...
9775f8c5c5ff5ecd2fab80dce4a043981dde2ca4a2c4f54392c333bb414449f7
Julia
11,479
251
""" run_calculation(::Val{:standard}, comm, conf::Config; rank=0, nranks=1) Performs a standard calculation for an effective Hamiltonian model, computing either the eigenvalues or the Hamiltonian itself for a given set of structures. # Workflow 1. **Configuration Sampling** - Retrieve configuration indices ...
59737f54a1c9a7a49902b6789c51192d0f138e52a3a459a493c8f8db5a8df8a0
Julia
11,526
281
## using Pkg script_dir = @__DIR__ project_root = joinpath(script_dir, "..", "..") Pkg.activate(project_root) Pkg.instantiate() # Ensure dependencies are available using LinearRNNforFMRIdigitaltwins.FMRICommon using LinearRNNforFMRIdigitaltwins.Utils using LinearRNNforFMRIdigitaltwins.ESN using LinearAlgebra, Interpo...
6881e48dc73b55a350be96f17f37d576e20e57308034174144fc621b6964b8ec
Julia
11,558
298
""" TBModel A mutable struct representing a tight-binding model. # Fields - `h::Matrix{SparseMatrixCSC{Float64, Int64}}`: A matrix where each element is a sparse matrix representing the geometry tensor. - `parameter_labels::Vector`: A vector containing the label for each parameter. - `V::Vector{Float64}`: A vecto...
38c0977261206964dc81115be95f7ddfb730da578fe4ea1dd38bf8edc7720c6d
Julia
11,601
280
""" fcut(r, rcut) Cut-off function whose value smoothly transitions to zero as `r` approaches `rcut`. Ensures continuity by using a cosine-based smoothing function. # Arguments - `r`: The input distance. - `rcut`: The cutoff radius beyond which the function returns zero. - `rcut_tol`: A tolerance applied to the c...
2f0d9c971d6ac474c443bfd599ed6e58fe297106bb8c38312cde6c88d18647f6
Julia
11,860
345
########################################################### ####### Functions for data generation and manipulation #### ########################################################### function transform_transvec(transitionvector, statevector, endstate) transformed_transitionvector = deepcopy(transitionvector) for i...
d85b62cb59a7721652bf63efe26f2c12e89f55ada3156a9e19ac9d25eff65c31
Julia
11,941
275
mutable struct ZebrafishHMM_G3_Sym_Full <: HiddenMarkovModels.AbstractHMM pinit_turn::Float64 const transition_matrix::Matrix{Float64} # T[i,j] = probability of transitions i -> j σforw::Float64 turn::Gamma{Float64} forward_displacement::Gamma{Float64} turn_displacement::Gamma{Float64} forwa...
c40fe2211af5a18e1e2e3cb0391ff1714c211a0c5e9e9ee58f12fba10ffa4520
Julia
12,038
284
""" get_tb_descriptor(model, strc, conf) Calculate the TB descriptor for a given a TB `model`, a structure `strc` and a TBConfig file `conf`. """ function get_tb_descriptor(h, V, strc::Structure, basis, conf::Config; rcut=get_ml_rcut(conf), rcut_tol=get_rcut_tol(conf), apply_distortion=get_apply_distortion(conf), ...
218ae66cb9c43a6ddb05ea03230e671c56b2d78d7198e7376955736fb1d6e9d2
Julia
12,376
334
module ESN using LinearAlgebra, Random, Statistics, SparseArrays, SpecialFunctions mutable struct NetType netSize::Int # number of nodes ν::Vector{Float64} # net state, firing rate τ::Vector{Float64} # time constants J::Union{Matrix{Float64},SparseMatrixCSC{Float64, Int64}} # synaptic matrix Jext::...
ae9f1c9e7ab070ab74da86d7bb5f09bafc5ffa3abf051fe45acd8d55d2843ccf
Julia
13,103
319
""" get_soc_matrices(strc::Structure) -> Vector{BlockDiagonal} Precompute the spin-orbit coupling (SOC) matrices for a given structure. """ function get_soc_matrices(strc::Structure, basis::Basis, conf=get_empty_config(); verbosity=get_verbosity(conf)) atom_axes_list = get_axes_from_orbitals(basis.orbitals) ...
b24a4208dd5b6db0b2880789e8c3750339b160c335bc369e5a24d3a0d14514c2
Julia
13,145
320
""" get_soc_matrices(strc::Structure) -> Vector{BlockDiagonal} Precompute the spin-orbit coupling (SOC) matrices for a given structure. """ function get_soc_matrices(strc::Structure, basis::Basis, conf=get_empty_config(); verbosity=get_verbosity(conf)) atom_axes_list = get_axes_from_orbitals(basis.orbitals) ...
483da8f7e46e5b9edca865b89c3e336b371d87395dda0c863e4819c25c1c7389
Julia
13,263
283
""" struct Basis{Orb, Ov, P, R} A data structure that represents the basis of a system, containing information about orbitals, overlap integrals, parameters, and precomputed radial functions (RLLM). # Fields - `orbitals::Orb`: A collection of orbitals for each ion in the system. This typically contains the orbita...
71e4e5d5e59441c4be08fb92f9b67fb13ee167534d603b79d4bc907a48d07201
Julia
13,346
315
""" get_tb_descriptor(model, strc, conf) Calculate the TB descriptor for a given a TB `model`, a structure `strc` and a TBConfig file `conf`. """ function get_tb_descriptor(h, V, strc::Structure, basis, conf::Config; rcut=get_ml_rcut(conf), rcut_tol=get_rcu...
d51f236070e8fd2367910711c5508af7e31480e926c86e95b4ec6a1134902110
Julia
13,390
418
## using Pkg script_dir = @__DIR__ # Get the directory of the current script project_root = joinpath(script_dir, "..", "..") # Get the path to the parent directory (the project root) Pkg.activate(project_root) # Activate the project #Pkg.instantiate() # download all the required packages using LinearRNNforFMRIdigitalt...
a3b97e9ca7f82e57ff45ffcf5de7fb09e78d3166a9319be09dd2eb3d4e0d06e0
Julia
14,074
300
""" HamsterProfiler A data structure for tracking and managing profiling information during an iterative process, including loss, timing, and verbosity settings. # Fields - `L_train::Matrix{Float64}`: A 2D array where each row corresponds to training loss values for a specific batch across iterations. - `L_val::V...
f22fd04aa90054769d5a0fafb05fbaeabe48b50d5b155ff545993b8995b7ff5a
Julia
14,195
307
#––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––# # MACAQUE VS MARMOSET - DISTRIBUTED WORKING MEMORY # #––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––# #––––––––––––––––––––––––––––––––––––––––––––––––––––# # ...
aef952c06a9e05aa3399001eeae297c4d9b0262de4d9c98e6afe613e7d943dd4
Julia
14,309
271
""" exp_2πi(k⃗, R⃗) Calculate the phase factor exp(2πik⃗⋅R⃗). """ @inline exp_2πi(R⃗, k⃗) = @. exp(2π*im * $*(R⃗', k⃗)) get_empty_complex_hamiltonians(Nε, NkR, mode=Dense()) = Matrix{ComplexF64}[zeros(ComplexF64, Nε, Nε) for _ in 1:NkR] get_empty_complex_hamiltonians(Nε, NkR, ::Sparse) = SparseMatrixCSC{Compl...
5e9a6eba44a7329efc2f89eb3a6dda31abb6e2a1dd36614c6b75e16198e9f3b5
Julia
14,417
369
# Definitions of biophysical models. # # This script builds model structs with fields of tissue compartments and signal fractions, # and forward functions inferencing signals from the model struct and imaging protocol. export model_signals, SANDI, SANDIdot, MTE_SANDI, ExCaliber, MTE_SMT, print_...
a79ecb706a745a2600f4695c2396779d78e8a185e0beb9e0ba203687d9124b17
Julia
14,502
355
### A Pluto.jl notebook ### # v0.20.13 using Markdown using InteractiveUtils # ╔═╡ 34bee668-5efa-472b-9093-e082daf4a796 import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ 353a003c-acc2-4632-b8c5-3765ace40490 using Statistics: mean, std # ╔═╡ 6d701605-96b1-4dfe-a806-4841fd1c6b48 using Distributions: Gamm...
9c0b041dd03c66153b92be014520887ef31925239d4d59df75a598101e72a5c8
Julia
14,544
363
""" fcut(r, rcut) Cut-off function whose value smoothly transitions to zero as `r` approaches `rcut`. Ensures continuity by using a cosine-based smoothing function. # Arguments - `r`: The input distance. - `rcut`: The cutoff radius beyond which the function returns zero. - `rcut_tol`: A tolerance applied to the c...
78628736d428e348dcd745d2286d834dbf9dc9c1a42c697148a9a9954f9a81f2
Julia
14,805
380
""" mutable struct HamiltonianKernel{T1, T2} A kernel structure used for computing weighted similarity functions. # Fields - `ws :: Vector{Float64}`: Weights for each sample point. - `xs :: Vector{T1}`: Sample points. - `sim_params :: T2`: Parameters for the similarity function. """ mutable struct HamiltonianKern...
55a0a705e38679c64ab8fb37250b9631511d9b938beaeaa920b9d30657ffed5c
Julia
14,868
348
### A Pluto.jl notebook ### # v0.20.0 using Markdown using InteractiveUtils # ╔═╡ 7752ef77-6a36-4f65-b9c9-40bb3f4ace3f import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ 703dc739-beab-45ef-a68f-770f47144b60 using Statistics: mean, std, cor # ╔═╡ 3fe7f379-9cc0-438f-8a35-b5d5431acb39 md"# Imports" # ╔═╡ ...
95524f8f2b56d38a358af1c2a470842837d22770c4d32c4d179edfe271b5ae12
Julia
14,901
584
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
c2c4eb7ad1fa608dd9b8788e1c927dafe6944599ba2b0eef46e0fa5c454fa4e7
Julia
15,526
361
""" get_systems(conf) -> Vector{String} Return the list of system names available for a given configuration `conf`. # Arguments - `conf`: A configuration object. # Returns - `Vector{String}`: A list of system names (HDF5 group names or a single system). """ function get_systems(conf) strc_file = get_xdatcar(...
80fdc33bea39acb41b3843be936aa7d9412ac498fcb255cb469567e697359a83
Julia
15,754
389
### A Pluto.jl notebook ### # v0.20.5 using Markdown using InteractiveUtils # ╔═╡ 7f95a967-426a-465f-bad4-671372ea1092 import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ 7d355591-dddd-4463-97b1-d53e223bd6b3 using Statistics: mean # ╔═╡ 8398c332-235b-4f6c-ab1e-8b5fd62d2d5a using Distributions: Gamma # ╔...
27c52eae3cd488fba9be0aae7f84a801a9a0fbe79bbaa16d5b814f9ea8ea27d3
Julia
15,788
389
""" get_systems(conf) -> Vector{String} Return the list of system names available for a given configuration `conf`. # Arguments - `conf`: A configuration object. # Returns - `Vector{String}`: A list of system names (HDF5 group names or a single system). """ function get_systems(conf) strc_file = get_xdatcar(...
cb0f557a34061490a081ea163d9663c822c4f0bad84858aee775acd4f8a8c552
Julia
15,822
645
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # ╔═╡ b63457db-6045-4981-8f70-96a3906c1eb7 begin using Pkg Pkg.activate(Base.current_project()) Pkg.instantiate() # loading usefules using PlutoLinks using PlutoUI end # ╔═╡ 82f4a87c-636f-4159-92fd-ad773bd089cb begin using BrainRBMju...
46c96f06731a933c4be6f16542db68bfd43f3502d695534b2d8b3d215961ce97
Julia
16,101
326
""" ParameterLabel(nnlabel::Int64, ion_label::IonLabel, overlap_label::SVector{3, Int64}) Represents a tight-binding (TB) parameter label by uniquely identifying it based on its nearest neighbor (NN) label, ion label, and overlap label. # Fields - `nnlabel::Int64`: An integer representing the nearest neighbor (N...
a7c0a4ec2b40acd9e16b900b4543a938871533ee7475f6baac4f8cc42e541da9
Julia
16,783
377
import Base.copy abstract type MatrixElement end """ TBOverlap{T<:MatrixElement, OC<:OrbitalConfiguration} Represents a tight-binding (TB) overlap used in calculations, characterized by its type, orbital configuration, and ion label. This represents one interaction term. # Fields - `type::T`: Specifies the type...
f25555c4c8eba5826cad1a1b539c541247e2c913417ff17725ac4f34331a632f
Julia
17,463
389
""" struct Basis{Orb, Ov, P, R} A data structure that represents the basis of a system, containing information about orbitals, overlap integrals, parameters, and precomputed radial functions (RLLM). # Fields - `orbitals::Orb`: A collection of orbitals for each ion in the system. This typically contains the orbita...
fd2275521672e9bdb14dbb8a5018083c69421aa0415e5ddcd973488addc67d38
Julia
17,736
615
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
ec1865fffafae420f6a4d537459f50802ace0004749e21ba2cc21ad22475c024
Julia
18,231
483
# This script builds compartment structs with fields of relevant tissue parameters and # forward functions inferencing signals from the compartment model and imaging protocol. using LinearAlgebra, SpecialFunctions export Cylinder, Stick, Zeppelin, Iso, Sphere, compartment_signals, Compartmen...
2acdf47458cc002a6cd22d978d8ff449f5419aefccfd7e2c7009862d66488547
Julia
18,946
484
### A Pluto.jl notebook ### # v0.20.13 using Markdown using InteractiveUtils # ╔═╡ bfb8b4b5-eee8-47a5-8f55-e23ad3ddbaa9 import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ 2bcdddad-4227-4c56-b452-cff43bec2d41 using Makie: @L_str # ╔═╡ 76c368ee-0aa9-4d8e-b815-d006ec9ae3db using DataFrames: DataFrame # ╔═...
6e3a6fdf9f0621b1cfa2412d718f564afc7faf6df5197703fd4b6d64b942dd3b
Julia
18,971
632
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
a638efc818eb1d6d01bf3ec39130e526e9c4a2b911895f7aac623825f6dcd915
Julia
19,106
477
#---------------------- # Interactive Workflow for algorithm exploration and test #---------------------- ## using Pkg script_dir = @__DIR__ # Get the directory of the current script project_root = joinpath(script_dir, "..", "..") # Get the path to the parent directory (the project root) Pkg.activate(project_root) # Ac...
56405d1ae593e2f6bbe11c7127a78a556092f46ec619da86d6208138de17d4eb
Julia
19,777
486
### A Pluto.jl notebook ### # v0.20.0 using Markdown using InteractiveUtils # ╔═╡ 673c2edc-3667-4834-b489-cdc1d8eec407 import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ 9fcb9477-1365-42e5-b29a-a7e20feddd41 using DataFrames: DataFrame # ╔═╡ ef3f2f53-d4de-4878-95c2-027d2d34ae9e using Statistics: mean # ...
8ce8598621751d59db5557a9af5986e6aa4978241a3ff8d0aaf93a31c081f5f2
Julia
20,311
711
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # ╔═╡ 859e9214-3568-11f0-2108-85a2152204f2 begin using Pkg Pkg.activate(Base.current_project()) Pkg.instantiate() # loading usefules using PlutoLinks using PlutoUI end # ╔═╡ 6c2c8e99-3c8b-4823-80ca-d3af7049a897 begin using BrainRBMju...
79a1865d2f52fa45ad44b4cb0251b32447ba2971644c90de1155239f94285bc8
Julia
20,358
506
""" write_hr(Hr, Rs; filename="hamster_hr", tol=1e-8, verbose=1) Writes Hamiltonian data `Hr` and corresponding lattice vectors `Rs` to a file. # Arguments: - `Hr`: A vector of matrices where each `Hr[R]` contains the Hamiltonian elements corresponding to the lattice vector `Rs[:, R]`. - `Rs`: A 2D array where ea...
38a0462e950e083a6025c374b88a0319a92bfa7223e33a13e3bb70ac07ce071a
Julia
20,682
422
### A Pluto.jl notebook ### # v0.20.5 using Markdown using InteractiveUtils # ╔═╡ 82fb3325-81b1-4516-a57a-721f991282f7 import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ a3deaeb2-12df-4f1e-97a8-e14dc8aab28f using Statistics: median, std, mean # ╔═╡ b1ddac8e-2fab-4d13-852c-6b19adb1594e using Makie: @L_st...
7b8e737f6acca4645f1a201a81262ef4ad0e913b06c549072901fd8f34209abd
Julia
22,783
846
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
6f499a39ce8b2931f656380e1dd3b7d4bab9eccbc817098fd5c4e75106a0352b
Julia
24,261
733
using ProgressMeter using Flux, Distributions, Random, Statistics export NetworkArg, TrainingArg, prepare_training, create_mlp, sigma_level, generate_samples, train_loop!, training, test, save_mlp, load_mlp, nn_estimate, save_nn_maps, losses_rmse, losses_corr, ...
3fd0c6951bcc847b11fd3637f3d17392317c77b1b4a01e832851b7c1a92800a4
Julia
24,710
781
# I/O functions for images and protocols # Including functions to fit measurements to spherical harmonic bases using Fibers, DelimitedFiles, Statistics, StaticArrays export dMRI, Protocol, spherical_fit, spherical_mean, dmri_write, dmri_read, dmri_read_times, dmri_read_times!, dmri_rea...
a1640d3dc26d14b3b7b6291ea69e77862314f08cc3e9a9008ac54d9fdc554bf7
Julia
24,835
896
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
1abf7f84dc0938a01f4c8727d637d91b993f6fd8962e0c66a105b41fba766cb5
Julia
25,837
765
### A Pluto.jl notebook ### # v0.20.4 using Markdown using InteractiveUtils # ╔═╡ c596973a-d074-4ad4-b6b5-4f7e3449c99b begin projectdir = dirname(Base.current_project()) import Pkg Pkg.activate(projectdir) Pkg.instantiate() using Pollen using DataFrames using CSV using WGLMakie ...
2e72c9370f0f2c72da700b2e5ca9092af9c085344c0d4b8f00953de944cdc820
Julia
28,826
880
# MCMC estimation using Random, Distributions, StaticArrays export Sampler, Noisemodel, mcmc!, subsampler, logp_gauss, logp_rician, update!, increment!, getsubfield, draw_samples, draw_samples!, findsubfield """ Noisemodel(logpdf::Function, sigma_start::Float64, ...
58e5420a8942f483ac0d2808c2de9d05412bcf8613d0f815b613252101fd0552
Julia
32,265
782
### A Pluto.jl notebook ### # v0.20.0 using Markdown using InteractiveUtils # ╔═╡ c7a4ca53-587c-4984-b712-b125e57a0aa8 import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ 30c525d5-1060-4a30-ab48-57944716e6fa using DataFrames: DataFrame # ╔═╡ b296c9fe-2a8b-462d-8227-0db4bf747610 using Statistics: mean # ...
e3442d68fa7a7f384720def4f93b998c61582a492dc75770b0936047dc7b1a6d
Julia
35,371
783
### A Pluto.jl notebook ### # v0.20.0 using Markdown using InteractiveUtils # ╔═╡ 7f95a967-426a-465f-bad4-671372ea1092 import Pkg, Revise; Pkg.activate(Base.current_project()) # ╔═╡ c797f3ce-6d16-47e1-8728-82399f2133a9 using DataFrames: DataFrame # ╔═╡ 7d355591-dddd-4463-97b1-d53e223bd6b3 using Statistics: mean # ...
7cee72e50773dc77fd784d41f9ea11ab9f9fe76514fceaf33d1b69142c1e1485
Julia
35,922
1,147
### A Pluto.jl notebook ### # v0.20.4 using Markdown using InteractiveUtils # ╔═╡ a76f6dfc-7bdd-4110-a88f-271a17c6a7c6 begin projectdir = dirname(Base.current_project()) import Pkg Pkg.activate(projectdir) Pkg.instantiate() using Pollen using DataFrames using CSV using WGLMakie ...
8e822d60676c96e5bfea47fd1b488d774803099d2a540fd3380d147a3e432fc7
Julia
46,771
1,308
### A Pluto.jl notebook ### # v0.20.4 using Markdown using InteractiveUtils # ╔═╡ 5b13b446-3e34-4637-bc4e-aa14fcc8d813 # ╠═╡ show_logs = false begin projectdir = dirname(Base.current_project()) import Pkg Pkg.activate(projectdir) Pkg.instantiate() using Pollen using DataFrames using CSV...
0196508d8faa845ba98c479b2a92a6a784a38b2b6e697bb59af9145e7fffbf5e
Julia
47,241
1,658
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
4f22742a554d7555c7fccab8c2924271156efb85cd68804ea9374369ad66b779
Julia
51,833
1,822
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
fd698cbe48df90aa2376b0b4debd9eaf15dea341159f301db267214fdb8e0d3f
Julia
53,922
2,133
### A Pluto.jl notebook ### # v0.20.6 using Markdown using InteractiveUtils # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). macro bind(def, element) #! format: off ...
f57cc25a323dc3332b4de84f7dec1c3cee0ac29b22a93449292129e50451bdf0
Jupyter
49
5
# %% [markdown] # # Quickstart # %% [markdown]
10ea197f5c16063ab8eaee1b2255f48e6ec4ffb3baf71ff6727e1f00e74d9831
Jupyter
51
6
# %% import pandas as pd import numpy as np # %%
20340740b80d1345c786988c2fa4b1836e1c86ce248320396b0fe4bda7811d66
Jupyter
51
11
# %% !pip freeze # %% !pwd # %% !ls /test # %%
3d807ffdeba1d155d3a3a5807570d61439725ab9f5676e990a8d55d4a1e68127
Jupyter
56
8
# %% [markdown] # # Quickstart # %% # %% [markdown]