Appearance
GhostScience Examples
GhostScience ships with 32 runnable Python scripts demonstrating common workflows. Each file is commented like a notebook with narrative cells, expected JSON response shapes, and SDK calls.
Prerequisites
Install the SDK and set your API key:
bash
cd securechat/sdk
pip install -e .
export GHOSTSCIENCE_API_KEY=gst_...Point base_url at your GhostAI deployment (e.g., https://your-host).
Core PhD Tools (01-10)
| Script | Topic |
|---|---|
01_symbolic_calculus.py | Integration, differentiation, series expansion |
02_ode_solving.py | Lorenz attractor, damped oscillator |
03_linear_algebra.py | Linear systems, eigenvalues, SVD |
04_statistics.py | Hypothesis testing, regression, time series |
05_optimization.py | Convex, nonlinear, multi-objective |
06_control_systems.py | Transfer functions, Bode plots, PID tuning |
07_signal_processing.py | FFT, filtering, spectrogram |
08_monte_carlo.py | Simulation, sensitivity analysis |
09_method_comparison.py | Compare solvers side-by-side |
10_export_formats.py | Export to MATLAB, Julia, LaTeX, Jupyter |
Federated Clean Room (11-15)
Multi-org computation where each party contributes data without exposing raw inputs. Primary use case: M&A due diligence.
Additional prerequisites: Two org-scoped API keys (one per organization) or admin access to simulate the multi-org flow.
| Script | Topic |
|---|---|
11_clean_room_lifecycle.py | Create room, invite, accept, set template |
12_ma_revenue_overlap.py | End-to-end M&A due diligence |
13_attestation_verification.py | Mutual attestation, hash verification, error paths |
14_result_escrow.py | Dual approval gates, rejection path |
15_dual_provenance.py | Independent per-org audit records |
DSL Parser (16)
| Script | Topic |
|---|---|
16_dsl_multisyntax_input.py | LaTeX, MATLAB, natural language math input |
PhD Advisor Brain (17-21)
| Script | Topic |
|---|---|
17_persistent_sessions.py | Session lifecycle, state persistence, history |
18_provenance_audit_trail.py | Record, verify, reproduce computations |
19_compute_metering.py | Usage tracking, quota checks, overage handling |
20_symbolic_numeric_bridge.py | SymPy to JAX/C compiled code |
21_progress_checkpointing.py | Progress tracking, cancellation, checkpoints |
Science Workspace (22)
| Script | Topic |
|---|---|
22_science_workspace.py | Cells, branching, dependencies, execution |
Export and Validation (23-24)
| Script | Topic |
|---|---|
23_paper_generation.py | IEEE paper templates, methods sections, citations |
24_matlab_import.py | Octave bridge: .m file translation and execution |
GPU, Verticals, Secure Data (25-27)
Additional prerequisites: GPU-enabled deployment for script 25. Dymium data sources configured for script 27.
| Script | Topic |
|---|---|
25_gpu_hpc_compute.py | GPU jobs, batch sweeps, status polling |
26_industry_verticals.py | Pharma PK/PD, finance options, manufacturing SPC |
27_dymium_secure_data.py | Governed data sources, schema, PII-protected compute |
Platform Extensions (28-30)
These features require optional backends (Qiskit, BioPython, CAD libraries) which may not be available in all deployments. Scripts use try/except to handle unavailable tools.
| Script | Topic |
|---|---|
28_quantum_computing.py | Circuits, simulation, VQE |
29_bioinformatics.py | Sequence analysis, alignment, phylogenetics, scRNA-seq |
30_cad_engineering.py | STEP/SPICE import, mesh generation, Simulink |
Cross-Cutting (31-32)
| Script | Topic |
|---|---|
31_advanced_multi_step.py | Chained symbolic -> numerical -> statistical workflow |
32_reproducibility_guarantees.py | Deterministic RNG, environment hash, bitwise verify |
Running an Example
bash
cd docs/examples
python 01_symbolic_calculus.pyEach script prints results to stdout. For the clean room scripts (11-15), you'll need two separate API keys representing different organizations.
Related
- GhostScience -- feature overview
- PhD API Reference -- endpoint documentation
- SDK Reference -- Python client library
- Clean Room -- federated computation details