Live examples
Every function of the WebAssembly package has a runnable example here — one per function. Press Run and the calculation happens in your browser, with the compiled sci-form-wasm package built for this release (the same code as the npm package, in its single-threaded build); nothing is sent to a server.
Each example gets the same starting variables, so the code stays short:
| Variable | Value |
|---|---|
sci | the compiled module |
smiles | "CCO" (ethanol) |
elements, coords | JSON strings with the atomic numbers and the flat x, y, z (Å) of ethanol, embedded with seed 42 |
waterEl, waterCo | the same for a fixed water geometry (used by the slower methods) |
J | JSON.stringify |
Every function returns a JSON string, so most examples simply return sci.<function>(…) and the page prints the parsed result. Use the same calls in your own code:
import init, * as sci from 'sci-form-wasm'
await init()
const mol = JSON.parse(sci.embed('CCO', 42))
const pm3 = JSON.parse(sci.compute_pm3(JSON.stringify(mol.elements), JSON.stringify(mol.coords)))Structures & conformers
3D structure from SMILES embed
embedBuilds 3D coordinates with ETKDG distance geometry. Same seed, same structure.
return sci.embed(smiles, 42);Many molecules at once embed_batch
embed_batchEmbeds a list of SMILES; failures are reported per molecule, not thrown.
return sci.embed_batch(J(["CCO","c1ccccc1","CC(=O)O"]), 42);Diverse conformer ensemble embed_diverse
embed_diverseGenerates conformers and keeps one per RMSD cluster (Butina).
return sci.embed_diverse("CCCC", 8, 0.5, 42n);UFF-ranked conformer search search_conformers_with_uff
search_conformers_with_uffSamples conformers, minimises each with UFF and ranks them by energy.
return sci.search_conformers_with_uff("CCCC", 6, 42, 0.3);Parse a SMILES parse_smiles
parse_smilesAtoms and bonds of the molecular graph, no 3D needed.
return sci.parse_smiles("c1ccccc1O");Canonical SMILES to_canonical_smiles
to_canonical_smilesDifferent spellings of one molecule give one string.
return J({ input: "OCC", canonical: sci.to_canonical_smiles("OCC") });Smallest set of smallest rings compute_sssr
compute_sssrRing perception of a fused system (naphthalene).
return sci.compute_sssr("c1ccc2ccccc2c1");Stereochemistry analyze_stereo
analyze_stereoR/S centres and E/Z bonds, from the graph and optionally from 3D coordinates.
return sci.analyze_stereo("C(F)(Cl)(Br)I", "[]");Graph features analyze_graph_features
analyze_graph_featuresAromaticity, hybridisation and other per-atom perception results.
return sci.analyze_graph_features("c1ccccc1");Topology from coordinates compute_topology
compute_topologyInfers bonds from a 3D geometry alone.
return sci.compute_topology(elements, coords);Bond orders compute_bond_orders
compute_bond_ordersBond orders from the Extended Hückel density.
return sci.compute_bond_orders(elements, coords);RMSD after alignment compute_rmsd
compute_rmsdKabsch-aligned RMSD between two geometries (here ethanol against a re-embedded copy).
const other = J(JSON.parse(sci.embed_coords(smiles, 7)).coords); return sci.compute_rmsd(coords, other);Pairwise RMSD matrix compute_rmsd_matrix
compute_rmsd_matrixAll-pairs RMSD for a set of conformers.
const c = JSON.parse(sci.embed_diverse("CCCC", 4, 0.1, 42n)); return sci.compute_rmsd_matrix(J(c.map(x => x.coords)));Butina clustering butina_cluster
butina_clusterClusters conformers by RMSD.
const c = JSON.parse(sci.embed_diverse("CCCC", 4, 0.1, 42n)); return sci.butina_cluster(J(c.map(x => x.coords)), 0.5);Keep the diverse conformers filter_diverse
filter_diverseDrops conformers that are within the RMSD cutoff of one already kept.
const c = JSON.parse(sci.embed_diverse("CCCC", 4, 0.1, 42n)); return sci.filter_diverse(J(c.map(x => x.coords)), 0.5);Charges, fingerprints & descriptors
Gasteiger–Marsili charges compute_charges
compute_chargesPartial charges from electronegativity equalisation on the graph.
return sci.compute_charges("CCO");Charges with your own parameters compute_charges_configured
compute_charges_configuredSame method with iteration count, damping and tolerance exposed.
return sci.compute_charges_configured("CCO", 12, 0.5, 1e-6);EEQ charges (3D) compute_eeq_charges
compute_eeq_chargesGeometry-dependent charges from the electronegativity-equalisation model.
return sci.compute_eeq_charges(elements, coords, 0);EEQ electrostatic energy compute_eeq_energy
compute_eeq_energyEnergy of the EEQ charge distribution.
return sci.compute_eeq_energy(elements, coords, 0);Empirical pKa compute_empirical_pka
compute_empirical_pkaGroup-contribution pKa estimate for the acidic/basic sites.
return sci.compute_empirical_pka("CC(=O)O");Molecular descriptors compute_molecular_descriptors
compute_molecular_descriptorsWeight, logP-like and topological descriptors.
return sci.compute_molecular_descriptors("CC(=O)Oc1ccccc1C(=O)O");ML descriptor vector compute_ml_descriptors
compute_ml_descriptorsThe feature vector the property models consume.
return sci.compute_ml_descriptors("CCO");Fast property estimates compute_ml_properties
compute_ml_propertieslogP, solubility and drug-likeness from the descriptor model.
return sci.compute_ml_properties("CCO");Property prediction predict_ml_properties
predict_ml_propertiesSame models through the prediction entry point.
return sci.predict_ml_properties("CCO");Ensemble prediction with uncertainty predict_ensemble
predict_ensembleSeveral models voting, with the spread as a confidence signal.
return sci.predict_ensemble("CCO");ECFP fingerprint compute_ecfp
compute_ecfpMorgan/ECFP bit vector (radius 2, 1024 bits).
return sci.compute_ecfp("CCO", 2, 1024);Fingerprints for a list compute_ecfp_batch
compute_ecfp_batchECFP for many SMILES in one call.
return sci.compute_ecfp_batch(J(["CCO","CCN","c1ccccc1"]), 2, 1024);Tanimoto similarity compute_tanimoto
compute_tanimotoSimilarity of two fingerprints (ethanol vs. ethylamine).
const a = sci.compute_ecfp("CCO", 2, 1024), b = sci.compute_ecfp("CCN", 2, 1024); return sci.compute_tanimoto(a, b);Topological polar surface area compute_tpsa
compute_tpsaPolar surface in Ų from fragment contributions.
return sci.compute_tpsa("CCO");WHIM 3D descriptors compute_whim
compute_whimWeighted holistic invariant descriptors of the 3D shape.
return sci.compute_whim(elements, coords, "mass");RDF descriptors compute_rdf
compute_rdfRadial distribution function descriptor of the geometry.
return sci.compute_rdf(elements, coords, "[]", 100.0, 8.0, 20);GETAWAY descriptors compute_getaway
compute_getawayGeometry, topology and atom-weights assembly descriptors.
const bonds = JSON.parse(sci.compute_topology(elements, coords)).bonds ?? []; return sci.compute_getaway(elements, coords, J(bonds), 3);Atomic environment vectors compute_aevs_tm
compute_aevs_tmPer-atom symmetry-function vectors used by the ANI potentials (24 elements).
return sci.compute_aevs_tm(elements, coords);HOSE codes compute_hose_codes
compute_hose_codesHierarchically ordered spherical environments of each atom.
return sci.compute_hose_codes("CCO", 3);Force fields & optimisation
UFF energy compute_uff_energy
compute_uff_energyUniversal force field energy of the geometry, in kcal/mol.
return sci.compute_uff_energy(smiles, coords);UFF energy by term compute_uff_energy_breakdown
compute_uff_energy_breakdownBond, angle, torsion, inversion and van der Waals contributions.
return sci.compute_uff_energy_breakdown(smiles, coords);UFF with aromatic heuristics compute_uff_energy_with_aromatic_heuristics
compute_uff_energy_with_aromatic_heuristicsUFF energy using the aromatic bond-order heuristic.
const b = JSON.parse(sci.embed("c1ccccc1", 42)); return sci.compute_uff_energy_with_aromatic_heuristics("c1ccccc1", J(b.coords));MMFF94 energy compute_mmff94_energy
compute_mmff94_energyMerck force field energy in kcal/mol.
return sci.compute_mmff94_energy(smiles, coords);MMFF94 energy by term compute_mmff94_energy_breakdown
compute_mmff94_energy_breakdownStretch, bend, stretch-bend, torsion, out-of-plane, vdW and electrostatic parts.
return sci.compute_mmff94_energy_breakdown(smiles, coords);BFGS geometry optimisation optimize_framework
optimize_frameworkMinimises the UFF energy with the shared BFGS engine.
return sci.optimize_framework(smiles, coords, "bfgs", 50, 0.05, 1e-6, 0.2, "[]", "");Optimise on the EHT surface optimize_geometry_eht
optimize_geometry_ehtGeometry optimisation with Extended Hückel forces.
return sci.optimize_geometry_eht(waterEl, waterCo, 20, 0.05, 1e-6, 0.1);EHT gradient compute_eht_gradient
compute_eht_gradientEnergy gradient by central differences of the EHT energy.
return sci.compute_eht_gradient(waterEl, waterCo);PM3 gradient compute_pm3_gradient
compute_pm3_gradientCentral differences of the PM3 energy: it always matches the reported energy (eV/Å).
return sci.compute_pm3_gradient(waterEl, waterCo);xTB (GFN2) gradient compute_xtb_gradient
compute_xtb_gradientCentral differences of the GFN2 energy (eV/Å).
return sci.compute_xtb_gradient(waterEl, waterCo);Quantum chemistry
Extended Hückel theory eht_calculate
eht_calculateOrbital energies, HOMO/LUMO and gap from a minimal-basis Hückel model.
return sci.eht_calculate(elements, coords, 1.75);EHT, full solution solve_eht
solve_ehtSame method returning coefficients and the overlap matrix as well.
return sci.solve_eht(waterEl, waterCo, 1.75);PM3 semi-empirical compute_pm3
compute_pm3MOPAC-style PM3: total energy (eV), heat of formation (kcal/mol), orbitals.
return sci.compute_pm3(waterEl, waterCo);xTB (GFN2-xTB) compute_xtb
compute_xtb`xtb` is GFN2-xTB in every part of the library.
return sci.compute_xtb(waterEl, waterCo);GFN1-xTB compute_gfn1
compute_gfn1Tight-binding with shell-resolved SCC.
return sci.compute_gfn1(waterEl, waterCo);GFN2-xTB compute_gfn2
compute_gfn2Tight-binding with multipole electrostatics and D4 dispersion.
return sci.compute_gfn2(waterEl, waterCo);HF-3c compute_hf3c
compute_hf3cMinimal-basis Hartree–Fock with the three corrections (D3, gCP, SRB).
return sci.compute_hf3c(waterEl, waterCo);HF-3c with options compute_hf3c_custom
compute_hf3c_customSCF iteration limit, CIS states and the corrections switch.
return sci.compute_hf3c_custom(waterEl, waterCo, 100, 0, true);Unrestricted Hartree–Fock compute_uhf
compute_uhfOpen-shell SCF: the methyl radical as a doublet.
return sci.compute_uhf("[6,1,1,1]", "[0,0,0,1.09,0,0,-0.36,1.03,0,-0.36,-0.52,0.89]", 0, 2);Restricted open-shell HF compute_rohf
compute_rohfROHF for the same radical (no spin contamination).
return sci.compute_rohf("[6,1,1,1]", "[0,0,0,1.09,0,0,-0.36,1.03,0,-0.36,-0.52,0.89]", 0, 2);CISD excited states compute_cisd
compute_cisdExcited states from an internal STO-3G RHF reference.
return sci.compute_cisd(waterEl, waterCo, 3);Kohn–Sham DFT compute_dft
compute_dftSVWN or PBE Kohn–Sham on a valence basis (energies in Hartree).
return sci.compute_dft(waterEl, waterCo, "svwn");ANI neural-network potential compute_ani
compute_aniMachine-learned energy for H, C, N, O, F, S, Cl.
return sci.compute_ani(elements, coords);Compare methods side by side compare_methods
compare_methodsRuns several methods on one molecule and tabulates them.
return sci.compare_methods(smiles, elements, coords, true);EHT with an explicit UFF fallback eht_or_uff_fallback
eht_or_uff_fallbackNever silently substitutes: the result says which method ran.
return sci.eht_or_uff_fallback(smiles, elements, coords, true);EHT or UFF (typed result) compute_eht_or_uff_fallback
compute_eht_or_uff_fallbackThe same decision as a structured result.
return sci.compute_eht_or_uff_fallback(smiles, elements, coords, true);Which elements EHT supports eht_support
eht_supportTells whether a set of elements is covered before you compute.
return sci.eht_support(elements);EHT support (detailed) get_eht_support
get_eht_supportPer-element support and the reason when it is missing.
return sci.get_eht_support(elements);Method capabilities of a system system_capabilities
system_capabilitiesWhich methods can handle these elements.
return sci.system_capabilities(elements);System capabilities (full) get_system_capabilities
get_system_capabilitiesCapability flags per method.
return sci.get_system_capabilities(elements);Recommended methods system_method_plan
system_method_planA suggested method order for this composition.
return sci.system_method_plan(elements);Method plan (full) get_system_method_plan
get_system_method_planThe plan with the reasons attached.
return sci.get_system_method_plan(elements);Backends usable for paths list_neb_backends
list_neb_backendsEnergy backends that can drive a reaction path for these elements.
return sci.list_neb_backends(elements);Electronic properties & solvation
Mulliken & Löwdin charges compute_population
compute_populationAtomic populations from the EHT density.
return sci.compute_population(elements, coords);Dipole moment compute_dipole
compute_dipoleMagnitude and components in Debye.
return sci.compute_dipole(elements, coords);Electrostatic potential compute_esp
compute_espPotential on a 3D grid around the molecule.
return sci.compute_esp_grid_info(waterEl, waterCo, 0.7, 3.0);ESP grid dimensions compute_esp_grid_info
compute_esp_grid_infoOrigin, spacing and shape of the ESP grid before computing it.
return sci.compute_esp_grid_info(elements, coords, 0.5, 3.0);Density of states compute_dos
compute_dosGaussian-broadened DOS and the per-atom projections.
return sci.compute_dos(elements, coords, 0.3, -30, 5, 50);DOS from any method compute_dos_multimethod
compute_dos_multimethodDOS from EHT, PM3, xTB, GFN1/2 or HF-3c orbital energies.
return sci.compute_dos_multimethod(waterEl, waterCo, "pm3", 0.3, -40, 10, 50);Frontier-orbital descriptors compute_frontier_descriptors
compute_frontier_descriptorsHOMO/LUMO-based reactivity indices.
return sci.compute_frontier_descriptors(elements, coords);Fukui functions compute_fukui_descriptors
compute_fukui_descriptorsWhere a molecule is electrophilic or nucleophilic.
return sci.compute_fukui_descriptors(elements, coords);Reactive-site ranking compute_reactivity_ranking
compute_reactivity_rankingAtoms ranked by their combined reactivity indices.
return sci.compute_reactivity_ranking(elements, coords);Solvent-accessible surface compute_sasa
compute_sasaShrake–Rupley SASA in Ų, total and per atom.
return sci.compute_sasa(elements, coords, 1.4);Non-polar solvation compute_nonpolar_solvation
compute_nonpolar_solvationSASA-based non-polar solvation energy.
return sci.compute_nonpolar_solvation(elements, coords, 1.4);Generalised-Born solvation compute_gb_solvation
compute_gb_solvationPolar solvation energy from partial charges (water by default).
const q = JSON.parse(sci.compute_charges(smiles)).charges; return sci.compute_gb_solvation(elements, coords, J(q), 78.5, 1.0, 1.4);Spectra
Vibrational frequencies compute_vibrational_analysis
compute_vibrational_analysisNormal modes from a numerical Hessian of the chosen method.
return sci.compute_vibrational_analysis(waterEl, waterCo, "pm3", 0.005);Vibrational analysis with UFF compute_vibrational_analysis_uff
compute_vibrational_analysis_uffFrequencies from the UFF Hessian.
return sci.compute_vibrational_analysis_uff(smiles, elements, coords, 0.005);IR spectrum from an analysis compute_ir_spectrum
compute_ir_spectrumLorentzian-broadened spectrum from the vibrational analysis JSON.
const a = sci.compute_vibrational_analysis_uff(smiles, elements, coords, 0.005); return sci.compute_ir_spectrum(a, 15, 400, 4000, 80);IR spectrum in one call compute_ir_spectrum_broadened
compute_ir_spectrum_broadenedRuns the analysis and broadens it (Lorentzian or Gaussian).
return sci.compute_ir_spectrum_broadened(waterEl, waterCo, "pm3", 20, 400, 4500, 80, "lorentzian", 0.005, "O");Assign IR peaks to groups assign_peaks
assign_peaksMatches peaks to functional groups through group-frequency tables.
return sci.assign_peaks("[3400, 2950, 1050]", "[1.0, 0.6, 0.8]", elements, "[]");UV–Vis (sTDA) compute_stda_uvvis
compute_stda_uvvisExcitation energies and oscillator strengths, broadened.
return sci.compute_stda_uvvis(waterEl, waterCo, 0.3, 1.0, 12.0, 60, "gaussian");UV–Vis from EHT compute_uv_vis_spectrum
compute_uv_vis_spectrumQuick UV–Vis estimate from EHT orbital energies.
return sci.compute_uv_vis_spectrum(elements, coords, 0.3, 1.0, 12.0, 60);Fluorescence compute_fluorescence
compute_fluorescenceEmission spectrum with Stokes shift and a dark-state threshold.
return sci.compute_fluorescence(waterEl, waterCo, 0.3, 1.0, 12.0, 60, 0.3, 1.0, 0.001, "gaussian");NMR spectrum (¹H) compute_nmr_spectrum
compute_nmr_spectrumLorentzian-broadened ¹H spectrum predicted from HOSE codes.
return sci.compute_nmr_spectrum("CCO", "1H", 0.02, 0, 12, 100);NMR spectrum with 3D couplings compute_nmr_spectrum_with_coords
compute_nmr_spectrum_with_coordsSame spectrum with J-couplings from the geometry.
return sci.compute_nmr_spectrum_with_coords(smiles, coords, "1H", 0.02, 0, 12, 100);NMR shifts predict_nmr_shifts
predict_nmr_shiftsPredicted ¹H chemical shifts per atom.
return sci.predict_nmr_shifts("CCO");NMR shifts for a nucleus predict_nmr_shifts_for_nucleus
predict_nmr_shifts_for_nucleusSame for ¹³C.
return sci.predict_nmr_shifts_for_nucleus("CCO", "13C");NMR J-couplings predict_nmr_couplings
predict_nmr_couplingsKarplus-type ³J couplings from the geometry.
return sci.predict_nmr_couplings(smiles, coords);Boltzmann-averaged J-couplings compute_ensemble_j_couplings
compute_ensemble_j_couplingsCouplings averaged over a conformer ensemble.
const c = JSON.parse(sci.embed_diverse("CCCC", 3, 0.1, 42n)); const xs = c.map(x => x.coords); return sci.compute_ensemble_j_couplings("CCCC", J(xs), J(xs.map((_, i) => i * 0.5)), 298.15);GIAO NMR shielding compute_giao_nmr
compute_giao_nmrAb-initio shielding tensors (slow; STO-3G).
return sci.compute_giao_nmr(waterEl, waterCo, "1H", 0, 1, 50, true, false);Orbitals & grids
Orbital isosurface (mesh) eht_orbital_mesh
eht_orbital_meshMarching-cubes mesh of a molecular orbital, ready for WebGL.
return sci.eht_orbital_mesh(waterEl, waterCo, 3, 0.5, 0.05);Orbital mesh with any method compute_orbital_mesh
compute_orbital_meshIsosurface from EHT, PM3, xTB or HF-3c orbitals.
return sci.compute_orbital_mesh(waterEl, waterCo, "eht", 3, 0.5, 3.0, 0.05);Orbital grid dimensions eht_volumetric_grid_info
eht_volumetric_grid_infoGrid shape and bounds for volumetric rendering.
return sci.eht_volumetric_grid_info(elements, coords, 0.5, 3.0);Reactions, paths & kinetics
Apply a SMIRKS reaction apply_smirks
apply_smirksRuns a reaction transform on a SMILES and returns the products.
return sci.apply_smirks("[C:1][OH:2]>>[C:1][O:2]C", "CCO");Parse a SMIRKS parse_smirks
parse_smirksShows the reactant and product patterns and the atom maps.
return sci.parse_smirks("[C:1][OH:2]>>[C:1][O:2]C");Simplified NEB path (UFF) compute_simplified_neb_path
compute_simplified_neb_pathA spring-coupled path between two geometries of the same molecule.
const a = J(JSON.parse(sci.embed_coords(smiles, 1)).coords), b = J(JSON.parse(sci.embed_coords(smiles, 2)).coords); return sci.compute_simplified_neb_path(smiles, a, b, 4, 5, 0.1, 0.01);NEB path with any backend compute_neb_path_with_method
compute_neb_path_with_methodSame path with a chosen energy backend (uff, mmff94, pm3, xtb, gfn1, gfn2, hf3c).
const a = J(JSON.parse(sci.embed_coords(smiles, 1)).coords), b = J(JSON.parse(sci.embed_coords(smiles, 2)).coords); return sci.compute_neb_path_with_method(smiles, a, b, 4, 5, 0.1, 0.01, "uff");Single-point energy (any backend) neb_single_point_energy
neb_single_point_energyOne energy in kcal/mol; no gradient is computed.
return sci.neb_single_point_energy("pm3", smiles, coords);Energy and gradient (any backend) neb_energy_and_gradient
neb_energy_and_gradientEnergy plus gradient (analytic for force fields, central differences for PM3/xTB).
return sci.neb_energy_and_gradient("uff", smiles, coords);Molecular dynamics (NVE) compute_md_trajectory
compute_md_trajectoryVelocity Verlet with the UFF force field.
return sci.compute_md_trajectory(smiles, coords, 20, 0.5, 42);Molecular dynamics (NVT) compute_md_trajectory_nvt
compute_md_trajectory_nvtBerendsen thermostat at a target temperature.
return sci.compute_md_trajectory_nvt(smiles, coords, 20, 0.5, 42, 300, 100);Molecular dynamics with any backend compute_md_trajectory_with_method
compute_md_trajectory_with_methodMD driven by uff, pm3 or xtb (GFN2).
return sci.compute_md_trajectory_with_method(smiles, coords, elements, 5, 0.5, 42, 300, "uff");Reaction path (1D coordinate) compute_reaction_dynamics
compute_reaction_dynamicsEmbeds reactants and products and relaxes a path between them.
return sci.compute_reaction_dynamics(J(["CC=O"]), J(["CC=O"]), "uff", "{}");Harmonic TST rate compute_htst_rate
compute_htst_rateRate constant from the activation and reaction free energies (eV).
return sci.compute_htst_rate(0.8, -0.2, 298.15);Rate vs. temperature compute_htst_sweep
compute_htst_sweepThe same rate over a list of temperatures.
return sci.compute_htst_sweep(0.8, -0.2, J([250, 300, 350, 400]));Elementary-step analysis analyze_gsm_mbh_htst_step
analyze_gsm_mbh_htst_stepGSM + MBH + HTST analysis of one step (reactant/product geometries).
const a = J(JSON.parse(sci.embed_coords(smiles, 1)).coords); return sci.analyze_gsm_mbh_htst_step(smiles, a, a, "uff", 298.15, 1.0);Kinetics diagnostics extract_kinetics_diagnostics
extract_kinetics_diagnosticsDiagnostics of a microkinetic network (demo network).
return sci.extract_kinetics_diagnostics("", 5);Microkinetic network solve_microkinetic_network
solve_microkinetic_networkTime evolution of the populations of a reaction network.
return sci.solve_microkinetic_network("", 5);Microkinetic steady state solve_microkinetic_steady_state
solve_microkinetic_steady_stateSteady-state populations by integration to convergence.
return sci.solve_microkinetic_steady_state("", 5, 1e-10);Crystals & materials
Unit cell create_unit_cell
create_unit_cellLattice vectors, volume and parameters from a, b, c, α, β, γ.
return sci.create_unit_cell(5.0, 5.0, 5.0, 90, 90, 90);Assemble a framework assemble_framework
assemble_frameworkBuilds a periodic framework from a topology and a metal node.
return sci.assemble_framework("pcu", 30, "octahedral", 10.0, 1);Periodic molecular graph build_periodic_molecule
build_periodic_moleculeBonds across cell boundaries from fractional coordinates.
return sci.build_periodic_molecule("[11,17]", "[[0,0,0],[0.5,0.5,0.5]]", J([5.64,5.64,5.64,90,90,90]), 0.3);Hapticity detect_hapticity
detect_hapticityFinds η-bonded rings in organometallic complexes.
return sci.detect_hapticity(elements, coords, "[]");Space group by number space_group_by_number
space_group_by_numberSymbol, system and symmetry operations of group 225.
return sci.space_group_by_number(225);Space group by symbol space_group_by_symbol
space_group_by_symbolLook up a group by its Hermann–Mauguin symbol.
return sci.space_group_by_symbol("P1");All 230 space groups all_space_groups
all_space_groupsThe complete list, for building selectors.
return sci.all_space_groups();Parse a CIF parse_cif
parse_cifCrystal structure from CIF text.
return sci.parse_cif("data_test\n_cell_length_a 5.0\n_cell_length_b 5.0\n_cell_length_c 5.0\n_cell_angle_alpha 90\n_cell_angle_beta 90\n_cell_angle_gamma 90\nloop_\n_atom_site_label\n_atom_site_type_symbol\n_atom_site_fract_x\n_atom_site_fract_y\n_atom_site_fract_z\n_atom_site_occupancy\nNa1 Na 0.0 0.0 0.0 1.0\n");Write a CIF write_cif
write_cifRound trip: CIF text → structure → CIF text.
const s = sci.parse_cif("data_test\n_cell_length_a 5.0\n_cell_length_b 5.0\n_cell_length_c 5.0\n_cell_angle_alpha 90\n_cell_angle_beta 90\n_cell_angle_gamma 90\nloop_\n_atom_site_label\n_atom_site_type_symbol\n_atom_site_fract_x\n_atom_site_fract_y\n_atom_site_fract_z\n_atom_site_occupancy\nNa1 Na 0.0 0.0 0.0 1.0\n"); return sci.write_cif(s);Machine learning
Random forest train_random_forest
train_random_forestTrains a regressor on a small feature table and reports the fit.
const X = [[0],[1],[2],[3],[4],[5]], y = [0,1,4,9,16,25]; return sci.train_random_forest(J(X), J(y), 20, 4, 2, 1, 0.8, 42n);Gradient boosting train_gradient_boosting
train_gradient_boostingBoosted trees on the same table.
const X = [[0],[1],[2],[3],[4],[5]], y = [0,1,4,9,16,25]; return sci.train_gradient_boosting(J(X), J(y), 30, 0.1, 3, 2, 1, 0.8, 42n);Utilities
Library version version
versionThe version of the compiled package that is running in your browser.
return sci.version();Worker count estimate_workers
estimate_workersHow many workers to use for a batch of a given size.
return J(sci.estimate_workers(1000, 8));Electrochemistry, periodic systems & charts
Double-layer potential profile compute_edl_profile
compute_edl_profilePotential versus distance from an electrode (Helmholtz, Gouy–Chapman or GCS).
return sci.compute_edl_profile(0.1, "gouy-chapman", 0.1, 298.15, 20, 20);Helmholtz layer compute_helmholtz_profile
compute_helmholtz_profileThe compact-layer model.
return sci.compute_helmholtz_profile(0.05, 0.1);Gouy–Chapman layer compute_gouy_chapman_profile
compute_gouy_chapman_profileThe diffuse-layer model.
return sci.compute_gouy_chapman_profile(0.05, 0.1);Gouy–Chapman–Stern compute_gcs_profile
compute_gcs_profileA Stern layer in series with the diffuse layer.
return sci.compute_gcs_profile(0.05, 0.1, 3.0);Capacitance vs. potential compute_edl_capacitance_scan
compute_edl_capacitance_scanDifferential capacitance over a potential window.
return sci.compute_edl_capacitance_scan(-0.3, 0.3, 7, 0.1, "gouy-chapman");EDL chart compute_edl_chart
compute_edl_chartThe profile as a ready-to-plot chart payload.
return sci.compute_edl_chart(0.1, 0.1);Capacitance chart compute_capacitance_chart
compute_capacitance_chartThe scan as a chart payload.
return sci.compute_capacitance_chart(-0.5, 0.5, 11, 0.1, "gouy-chapman");k-point mesh compute_kmesh
compute_kmeshA Monkhorst–Pack mesh of the Brillouin zone with its weights.
return sci.compute_kmesh("[2,2,2]", "monkhorst-pack");Check k-point weights validate_kmesh_weights
validate_kmesh_weightsVerifies that the weights of a mesh sum to one.
return sci.validate_kmesh_weights("[0.25,0.25,0.25,0.25]", 1e-9);Bloch phase bloch_phase
bloch_phaseThe phase factor exp(i k·T) of a lattice translation.
return sci.bloch_phase(0.5, 0, 0, 1, 0, 0);Bloch Hamiltonian build_bloch_hamiltonian
build_bloch_hamiltonianH(k) built from real-space blocks (a 1D tight-binding chain).
return sci.build_bloch_hamiltonian(J([{matrix:[[-1.0]],translation:[0,0,0]},{matrix:[[-0.5]],translation:[1,0,0]},{matrix:[[-0.5]],translation:[-1,0,0]}]), 0.25, 0, 0);Operators on a k-mesh assemble_periodic_operators
assemble_periodic_operatorsH(k) and S(k) on every point of a mesh.
return sci.assemble_periodic_operators(J([{matrix:[[-1.0]],translation:[0,0,0]},{matrix:[[-0.5]],translation:[1,0,0]},{matrix:[[-0.5]],translation:[-1,0,0]}]), J([{matrix:[[1.0]],translation:[0,0,0]}]), "[4,1,1]", "monkhorst-pack");Periodic density of states compute_periodic_dos
compute_periodic_dosKPM density of states of the tight-binding chain.
return sci.compute_periodic_dos(J([{matrix:[[-1.0]],translation:[0,0,0]},{matrix:[[-0.5]],translation:[1,0,0]},{matrix:[[-0.5]],translation:[-1,0,0]}]), "[8,1,1]", "monkhorst-pack", 30, -3, 1, 40, null);Randomised periodic solver solve_periodic_randnla
solve_periodic_randnlaNyström/RandNLA solution of the periodic eigenproblem.
return sci.solve_periodic_randnla(J([{matrix:[[-1.0,-0.2],[-0.2,-0.6]],translation:[0,0,0]},{matrix:[[-0.3,0],[0,-0.2]],translation:[1,0,0]},{matrix:[[-0.3,0],[0,-0.2]],translation:[-1,0,0]}]), J([{matrix:[[1,0],[0,1]],translation:[0,0,0]}]), 2, "[2,1,1]", "monkhorst-pack", null);Brillouin-zone integral (scalar) bz_integrate_scalar
bz_integrate_scalarWeighted average of a scalar over the k-mesh.
return sci.bz_integrate_scalar("[1,2,3,4]", "[0.25,0.25,0.25,0.25]");Brillouin-zone integral (vector) bz_integrate_vector
bz_integrate_vectorWeighted average of a vector quantity.
return sci.bz_integrate_vector(J([[1,0,0],[0,1,0]]), "[0.5,0.5]");Check the electron count validate_electron_count
validate_electron_countWhether the electrons fit the bands of the mesh.
return sci.validate_electron_count(2, 2, 4);Band-structure chart compute_band_structure_chart
compute_band_structure_chartBands along a high-symmetry path, as a chart payload.
return sci.compute_band_structure_chart("[6]", "[0,0,0]", "[3,0,0,0,3,0,0,0,3]", 3);DOS chart compute_dos_chart
compute_dos_chartA density of states as a chart payload.
return sci.compute_dos_chart("[-1,0,1]", "[0.1,0.5,0.1]");k-path chart compute_kpoint_path_chart
compute_kpoint_path_chartThe high-symmetry path through the Brillouin zone.
return sci.compute_kpoint_path_chart(5);Fermi-surface chart compute_fermi_surface_chart
compute_fermi_surface_chartConstant-energy contour of a 2D band.
return sci.compute_fermi_surface_chart(J([{matrix:[[-1.0]],translation:[0,0,0]},{matrix:[[-0.5]],translation:[1,0,0]},{matrix:[[-0.5]],translation:[-1,0,0]}]), null, 4, 4);Arrhenius chart compute_arrhenius_chart
compute_arrhenius_chartln k against 1/T.
return sci.compute_arrhenius_chart("[300,400,500]", "[0.001,0.1,5]");Thermal-properties chart compute_thermal_prop_chart
compute_thermal_prop_chartRate and equilibrium constants against temperature.
return sci.compute_thermal_prop_chart(0.8, -0.2, "[300,400,500]");Phase portrait compute_phase_portrait_chart
compute_phase_portrait_chartPopulation trajectory of the demo microkinetic network.
return sci.compute_phase_portrait_chart("", 5);Path trajectory chart compute_trajectory_chart
compute_trajectory_chartThe path between two geometries as a chart payload.
const a = J(JSON.parse(sci.embed_coords(smiles, 1)).coords), b = J(JSON.parse(sci.embed_coords(smiles, 2)).coords); return sci.compute_trajectory_chart(smiles, a, b, "uff");Reaction-coordinate chart compute_reaction_coordinate_chart
compute_reaction_coordinate_chartEnergy along the path as a chart payload.
const a = J(JSON.parse(sci.embed_coords(smiles, 1)).coords), b = J(JSON.parse(sci.embed_coords(smiles, 2)).coords); return sci.compute_reaction_coordinate_chart(smiles, a, b, "uff");Chart to JSON chart_to_json
chart_to_jsonSerialises a chart payload.
return sci.chart_to_json(sci.compute_dos_chart("[-1,0,1]", "[0.1,0.5,0.1]"));Chart from JSON chart_from_json
chart_from_jsonParses a chart payload back.
return sci.chart_from_json(sci.chart_to_json(sci.compute_dos_chart("[-1,0,1]", "[0.1,0.5,0.1]")));Validate a chart validate_chart_schema
validate_chart_schemaChecks that a payload follows the chart schema.
return J({ valid: sci.validate_chart_schema(sci.compute_dos_chart("[-1,0,1]", "[0.1,0.5,0.1]")) });