@wentorai/research-plugins 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +204 -0
- package/curated/analysis/README.md +64 -0
- package/curated/domains/README.md +104 -0
- package/curated/literature/README.md +53 -0
- package/curated/research/README.md +62 -0
- package/curated/tools/README.md +87 -0
- package/curated/writing/README.md +61 -0
- package/index.ts +39 -0
- package/mcp-configs/academic-db/ChatSpatial.json +17 -0
- package/mcp-configs/academic-db/academia-mcp.json +17 -0
- package/mcp-configs/academic-db/academic-paper-explorer.json +17 -0
- package/mcp-configs/academic-db/academic-search-mcp-server.json +17 -0
- package/mcp-configs/academic-db/agentinterviews-mcp.json +17 -0
- package/mcp-configs/academic-db/all-in-mcp.json +17 -0
- package/mcp-configs/academic-db/apple-health-mcp.json +17 -0
- package/mcp-configs/academic-db/arxiv-latex-mcp.json +17 -0
- package/mcp-configs/academic-db/arxiv-mcp-server.json +17 -0
- package/mcp-configs/academic-db/bgpt-mcp.json +17 -0
- package/mcp-configs/academic-db/biomcp.json +17 -0
- package/mcp-configs/academic-db/biothings-mcp.json +17 -0
- package/mcp-configs/academic-db/catalysishub-mcp-server.json +17 -0
- package/mcp-configs/academic-db/clinicaltrialsgov-mcp-server.json +17 -0
- package/mcp-configs/academic-db/deep-research-mcp.json +17 -0
- package/mcp-configs/academic-db/dicom-mcp.json +17 -0
- package/mcp-configs/academic-db/enrichr-mcp-server.json +17 -0
- package/mcp-configs/academic-db/fec-mcp-server.json +17 -0
- package/mcp-configs/academic-db/fhir-mcp-server-themomentum.json +17 -0
- package/mcp-configs/academic-db/fhir-mcp.json +19 -0
- package/mcp-configs/academic-db/gget-mcp.json +17 -0
- package/mcp-configs/academic-db/google-researcher-mcp.json +17 -0
- package/mcp-configs/academic-db/idea-reality-mcp.json +17 -0
- package/mcp-configs/academic-db/legiscan-mcp.json +19 -0
- package/mcp-configs/academic-db/lex.json +17 -0
- package/mcp-configs/ai-platform/Adaptive-Graph-of-Thoughts-MCP-server.json +17 -0
- package/mcp-configs/ai-platform/ai-counsel.json +17 -0
- package/mcp-configs/ai-platform/atlas-mcp-server.json +17 -0
- package/mcp-configs/ai-platform/counsel-mcp.json +17 -0
- package/mcp-configs/ai-platform/cross-llm-mcp.json +17 -0
- package/mcp-configs/ai-platform/gptr-mcp.json +17 -0
- package/mcp-configs/browser/decipher-research-agent.json +17 -0
- package/mcp-configs/browser/deep-research.json +17 -0
- package/mcp-configs/browser/everything-claude-code.json +17 -0
- package/mcp-configs/browser/gpt-researcher.json +17 -0
- package/mcp-configs/browser/heurist-agent-framework.json +17 -0
- package/mcp-configs/data-platform/4everland-hosting-mcp.json +17 -0
- package/mcp-configs/data-platform/context-keeper.json +17 -0
- package/mcp-configs/data-platform/context7.json +19 -0
- package/mcp-configs/data-platform/contextstream-mcp.json +17 -0
- package/mcp-configs/data-platform/email-mcp.json +17 -0
- package/mcp-configs/note-knowledge/ApeRAG.json +17 -0
- package/mcp-configs/note-knowledge/In-Memoria.json +17 -0
- package/mcp-configs/note-knowledge/agent-memory.json +17 -0
- package/mcp-configs/note-knowledge/aimemo.json +17 -0
- package/mcp-configs/note-knowledge/biel-mcp.json +19 -0
- package/mcp-configs/note-knowledge/cognee.json +17 -0
- package/mcp-configs/note-knowledge/context-awesome.json +17 -0
- package/mcp-configs/note-knowledge/context-mcp.json +17 -0
- package/mcp-configs/note-knowledge/conversation-handoff-mcp.json +17 -0
- package/mcp-configs/note-knowledge/cortex.json +17 -0
- package/mcp-configs/note-knowledge/devrag.json +17 -0
- package/mcp-configs/note-knowledge/easy-obsidian-mcp.json +17 -0
- package/mcp-configs/note-knowledge/engram.json +17 -0
- package/mcp-configs/note-knowledge/gnosis-mcp.json +17 -0
- package/mcp-configs/note-knowledge/graphlit-mcp-server.json +19 -0
- package/mcp-configs/reference-mgr/arxiv-cli.json +17 -0
- package/mcp-configs/reference-mgr/arxiv-search-mcp.json +17 -0
- package/mcp-configs/reference-mgr/chiken.json +17 -0
- package/mcp-configs/reference-mgr/claude-scholar.json +17 -0
- package/mcp-configs/reference-mgr/devonthink-mcp.json +17 -0
- package/mcp-configs/registry.json +447 -0
- package/openclaw.plugin.json +21 -0
- package/package.json +61 -0
- package/skills/analysis/dataviz/color-accessibility-guide/SKILL.md +230 -0
- package/skills/analysis/dataviz/geospatial-viz-guide/SKILL.md +218 -0
- package/skills/analysis/dataviz/interactive-viz-guide/SKILL.md +287 -0
- package/skills/analysis/dataviz/network-visualization-guide/SKILL.md +195 -0
- package/skills/analysis/dataviz/publication-figures-guide/SKILL.md +238 -0
- package/skills/analysis/dataviz/python-dataviz-guide/SKILL.md +195 -0
- package/skills/analysis/econometrics/causal-inference-guide/SKILL.md +197 -0
- package/skills/analysis/econometrics/iv-regression-guide/SKILL.md +198 -0
- package/skills/analysis/econometrics/panel-data-guide/SKILL.md +274 -0
- package/skills/analysis/econometrics/robustness-checks/SKILL.md +250 -0
- package/skills/analysis/econometrics/stata-regression/SKILL.md +117 -0
- package/skills/analysis/econometrics/time-series-guide/SKILL.md +235 -0
- package/skills/analysis/statistics/bayesian-statistics-guide/SKILL.md +221 -0
- package/skills/analysis/statistics/hypothesis-testing-guide/SKILL.md +210 -0
- package/skills/analysis/statistics/meta-analysis-guide/SKILL.md +206 -0
- package/skills/analysis/statistics/nonparametric-tests-guide/SKILL.md +221 -0
- package/skills/analysis/statistics/power-analysis-guide/SKILL.md +240 -0
- package/skills/analysis/statistics/sem-guide/SKILL.md +231 -0
- package/skills/analysis/statistics/survival-analysis-guide/SKILL.md +195 -0
- package/skills/analysis/wrangling/missing-data-handling/SKILL.md +224 -0
- package/skills/analysis/wrangling/pandas-data-wrangling/SKILL.md +242 -0
- package/skills/analysis/wrangling/questionnaire-design-guide/SKILL.md +234 -0
- package/skills/analysis/wrangling/text-mining-guide/SKILL.md +225 -0
- package/skills/domains/ai-ml/computer-vision-guide/SKILL.md +213 -0
- package/skills/domains/ai-ml/deep-learning-papers-guide/SKILL.md +200 -0
- package/skills/domains/ai-ml/llm-evaluation-guide/SKILL.md +194 -0
- package/skills/domains/ai-ml/prompt-engineering-research/SKILL.md +233 -0
- package/skills/domains/ai-ml/reinforcement-learning-guide/SKILL.md +254 -0
- package/skills/domains/ai-ml/transformer-architecture-guide/SKILL.md +233 -0
- package/skills/domains/biomedical/clinical-research-guide/SKILL.md +232 -0
- package/skills/domains/biomedical/clinicaltrials-api/SKILL.md +177 -0
- package/skills/domains/biomedical/epidemiology-guide/SKILL.md +200 -0
- package/skills/domains/biomedical/genomics-analysis-guide/SKILL.md +270 -0
- package/skills/domains/business/market-analysis-guide/SKILL.md +112 -0
- package/skills/domains/business/strategic-management-guide/SKILL.md +154 -0
- package/skills/domains/chemistry/computational-chemistry-guide/SKILL.md +266 -0
- package/skills/domains/chemistry/retrosynthesis-guide/SKILL.md +215 -0
- package/skills/domains/cs/algorithms-complexity-guide/SKILL.md +194 -0
- package/skills/domains/cs/dblp-api/SKILL.md +129 -0
- package/skills/domains/cs/software-engineering-research/SKILL.md +218 -0
- package/skills/domains/ecology/biodiversity-data-guide/SKILL.md +296 -0
- package/skills/domains/ecology/conservation-biology-guide/SKILL.md +198 -0
- package/skills/domains/ecology/gbif-api/SKILL.md +158 -0
- package/skills/domains/ecology/inaturalist-api/SKILL.md +173 -0
- package/skills/domains/economics/behavioral-economics-guide/SKILL.md +239 -0
- package/skills/domains/economics/development-economics-guide/SKILL.md +181 -0
- package/skills/domains/economics/fred-api/SKILL.md +189 -0
- package/skills/domains/education/curriculum-design-guide/SKILL.md +144 -0
- package/skills/domains/education/learning-science-guide/SKILL.md +150 -0
- package/skills/domains/finance/financial-data-analysis/SKILL.md +152 -0
- package/skills/domains/finance/quantitative-finance-guide/SKILL.md +151 -0
- package/skills/domains/geoscience/climate-science-guide/SKILL.md +158 -0
- package/skills/domains/geoscience/gis-remote-sensing-guide/SKILL.md +129 -0
- package/skills/domains/humanities/digital-humanities-guide/SKILL.md +181 -0
- package/skills/domains/humanities/philosophy-research-guide/SKILL.md +148 -0
- package/skills/domains/law/courtlistener-api/SKILL.md +213 -0
- package/skills/domains/law/legal-research-guide/SKILL.md +250 -0
- package/skills/domains/math/linear-algebra-applications/SKILL.md +227 -0
- package/skills/domains/math/numerical-methods-guide/SKILL.md +236 -0
- package/skills/domains/math/oeis-api/SKILL.md +158 -0
- package/skills/domains/pharma/clinical-pharmacology-guide/SKILL.md +165 -0
- package/skills/domains/pharma/drug-development-guide/SKILL.md +177 -0
- package/skills/domains/physics/computational-physics-guide/SKILL.md +300 -0
- package/skills/domains/physics/nasa-ads-api/SKILL.md +150 -0
- package/skills/domains/physics/quantum-computing-guide/SKILL.md +234 -0
- package/skills/domains/social-science/social-research-methods/SKILL.md +194 -0
- package/skills/domains/social-science/survey-research-guide/SKILL.md +182 -0
- package/skills/literature/discovery/citation-alert-guide/SKILL.md +154 -0
- package/skills/literature/discovery/conference-proceedings-guide/SKILL.md +142 -0
- package/skills/literature/discovery/literature-mapping-guide/SKILL.md +175 -0
- package/skills/literature/discovery/paper-tracking-guide/SKILL.md +211 -0
- package/skills/literature/discovery/rss-paper-feeds/SKILL.md +214 -0
- package/skills/literature/discovery/semantic-scholar-recs-guide/SKILL.md +164 -0
- package/skills/literature/fulltext/doaj-api/SKILL.md +120 -0
- package/skills/literature/fulltext/interlibrary-loan-guide/SKILL.md +163 -0
- package/skills/literature/fulltext/open-access-guide/SKILL.md +183 -0
- package/skills/literature/fulltext/pmc-oai-api/SKILL.md +184 -0
- package/skills/literature/fulltext/preprint-servers-guide/SKILL.md +128 -0
- package/skills/literature/fulltext/repository-harvesting-guide/SKILL.md +207 -0
- package/skills/literature/fulltext/unpaywall-api/SKILL.md +113 -0
- package/skills/literature/metadata/altmetrics-guide/SKILL.md +132 -0
- package/skills/literature/metadata/citation-network-guide/SKILL.md +236 -0
- package/skills/literature/metadata/crossref-api/SKILL.md +133 -0
- package/skills/literature/metadata/datacite-api/SKILL.md +126 -0
- package/skills/literature/metadata/doi-resolution-guide/SKILL.md +168 -0
- package/skills/literature/metadata/h-index-guide/SKILL.md +183 -0
- package/skills/literature/metadata/journal-metrics-guide/SKILL.md +188 -0
- package/skills/literature/metadata/opencitations-api/SKILL.md +128 -0
- package/skills/literature/metadata/orcid-api/SKILL.md +136 -0
- package/skills/literature/metadata/orcid-integration-guide/SKILL.md +178 -0
- package/skills/literature/search/arxiv-api/SKILL.md +95 -0
- package/skills/literature/search/biorxiv-api/SKILL.md +123 -0
- package/skills/literature/search/boolean-search-guide/SKILL.md +199 -0
- package/skills/literature/search/citation-chaining-guide/SKILL.md +148 -0
- package/skills/literature/search/database-comparison-guide/SKILL.md +100 -0
- package/skills/literature/search/europe-pmc-api/SKILL.md +120 -0
- package/skills/literature/search/google-scholar-guide/SKILL.md +182 -0
- package/skills/literature/search/mesh-terms-guide/SKILL.md +164 -0
- package/skills/literature/search/openalex-api/SKILL.md +134 -0
- package/skills/literature/search/pubmed-api/SKILL.md +130 -0
- package/skills/literature/search/scientify-literature-survey/SKILL.md +203 -0
- package/skills/literature/search/semantic-scholar-api/SKILL.md +134 -0
- package/skills/literature/search/systematic-search-strategy/SKILL.md +214 -0
- package/skills/research/automation/ai-scientist-guide/SKILL.md +228 -0
- package/skills/research/automation/data-collection-automation/SKILL.md +248 -0
- package/skills/research/automation/research-workflow-automation/SKILL.md +266 -0
- package/skills/research/deep-research/meta-synthesis-guide/SKILL.md +174 -0
- package/skills/research/deep-research/research-cog/SKILL.md +153 -0
- package/skills/research/deep-research/scoping-review-guide/SKILL.md +217 -0
- package/skills/research/deep-research/systematic-review-guide/SKILL.md +250 -0
- package/skills/research/funding/figshare-api/SKILL.md +163 -0
- package/skills/research/funding/grant-writing-guide/SKILL.md +233 -0
- package/skills/research/funding/nsf-grant-guide/SKILL.md +206 -0
- package/skills/research/funding/open-science-guide/SKILL.md +255 -0
- package/skills/research/funding/zenodo-api/SKILL.md +174 -0
- package/skills/research/methodology/action-research-guide/SKILL.md +201 -0
- package/skills/research/methodology/experimental-design-guide/SKILL.md +236 -0
- package/skills/research/methodology/grad-school-guide/SKILL.md +182 -0
- package/skills/research/methodology/grounded-theory-guide/SKILL.md +171 -0
- package/skills/research/methodology/mixed-methods-guide/SKILL.md +208 -0
- package/skills/research/methodology/qualitative-research-guide/SKILL.md +234 -0
- package/skills/research/methodology/scientify-idea-generation/SKILL.md +222 -0
- package/skills/research/paper-review/paper-reading-assistant/SKILL.md +266 -0
- package/skills/research/paper-review/peer-review-guide/SKILL.md +227 -0
- package/skills/research/paper-review/rebuttal-writing-guide/SKILL.md +185 -0
- package/skills/research/paper-review/scientify-write-review-paper/SKILL.md +209 -0
- package/skills/tools/code-exec/jupyter-notebook-guide/SKILL.md +178 -0
- package/skills/tools/code-exec/python-reproducibility-guide/SKILL.md +341 -0
- package/skills/tools/code-exec/r-reproducibility-guide/SKILL.md +236 -0
- package/skills/tools/code-exec/sandbox-execution-guide/SKILL.md +221 -0
- package/skills/tools/diagram/mermaid-diagram-guide/SKILL.md +269 -0
- package/skills/tools/diagram/plantuml-guide/SKILL.md +397 -0
- package/skills/tools/diagram/scientific-illustration-guide/SKILL.md +225 -0
- package/skills/tools/document/anystyle-api/SKILL.md +199 -0
- package/skills/tools/document/grobid-pdf-parsing/SKILL.md +294 -0
- package/skills/tools/document/markdown-academic-guide/SKILL.md +217 -0
- package/skills/tools/document/pdf-extraction-guide/SKILL.md +321 -0
- package/skills/tools/knowledge-graph/knowledge-graph-construction/SKILL.md +306 -0
- package/skills/tools/knowledge-graph/ontology-design-guide/SKILL.md +214 -0
- package/skills/tools/knowledge-graph/rag-methodology-guide/SKILL.md +325 -0
- package/skills/tools/ocr-translate/formula-recognition-guide/SKILL.md +367 -0
- package/skills/tools/ocr-translate/handwriting-recognition-guide/SKILL.md +211 -0
- package/skills/tools/ocr-translate/latex-ocr-guide/SKILL.md +204 -0
- package/skills/tools/ocr-translate/multilingual-research-guide/SKILL.md +234 -0
- package/skills/tools/scraping/academic-web-scraping/SKILL.md +326 -0
- package/skills/tools/scraping/api-data-collection-guide/SKILL.md +301 -0
- package/skills/tools/scraping/web-scraping-ethics-guide/SKILL.md +250 -0
- package/skills/writing/citation/bibtex-management-guide/SKILL.md +246 -0
- package/skills/writing/citation/citation-style-guide/SKILL.md +248 -0
- package/skills/writing/citation/reference-manager-comparison/SKILL.md +208 -0
- package/skills/writing/citation/zotero-api/SKILL.md +188 -0
- package/skills/writing/composition/abstract-writing-guide/SKILL.md +188 -0
- package/skills/writing/composition/discussion-writing-guide/SKILL.md +194 -0
- package/skills/writing/composition/introduction-writing-guide/SKILL.md +194 -0
- package/skills/writing/composition/literature-review-writing/SKILL.md +196 -0
- package/skills/writing/composition/methods-section-guide/SKILL.md +185 -0
- package/skills/writing/composition/response-to-reviewers/SKILL.md +215 -0
- package/skills/writing/composition/scientific-writing-guide/SKILL.md +152 -0
- package/skills/writing/latex/bibliography-management-guide/SKILL.md +206 -0
- package/skills/writing/latex/latex-drawing-guide/SKILL.md +234 -0
- package/skills/writing/latex/latex-ecosystem-guide/SKILL.md +240 -0
- package/skills/writing/latex/math-typesetting-guide/SKILL.md +231 -0
- package/skills/writing/latex/overleaf-collaboration-guide/SKILL.md +211 -0
- package/skills/writing/latex/tikz-diagrams-guide/SKILL.md +211 -0
- package/skills/writing/polish/academic-translation-guide/SKILL.md +175 -0
- package/skills/writing/polish/academic-writing-refiner/SKILL.md +143 -0
- package/skills/writing/polish/ai-writing-humanizer/SKILL.md +178 -0
- package/skills/writing/polish/grammar-checker-guide/SKILL.md +184 -0
- package/skills/writing/polish/plagiarism-detection-guide/SKILL.md +167 -0
- package/skills/writing/templates/beamer-presentation-guide/SKILL.md +263 -0
- package/skills/writing/templates/conference-paper-template/SKILL.md +219 -0
- package/skills/writing/templates/thesis-template-guide/SKILL.md +200 -0
- package/skills/writing/templates/thesis-writing-guide/SKILL.md +220 -0
- package/src/tools/arxiv.ts +131 -0
- package/src/tools/crossref.ts +112 -0
- package/src/tools/openalex.ts +174 -0
- package/src/tools/pubmed.ts +166 -0
- package/src/tools/semantic-scholar.ts +108 -0
- package/src/tools/unpaywall.ts +58 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clinical-pharmacology-guide
|
|
3
|
+
description: "Clinical pharmacology principles for dosing, drug interactions, and patient s..."
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "syringe"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "pharma"
|
|
9
|
+
keywords: ["drug development", "pharmacokinetics", "clinical trial", "nursing", "pharmacodynamics", "drug interactions"]
|
|
10
|
+
source: "wentor"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Clinical Pharmacology Guide
|
|
14
|
+
|
|
15
|
+
A skill for applying clinical pharmacology principles to research and practice. Covers pharmacokinetic/pharmacodynamic modeling, drug interaction assessment, therapeutic drug monitoring, and special population dosing.
|
|
16
|
+
|
|
17
|
+
## Pharmacokinetic-Pharmacodynamic (PK/PD) Relationships
|
|
18
|
+
|
|
19
|
+
### The Emax Model
|
|
20
|
+
|
|
21
|
+
The most widely used PK/PD model relates drug concentration to effect:
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
import numpy as np
|
|
25
|
+
import matplotlib.pyplot as plt
|
|
26
|
+
|
|
27
|
+
def emax_model(concentration: np.ndarray, emax: float, ec50: float,
|
|
28
|
+
hill: float = 1, baseline: float = 0) -> np.ndarray:
|
|
29
|
+
"""
|
|
30
|
+
Sigmoid Emax (Hill) model.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
concentration: Drug concentration array
|
|
34
|
+
emax: Maximum effect
|
|
35
|
+
ec50: Concentration producing 50% of Emax
|
|
36
|
+
hill: Hill coefficient (steepness)
|
|
37
|
+
baseline: Baseline effect (E0)
|
|
38
|
+
"""
|
|
39
|
+
effect = baseline + (emax * concentration**hill) / (ec50**hill + concentration**hill)
|
|
40
|
+
return effect
|
|
41
|
+
|
|
42
|
+
# Example: dose-response curve
|
|
43
|
+
conc = np.logspace(-2, 3, 200)
|
|
44
|
+
effect = emax_model(conc, emax=100, ec50=10, hill=1.5)
|
|
45
|
+
|
|
46
|
+
fig, ax = plt.subplots(figsize=(8, 5))
|
|
47
|
+
ax.semilogx(conc, effect)
|
|
48
|
+
ax.set_xlabel('Concentration (ng/mL)')
|
|
49
|
+
ax.set_ylabel('Effect (%)')
|
|
50
|
+
ax.set_title('Sigmoid Emax Model')
|
|
51
|
+
ax.axhline(y=50, color='gray', linestyle='--', alpha=0.5)
|
|
52
|
+
ax.axvline(x=10, color='gray', linestyle='--', alpha=0.5)
|
|
53
|
+
ax.annotate('EC50', xy=(10, 50), fontsize=12)
|
|
54
|
+
plt.tight_layout()
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Drug Interaction Assessment
|
|
58
|
+
|
|
59
|
+
### Cytochrome P450 Interaction Prediction
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
def predict_cyp_interaction(victim_drug: dict, perpetrator_drug: dict) -> dict:
|
|
63
|
+
"""
|
|
64
|
+
Predict metabolic drug-drug interaction potential.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
victim_drug: {'name': str, 'primary_cyp': str, 'fraction_metabolized': float}
|
|
68
|
+
perpetrator_drug: {'name': str, 'cyp_effects': dict}
|
|
69
|
+
cyp_effects maps CYP enzyme to 'inhibitor'|'inducer'|'none'
|
|
70
|
+
"""
|
|
71
|
+
cyp = victim_drug['primary_cyp']
|
|
72
|
+
fm = victim_drug['fraction_metabolized'] # fraction metabolized by this CYP
|
|
73
|
+
|
|
74
|
+
perp_effect = perpetrator_drug['cyp_effects'].get(cyp, 'none')
|
|
75
|
+
|
|
76
|
+
if perp_effect == 'inhibitor':
|
|
77
|
+
# AUC ratio = 1 / (1 - fm) for complete inhibition
|
|
78
|
+
auc_ratio = 1 / (1 - fm) if fm < 1 else float('inf')
|
|
79
|
+
risk = 'high' if auc_ratio > 5 else 'moderate' if auc_ratio > 2 else 'low'
|
|
80
|
+
elif perp_effect == 'inducer':
|
|
81
|
+
# Induction decreases exposure
|
|
82
|
+
auc_ratio = 1 - fm * 0.7 # approximate 70% induction
|
|
83
|
+
risk = 'high' if auc_ratio < 0.3 else 'moderate' if auc_ratio < 0.5 else 'low'
|
|
84
|
+
else:
|
|
85
|
+
auc_ratio = 1.0
|
|
86
|
+
risk = 'none'
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
'victim': victim_drug['name'],
|
|
90
|
+
'perpetrator': perpetrator_drug['name'],
|
|
91
|
+
'affected_cyp': cyp,
|
|
92
|
+
'interaction_type': perp_effect,
|
|
93
|
+
'predicted_auc_ratio': round(auc_ratio, 2),
|
|
94
|
+
'clinical_risk': risk,
|
|
95
|
+
'recommendation': (
|
|
96
|
+
'Dose adjustment required' if risk == 'high'
|
|
97
|
+
else 'Monitor closely' if risk == 'moderate'
|
|
98
|
+
else 'No action needed'
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Therapeutic Drug Monitoring (TDM)
|
|
104
|
+
|
|
105
|
+
### Narrow Therapeutic Index Drugs
|
|
106
|
+
|
|
107
|
+
Drugs requiring routine TDM due to narrow therapeutic windows:
|
|
108
|
+
|
|
109
|
+
| Drug | Therapeutic Range | Toxic Level | Monitoring Frequency |
|
|
110
|
+
|------|------------------|-------------|---------------------|
|
|
111
|
+
| Vancomycin | AUC/MIC 400-600 | AUC/MIC > 600 | Trough before 4th dose |
|
|
112
|
+
| Lithium | 0.6-1.2 mEq/L | > 1.5 mEq/L | Weekly initially, then monthly |
|
|
113
|
+
| Digoxin | 0.8-2.0 ng/mL | > 2.0 ng/mL | At steady state (5-7 days) |
|
|
114
|
+
| Phenytoin | 10-20 mcg/mL | > 20 mcg/mL | 2 weeks after dose change |
|
|
115
|
+
| Tacrolimus | 5-15 ng/mL | > 20 ng/mL | Twice weekly post-transplant |
|
|
116
|
+
|
|
117
|
+
### Bayesian TDM
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
def bayesian_dose_adjustment(prior_cl: float, prior_cl_cv: float,
|
|
121
|
+
measured_conc: float, expected_conc: float,
|
|
122
|
+
current_dose: float) -> dict:
|
|
123
|
+
"""
|
|
124
|
+
Simple Bayesian dose adjustment using one-point TDM.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
prior_cl: Population clearance estimate (L/hr)
|
|
128
|
+
prior_cl_cv: CV of clearance in population (0-1)
|
|
129
|
+
measured_conc: Observed trough concentration
|
|
130
|
+
expected_conc: Expected concentration at population CL
|
|
131
|
+
current_dose: Current dose (mg)
|
|
132
|
+
"""
|
|
133
|
+
# Individual clearance estimate (MAP approach, simplified)
|
|
134
|
+
ratio = expected_conc / measured_conc
|
|
135
|
+
individual_cl = prior_cl * ratio
|
|
136
|
+
|
|
137
|
+
# Bayesian shrinkage toward population
|
|
138
|
+
weight = 1 / (1 + prior_cl_cv**2)
|
|
139
|
+
posterior_cl = weight * prior_cl + (1 - weight) * individual_cl
|
|
140
|
+
|
|
141
|
+
# New dose to achieve target
|
|
142
|
+
target_conc = (measured_conc + expected_conc) / 2 # midpoint of range
|
|
143
|
+
new_dose = current_dose * (posterior_cl / prior_cl)
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
'individual_CL': round(individual_cl, 2),
|
|
147
|
+
'posterior_CL': round(posterior_cl, 2),
|
|
148
|
+
'recommended_dose': round(new_dose, 1),
|
|
149
|
+
'dose_change_pct': round((new_dose - current_dose) / current_dose * 100, 1)
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Special Populations
|
|
154
|
+
|
|
155
|
+
Dosing considerations for specific patient groups:
|
|
156
|
+
|
|
157
|
+
- **Renal impairment**: Use Cockcroft-Gault or CKD-EPI for GFR estimation; adjust doses for renally cleared drugs proportionally
|
|
158
|
+
- **Hepatic impairment**: Use Child-Pugh score; reduce doses of hepatically metabolized drugs by 25-50% for moderate impairment
|
|
159
|
+
- **Pediatric**: Use allometric scaling (CL proportional to body weight^0.75) rather than simple mg/kg dosing
|
|
160
|
+
- **Geriatric**: Account for decreased renal function, polypharmacy, and altered body composition
|
|
161
|
+
- **Pregnancy**: Increased clearance for many drugs due to increased blood volume and GFR
|
|
162
|
+
|
|
163
|
+
## Regulatory Considerations
|
|
164
|
+
|
|
165
|
+
All clinical pharmacology studies should follow ICH guidelines (E4 for dose-response, E5 for ethnic factors, E7 for geriatric, E11 for pediatric). Report results in standardized population PK/PD formats compatible with FDA and EMA submission requirements.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: drug-development-guide
|
|
3
|
+
description: "End-to-end drug development pipeline from target identification to regulatory..."
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "pill"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "pharma"
|
|
9
|
+
keywords: ["drug development", "pharmacokinetics", "clinical trial", "drug discovery", "lead optimization"]
|
|
10
|
+
source: "wentor"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Drug Development Guide
|
|
14
|
+
|
|
15
|
+
A comprehensive skill covering the drug development pipeline from target identification through regulatory approval. Designed for pharmaceutical researchers, medicinal chemists, and clinical scientists conducting academic or industry research.
|
|
16
|
+
|
|
17
|
+
## Drug Discovery Pipeline Overview
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Target ID -> Hit Finding -> Lead Optimization -> Preclinical -> Phase I -> Phase II -> Phase III -> Regulatory Filing
|
|
21
|
+
(1-2 yr) (1-2 yr) (1-3 yr) (1-2 yr) (1 yr) (2 yr) (3 yr) (1-2 yr)
|
|
22
|
+
|
|
23
|
+
Total timeline: ~10-15 years | Success rate: ~5-10% from Phase I to approval
|
|
24
|
+
Estimated cost: $1.3B-$2.8B per approved drug (DiMasi et al., 2016)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Target Identification and Validation
|
|
28
|
+
|
|
29
|
+
### Computational Target Discovery
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
import pandas as pd
|
|
33
|
+
from scipy import stats
|
|
34
|
+
|
|
35
|
+
def differential_expression_analysis(expression_data: pd.DataFrame,
|
|
36
|
+
disease_group: list[str],
|
|
37
|
+
control_group: list[str],
|
|
38
|
+
fdr_threshold: float = 0.05) -> pd.DataFrame:
|
|
39
|
+
"""
|
|
40
|
+
Identify differentially expressed genes as potential drug targets.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
expression_data: Gene x Sample expression matrix
|
|
44
|
+
disease_group: Sample IDs in disease condition
|
|
45
|
+
control_group: Sample IDs in control condition
|
|
46
|
+
fdr_threshold: False discovery rate threshold
|
|
47
|
+
"""
|
|
48
|
+
results = []
|
|
49
|
+
for gene in expression_data.index:
|
|
50
|
+
disease_vals = expression_data.loc[gene, disease_group]
|
|
51
|
+
control_vals = expression_data.loc[gene, control_group]
|
|
52
|
+
t_stat, p_value = stats.ttest_ind(disease_vals, control_vals)
|
|
53
|
+
fold_change = disease_vals.mean() / (control_vals.mean() + 1e-10)
|
|
54
|
+
results.append({
|
|
55
|
+
'gene': gene,
|
|
56
|
+
'fold_change': fold_change,
|
|
57
|
+
'log2_fc': np.log2(abs(fold_change) + 1e-10),
|
|
58
|
+
'p_value': p_value,
|
|
59
|
+
't_statistic': t_stat
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
df = pd.DataFrame(results)
|
|
63
|
+
# Benjamini-Hochberg FDR correction
|
|
64
|
+
from statsmodels.stats.multitest import multipletests
|
|
65
|
+
df['fdr'] = multipletests(df['p_value'], method='fdr_bh')[1]
|
|
66
|
+
df['significant'] = df['fdr'] < fdr_threshold
|
|
67
|
+
return df.sort_values('fdr')
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Target Validation Criteria
|
|
71
|
+
|
|
72
|
+
A robust drug target should satisfy multiple criteria:
|
|
73
|
+
|
|
74
|
+
| Criterion | Method | Evidence Strength |
|
|
75
|
+
|-----------|--------|------------------|
|
|
76
|
+
| Genetic association | GWAS, Mendelian randomization | Strong |
|
|
77
|
+
| Expression in disease tissue | RNA-seq, immunohistochemistry | Moderate |
|
|
78
|
+
| Functional role | CRISPR knockout, siRNA | Strong |
|
|
79
|
+
| Druggability | Structural analysis, binding pockets | Essential |
|
|
80
|
+
| Safety (anti-target) | Phenotype of loss-of-function mutations | Essential |
|
|
81
|
+
|
|
82
|
+
## Lead Optimization
|
|
83
|
+
|
|
84
|
+
### ADMET Property Prediction
|
|
85
|
+
|
|
86
|
+
Assess absorption, distribution, metabolism, excretion, and toxicity early:
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
def lipinski_rule_of_five(molecular_weight: float, logp: float,
|
|
90
|
+
hbd: int, hba: int) -> dict:
|
|
91
|
+
"""
|
|
92
|
+
Evaluate Lipinski's Rule of Five for oral bioavailability.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
molecular_weight: Molecular weight in Da
|
|
96
|
+
logp: Calculated LogP (lipophilicity)
|
|
97
|
+
hbd: Number of hydrogen bond donors
|
|
98
|
+
hba: Number of hydrogen bond acceptors
|
|
99
|
+
"""
|
|
100
|
+
violations = 0
|
|
101
|
+
details = []
|
|
102
|
+
|
|
103
|
+
if molecular_weight > 500:
|
|
104
|
+
violations += 1
|
|
105
|
+
details.append(f"MW {molecular_weight} > 500")
|
|
106
|
+
if logp > 5:
|
|
107
|
+
violations += 1
|
|
108
|
+
details.append(f"LogP {logp} > 5")
|
|
109
|
+
if hbd > 5:
|
|
110
|
+
violations += 1
|
|
111
|
+
details.append(f"HBD {hbd} > 5")
|
|
112
|
+
if hba > 10:
|
|
113
|
+
violations += 1
|
|
114
|
+
details.append(f"HBA {hba} > 10")
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
'violations': violations,
|
|
118
|
+
'passes': violations <= 1,
|
|
119
|
+
'details': details,
|
|
120
|
+
'assessment': 'Likely orally bioavailable' if violations <= 1
|
|
121
|
+
else 'Poor oral bioavailability expected'
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Pharmacokinetics Modeling
|
|
126
|
+
|
|
127
|
+
### Compartmental PK Analysis
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
import numpy as np
|
|
131
|
+
from scipy.optimize import curve_fit
|
|
132
|
+
|
|
133
|
+
def one_compartment_iv(t, dose, V, CL):
|
|
134
|
+
"""One-compartment IV bolus model."""
|
|
135
|
+
k_el = CL / V
|
|
136
|
+
return (dose / V) * np.exp(-k_el * t)
|
|
137
|
+
|
|
138
|
+
def compute_pk_parameters(time_points: np.ndarray,
|
|
139
|
+
concentrations: np.ndarray,
|
|
140
|
+
dose: float) -> dict:
|
|
141
|
+
"""
|
|
142
|
+
Fit one-compartment model and derive PK parameters.
|
|
143
|
+
"""
|
|
144
|
+
popt, pcov = curve_fit(
|
|
145
|
+
lambda t, V, CL: one_compartment_iv(t, dose, V, CL),
|
|
146
|
+
time_points, concentrations,
|
|
147
|
+
p0=[10, 1], bounds=(0, [1000, 100])
|
|
148
|
+
)
|
|
149
|
+
V, CL = popt
|
|
150
|
+
t_half = 0.693 * V / CL
|
|
151
|
+
auc = dose / CL
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
'volume_of_distribution_L': round(V, 2),
|
|
155
|
+
'clearance_L_hr': round(CL, 2),
|
|
156
|
+
'half_life_hr': round(t_half, 2),
|
|
157
|
+
'AUC_mg_hr_L': round(auc, 2)
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Clinical Trial Design
|
|
162
|
+
|
|
163
|
+
### Phase Selection and Endpoints
|
|
164
|
+
|
|
165
|
+
| Phase | Primary Goal | Typical N | Key Endpoints |
|
|
166
|
+
|-------|-------------|-----------|---------------|
|
|
167
|
+
| Phase I | Safety, dose finding | 20-80 | MTD, DLT, PK |
|
|
168
|
+
| Phase II | Efficacy signal | 100-300 | ORR, PFS, biomarkers |
|
|
169
|
+
| Phase III | Confirmatory efficacy | 300-3000 | OS, PFS, PROs |
|
|
170
|
+
| Phase IV | Post-marketing surveillance | 1000+ | ADRs, real-world effectiveness |
|
|
171
|
+
|
|
172
|
+
Always pre-register clinical trials on ClinicalTrials.gov and follow CONSORT guidelines for reporting. Use adaptive trial designs (e.g., Bayesian adaptive randomization, seamless Phase II/III) when appropriate to improve efficiency.
|
|
173
|
+
|
|
174
|
+
## References
|
|
175
|
+
|
|
176
|
+
- DiMasi, J. A., Grabowski, H. G., & Hansen, R. W. (2016). Innovation in the pharmaceutical industry. *Journal of Health Economics*, 47, 20-33.
|
|
177
|
+
- Lipinski, C. A. (2004). Lead- and drug-like compounds. *Advanced Drug Delivery Reviews*, 56(3), 215-217.
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: computational-physics-guide
|
|
3
|
+
description: "Computational physics methods, simulations, and research tools"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "atom"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "physics"
|
|
9
|
+
keywords: ["computational physics", "quantum mechanics", "statistical physics", "condensed matter"]
|
|
10
|
+
source: "wentor-research-plugins"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Computational Physics Guide
|
|
14
|
+
|
|
15
|
+
Apply computational methods to physics research, including molecular dynamics, Monte Carlo simulations, quantum computing, and numerical methods for solving physical systems.
|
|
16
|
+
|
|
17
|
+
## Computational Methods Overview
|
|
18
|
+
|
|
19
|
+
| Method | Application | Scale | Key Software |
|
|
20
|
+
|--------|-------------|-------|-------------|
|
|
21
|
+
| **Molecular Dynamics (MD)** | Atomic-scale dynamics, materials | Atoms-molecules | LAMMPS, GROMACS, NAMD |
|
|
22
|
+
| **Density Functional Theory (DFT)** | Electronic structure, quantum chemistry | Electrons | VASP, Gaussian, Quantum ESPRESSO |
|
|
23
|
+
| **Monte Carlo (MC)** | Statistical mechanics, phase transitions | Configurable | Custom, CASINO |
|
|
24
|
+
| **Finite Element Method (FEM)** | Continuum mechanics, electrostatics | Macroscopic | COMSOL, FEniCS, Abaqus |
|
|
25
|
+
| **Finite Difference (FDTD)** | Electrodynamics, wave propagation | Macroscopic | Meep, Lumerical |
|
|
26
|
+
| **N-body Simulation** | Gravitational dynamics, plasma | Stars/particles | GADGET, REBOUND |
|
|
27
|
+
| **Lattice QCD** | Quantum chromodynamics | Subatomic | MILC, openQCD |
|
|
28
|
+
|
|
29
|
+
## Molecular Dynamics
|
|
30
|
+
|
|
31
|
+
### Basic MD Algorithm
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
import numpy as np
|
|
35
|
+
|
|
36
|
+
def lennard_jones(r, epsilon=1.0, sigma=1.0):
|
|
37
|
+
"""Lennard-Jones potential and force."""
|
|
38
|
+
r6 = (sigma / r) ** 6
|
|
39
|
+
r12 = r6 ** 2
|
|
40
|
+
potential = 4 * epsilon * (r12 - r6)
|
|
41
|
+
force = 24 * epsilon * (2 * r12 - r6) / r
|
|
42
|
+
return potential, force
|
|
43
|
+
|
|
44
|
+
def velocity_verlet(positions, velocities, forces, masses, dt):
|
|
45
|
+
"""Velocity Verlet integration step."""
|
|
46
|
+
# Half-step velocity update
|
|
47
|
+
velocities += 0.5 * forces / masses * dt
|
|
48
|
+
# Full-step position update
|
|
49
|
+
positions += velocities * dt
|
|
50
|
+
# Compute new forces
|
|
51
|
+
new_forces = compute_forces(positions)
|
|
52
|
+
# Complete velocity update
|
|
53
|
+
velocities += 0.5 * new_forces / masses * dt
|
|
54
|
+
return positions, velocities, new_forces
|
|
55
|
+
|
|
56
|
+
def md_simulation(n_atoms, n_steps, dt=0.001, temperature=1.0):
|
|
57
|
+
"""Simple NVE molecular dynamics simulation."""
|
|
58
|
+
# Initialize positions on a grid
|
|
59
|
+
positions = initialize_fcc_lattice(n_atoms, box_size=10.0)
|
|
60
|
+
velocities = np.random.randn(n_atoms, 3) * np.sqrt(temperature)
|
|
61
|
+
velocities -= velocities.mean(axis=0) # Remove center of mass motion
|
|
62
|
+
|
|
63
|
+
forces = compute_forces(positions)
|
|
64
|
+
trajectory = []
|
|
65
|
+
|
|
66
|
+
for step in range(n_steps):
|
|
67
|
+
positions, velocities, forces = velocity_verlet(
|
|
68
|
+
positions, velocities, forces,
|
|
69
|
+
masses=np.ones(n_atoms), dt=dt
|
|
70
|
+
)
|
|
71
|
+
if step % 100 == 0:
|
|
72
|
+
ke = 0.5 * np.sum(velocities**2)
|
|
73
|
+
pe = compute_potential_energy(positions)
|
|
74
|
+
print(f"Step {step}: KE={ke:.4f}, PE={pe:.4f}, Total={ke+pe:.4f}")
|
|
75
|
+
trajectory.append(positions.copy())
|
|
76
|
+
|
|
77
|
+
return trajectory
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### LAMMPS Input Script Example
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
# LAMMPS input: Lennard-Jones fluid simulation
|
|
84
|
+
units lj
|
|
85
|
+
atom_style atomic
|
|
86
|
+
boundary p p p
|
|
87
|
+
|
|
88
|
+
# Create simulation box and atoms
|
|
89
|
+
lattice fcc 0.8442
|
|
90
|
+
region box block 0 10 0 10 0 10
|
|
91
|
+
create_box 1 box
|
|
92
|
+
create_atoms 1 box
|
|
93
|
+
|
|
94
|
+
# Set mass and interactions
|
|
95
|
+
mass 1 1.0
|
|
96
|
+
pair_style lj/cut 2.5
|
|
97
|
+
pair_coeff 1 1 1.0 1.0 2.5
|
|
98
|
+
|
|
99
|
+
# Initialize velocities at T=1.0
|
|
100
|
+
velocity all create 1.0 87287 dist gaussian
|
|
101
|
+
|
|
102
|
+
# Thermostat: Nose-Hoover NVT
|
|
103
|
+
fix 1 all nvt temp 1.0 1.0 0.1
|
|
104
|
+
|
|
105
|
+
# Output settings
|
|
106
|
+
thermo 100
|
|
107
|
+
thermo_style custom step temp pe ke etotal press
|
|
108
|
+
dump 1 all custom 1000 trajectory.lammpstrj id x y z vx vy vz
|
|
109
|
+
|
|
110
|
+
# Run simulation
|
|
111
|
+
timestep 0.005
|
|
112
|
+
run 100000
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Monte Carlo Methods
|
|
116
|
+
|
|
117
|
+
### Metropolis Algorithm for Ising Model
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
import numpy as np
|
|
121
|
+
|
|
122
|
+
def ising_monte_carlo(L, temperature, n_steps):
|
|
123
|
+
"""2D Ising model simulation using Metropolis algorithm."""
|
|
124
|
+
# Initialize random spin configuration
|
|
125
|
+
spins = np.random.choice([-1, 1], size=(L, L))
|
|
126
|
+
beta = 1.0 / temperature
|
|
127
|
+
|
|
128
|
+
energies = []
|
|
129
|
+
magnetizations = []
|
|
130
|
+
|
|
131
|
+
for step in range(n_steps):
|
|
132
|
+
for _ in range(L * L): # One sweep = L^2 single spin flips
|
|
133
|
+
# Choose random spin
|
|
134
|
+
i, j = np.random.randint(0, L, size=2)
|
|
135
|
+
|
|
136
|
+
# Calculate energy change for flipping spin (i,j)
|
|
137
|
+
neighbors = (
|
|
138
|
+
spins[(i+1)%L, j] + spins[(i-1)%L, j] +
|
|
139
|
+
spins[i, (j+1)%L] + spins[i, (j-1)%L]
|
|
140
|
+
)
|
|
141
|
+
delta_E = 2 * spins[i, j] * neighbors
|
|
142
|
+
|
|
143
|
+
# Metropolis acceptance criterion
|
|
144
|
+
if delta_E <= 0 or np.random.random() < np.exp(-beta * delta_E):
|
|
145
|
+
spins[i, j] *= -1
|
|
146
|
+
|
|
147
|
+
# Measure observables
|
|
148
|
+
if step % 10 == 0:
|
|
149
|
+
E = -np.sum(spins * (np.roll(spins, 1, 0) + np.roll(spins, 1, 1)))
|
|
150
|
+
M = np.abs(np.sum(spins))
|
|
151
|
+
energies.append(E / L**2)
|
|
152
|
+
magnetizations.append(M / L**2)
|
|
153
|
+
|
|
154
|
+
return energies, magnetizations
|
|
155
|
+
|
|
156
|
+
# Run near the critical temperature (T_c ≈ 2.269 for 2D Ising)
|
|
157
|
+
E, M = ising_monte_carlo(L=32, temperature=2.269, n_steps=10000)
|
|
158
|
+
print(f"Mean energy: {np.mean(E[-100:]):.4f}")
|
|
159
|
+
print(f"Mean magnetization: {np.mean(M[-100:]):.4f}")
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Density Functional Theory
|
|
163
|
+
|
|
164
|
+
### Quantum ESPRESSO Workflow
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Step 1: Self-consistent field (SCF) calculation
|
|
168
|
+
cat > si_scf.in << 'EOF'
|
|
169
|
+
&CONTROL
|
|
170
|
+
calculation = 'scf'
|
|
171
|
+
prefix = 'silicon'
|
|
172
|
+
outdir = './tmp/'
|
|
173
|
+
pseudo_dir = './pseudo/'
|
|
174
|
+
/
|
|
175
|
+
&SYSTEM
|
|
176
|
+
ibrav = 2
|
|
177
|
+
celldm(1) = 10.26 ! Lattice constant in Bohr
|
|
178
|
+
nat = 2
|
|
179
|
+
ntyp = 1
|
|
180
|
+
ecutwfc = 30.0 ! Kinetic energy cutoff (Ry)
|
|
181
|
+
ecutrho = 300.0 ! Charge density cutoff (Ry)
|
|
182
|
+
/
|
|
183
|
+
&ELECTRONS
|
|
184
|
+
conv_thr = 1.0d-8
|
|
185
|
+
/
|
|
186
|
+
ATOMIC_SPECIES
|
|
187
|
+
Si 28.086 Si.pbe-n-rrkjus_psl.1.0.0.UPF
|
|
188
|
+
ATOMIC_POSITIONS crystal
|
|
189
|
+
Si 0.00 0.00 0.00
|
|
190
|
+
Si 0.25 0.25 0.25
|
|
191
|
+
K_POINTS automatic
|
|
192
|
+
8 8 8 0 0 0
|
|
193
|
+
EOF
|
|
194
|
+
|
|
195
|
+
pw.x < si_scf.in > si_scf.out
|
|
196
|
+
|
|
197
|
+
# Step 2: Band structure calculation
|
|
198
|
+
# (requires nscf + bands post-processing)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Python Interface (ASE + GPAW)
|
|
202
|
+
|
|
203
|
+
```python
|
|
204
|
+
from ase.build import bulk
|
|
205
|
+
from gpaw import GPAW, PW
|
|
206
|
+
|
|
207
|
+
# Create silicon crystal structure
|
|
208
|
+
si = bulk('Si', 'diamond', a=5.43)
|
|
209
|
+
|
|
210
|
+
# DFT calculation with GPAW
|
|
211
|
+
calc = GPAW(mode=PW(300), # Plane-wave cutoff: 300 eV
|
|
212
|
+
kpts=(8, 8, 8), # k-point mesh
|
|
213
|
+
xc='PBE', # Exchange-correlation functional
|
|
214
|
+
txt='si_gpaw.txt') # Output file
|
|
215
|
+
|
|
216
|
+
si.calc = calc
|
|
217
|
+
energy = si.get_potential_energy()
|
|
218
|
+
print(f"Total energy: {energy:.4f} eV")
|
|
219
|
+
print(f"Energy per atom: {energy/len(si):.4f} eV")
|
|
220
|
+
|
|
221
|
+
# Equation of state (find equilibrium lattice constant)
|
|
222
|
+
from ase.eos import EquationOfState
|
|
223
|
+
volumes, energies = [], []
|
|
224
|
+
for a in np.linspace(5.3, 5.6, 10):
|
|
225
|
+
si = bulk('Si', 'diamond', a=a)
|
|
226
|
+
si.calc = GPAW(mode=PW(300), kpts=(8,8,8), xc='PBE', txt=None)
|
|
227
|
+
volumes.append(si.get_volume())
|
|
228
|
+
energies.append(si.get_potential_energy())
|
|
229
|
+
|
|
230
|
+
eos = EquationOfState(volumes, energies)
|
|
231
|
+
v0, e0, B = eos.fit()
|
|
232
|
+
print(f"Equilibrium volume: {v0:.2f} A^3, Bulk modulus: {B:.1f} GPa")
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Numerical Methods
|
|
236
|
+
|
|
237
|
+
### Solving ODEs (Runge-Kutta)
|
|
238
|
+
|
|
239
|
+
```python
|
|
240
|
+
from scipy.integrate import solve_ivp
|
|
241
|
+
import matplotlib.pyplot as plt
|
|
242
|
+
|
|
243
|
+
# Example: Damped harmonic oscillator
|
|
244
|
+
# m*x'' + gamma*x' + k*x = 0
|
|
245
|
+
def damped_oscillator(t, y, gamma=0.1, omega0=1.0):
|
|
246
|
+
x, v = y
|
|
247
|
+
dxdt = v
|
|
248
|
+
dvdt = -2*gamma*v - omega0**2 * x
|
|
249
|
+
return [dxdt, dvdt]
|
|
250
|
+
|
|
251
|
+
sol = solve_ivp(damped_oscillator, [0, 50], [1.0, 0.0],
|
|
252
|
+
t_eval=np.linspace(0, 50, 1000),
|
|
253
|
+
method='RK45', rtol=1e-10)
|
|
254
|
+
|
|
255
|
+
plt.plot(sol.t, sol.y[0])
|
|
256
|
+
plt.xlabel('Time')
|
|
257
|
+
plt.ylabel('Displacement')
|
|
258
|
+
plt.title('Damped Harmonic Oscillator')
|
|
259
|
+
plt.savefig('oscillator.pdf', dpi=300)
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Solving PDEs (Finite Differences)
|
|
263
|
+
|
|
264
|
+
```python
|
|
265
|
+
# 2D Heat equation: du/dt = alpha * (d2u/dx2 + d2u/dy2)
|
|
266
|
+
def heat_equation_2d(Nx, Ny, Nt, alpha=0.01, dt=0.001):
|
|
267
|
+
dx = dy = 1.0 / max(Nx, Ny)
|
|
268
|
+
u = np.zeros((Nx, Ny))
|
|
269
|
+
u[Nx//4:3*Nx//4, Ny//4:3*Ny//4] = 1.0 # Initial hot region
|
|
270
|
+
|
|
271
|
+
for t in range(Nt):
|
|
272
|
+
u_new = u.copy()
|
|
273
|
+
u_new[1:-1, 1:-1] = u[1:-1, 1:-1] + alpha * dt / dx**2 * (
|
|
274
|
+
u[2:, 1:-1] + u[:-2, 1:-1] + u[1:-1, 2:] + u[1:-1, :-2]
|
|
275
|
+
- 4 * u[1:-1, 1:-1]
|
|
276
|
+
)
|
|
277
|
+
u = u_new
|
|
278
|
+
return u
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## HPC and Parallelization
|
|
282
|
+
|
|
283
|
+
| Approach | Tool | Best For |
|
|
284
|
+
|----------|------|----------|
|
|
285
|
+
| Shared memory (threads) | OpenMP | Multi-core CPU parallelism |
|
|
286
|
+
| Distributed memory (MPI) | mpi4py, MPI | Multi-node cluster computing |
|
|
287
|
+
| GPU computing | CUDA, CuPy, JAX | Massively parallel computations |
|
|
288
|
+
| Workflow management | Snakemake, Nextflow | Complex simulation pipelines |
|
|
289
|
+
| Job scheduling | SLURM, PBS | HPC cluster job submission |
|
|
290
|
+
|
|
291
|
+
## Research Resources
|
|
292
|
+
|
|
293
|
+
| Resource | Description |
|
|
294
|
+
|----------|-------------|
|
|
295
|
+
| arXiv cond-mat | Condensed matter preprints |
|
|
296
|
+
| arXiv hep-lat | Lattice field theory preprints |
|
|
297
|
+
| Journal of Computational Physics | Top computational physics journal |
|
|
298
|
+
| Physical Review E | Statistical, nonlinear, soft matter |
|
|
299
|
+
| Computer Physics Communications | Methods + software papers |
|
|
300
|
+
| NIST databases | Physical constants, atomic data |
|