@delta-infra/cli 1.0.96 → 1.0.98

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.
Files changed (36) hide show
  1. package/README.md +473 -471
  2. package/checksums.txt +5 -5
  3. package/package.json +1 -1
  4. package/scripts/install-wizard.js +701 -701
  5. package/scripts/install.js +442 -442
  6. package/scripts/run.js +65 -65
  7. package/skills/delta-sandbox/SKILL.md +344 -345
  8. package/skills/delta-sandbox/agents/openai.yaml +4 -4
  9. package/skills/delta-sandbox/references/commands.md +58 -58
  10. package/skills/delta-sandbox/references/lifecycle.md +100 -98
  11. package/skills/delta-sandbox/references/recipes.md +138 -138
  12. package/skills/delta-science/AGENTS.md +46 -49
  13. package/skills/delta-science/SKILL.md +147 -136
  14. package/skills/delta-science/agents/openai.yaml +4 -4
  15. package/skills/delta-science/references/antbo.md +100 -100
  16. package/skills/delta-science/references/delta-bo.md +89 -89
  17. package/skills/delta-science/references/gsasii.md +116 -116
  18. package/skills/delta-science/references/lammps.md +66 -66
  19. package/skills/delta-science/references/ldm-bo.md +129 -129
  20. package/skills/delta-science/references/materials-design.md +109 -0
  21. package/skills/delta-science/references/pubchem.md +126 -126
  22. package/skills/delta-science/references/pymatgen.md +68 -68
  23. package/skills/delta-science/references/qe.md +123 -0
  24. package/skills/delta-science/references/rdkit.md +138 -138
  25. package/skills/delta-science/references/strbo.md +87 -87
  26. package/skills/delta-science/references/synbo.md +198 -198
  27. package/skills/delta-science/scripts/catalog.py +92 -0
  28. package/skills/delta-science/scripts/generated_catalog.py +69 -0
  29. package/skills/delta-science/scripts/invoke.py +346 -0
  30. package/skills/delta-shared/SKILL.md +97 -97
  31. package/skills/delta-shared/agents/openai.yaml +4 -4
  32. package/skills/manifest.json +19 -19
  33. package/skills/delta-science/references/cli-contract.md +0 -53
  34. package/skills/delta-science/references/ldm.md +0 -73
  35. package/skills/delta-science/references/routing-index.md +0 -36
  36. package/skills/delta-science/references/workflows.md +0 -61
@@ -1,68 +1,68 @@
1
- # pymatgen 详细规则
2
-
3
- 所有调用直接使用 `delta-cli science invoke`。无机化学式、组成和式量优先使用 pymatgen,不用 PubChem
4
- 或本地元素表替代。结构 operation 必须发送完整结构文本,不能发送本地文件路径;
5
- 支持 `cif`、`poscar`、`json`、`cssr`、`xsf`,不接收 LAMMPS data/dump。
6
-
7
- ## Health
8
-
9
- operation:`health`,无 body。
10
-
11
- ## Composition Parse
12
-
13
- operation:`composition-parse`。
14
-
15
- ```json
16
- {"formula": "LiFePO4", "format": "formula"}
17
- ```
18
-
19
- Key response fields in `data`: `valid`, `formula`, `reduced_formula`,
20
- `alphabetic_formula`, `anonymous_formula`, `chemical_system`,
21
- `number_of_atoms`, `weight`, `element_amounts`, `atomic_fractions`,
22
- `weight_fractions`, `error`.
23
-
24
- ## Structure Parse / Summary
25
-
26
- operation:`structure-parse` 或 `structure-summary`。
27
-
28
- ```json
29
- {"input": "<CIF text>", "format": "cif", "primitive": false}
30
- ```
31
-
32
- Input formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
33
-
34
- Summary fields include `formula`, `reduced_formula`, `chemical_system`,
35
- `nsites`, `nelements`, `density`, `volume`, `lattice`, `element_amounts`, and
36
- `species`.
37
-
38
- ## Structure Convert
39
-
40
- operation:`structure-convert`。
41
-
42
- ```json
43
- {
44
- "input": "<CIF text>",
45
- "input_format": "cif",
46
- "output_format": "poscar",
47
- "primitive": false
48
- }
49
- ```
50
-
51
- Output formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
52
-
53
- ## Symmetry
54
-
55
- operation:`structure-symmetry`。
56
-
57
- ```json
58
- {
59
- "input": "<CIF text>",
60
- "format": "cif",
61
- "primitive": false,
62
- "symprec": 0.01,
63
- "angle_tolerance": 5.0
64
- }
65
- ```
66
-
67
- Returns `space_group_symbol`, `space_group_number`, `crystal_system`,
68
- `point_group_symbol`, `hall`, and `nsites`.
1
+ # pymatgen 详细规则
2
+
3
+ 所有调用直接使用 `delta-cli science invoke`。无机化学式、组成和式量优先使用 pymatgen,不用 PubChem
4
+ 或本地元素表替代。结构 operation 必须发送完整结构文本,不能发送本地文件路径;
5
+ 支持 `cif`、`poscar`、`json`、`cssr`、`xsf`,不接收 LAMMPS data/dump。
6
+
7
+ ## Health
8
+
9
+ operation:`health`,无 body。
10
+
11
+ ## Composition Parse
12
+
13
+ operation:`composition-parse`。
14
+
15
+ ```json
16
+ {"formula": "LiFePO4", "format": "formula"}
17
+ ```
18
+
19
+ Key response fields in `data`: `valid`, `formula`, `reduced_formula`,
20
+ `alphabetic_formula`, `anonymous_formula`, `chemical_system`,
21
+ `number_of_atoms`, `weight`, `element_amounts`, `atomic_fractions`,
22
+ `weight_fractions`, `error`.
23
+
24
+ ## Structure Parse / Summary
25
+
26
+ operation:`structure-parse` 或 `structure-summary`。
27
+
28
+ ```json
29
+ {"input": "<CIF text>", "format": "cif", "primitive": false}
30
+ ```
31
+
32
+ Input formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
33
+
34
+ Summary fields include `formula`, `reduced_formula`, `chemical_system`,
35
+ `nsites`, `nelements`, `density`, `volume`, `lattice`, `element_amounts`, and
36
+ `species`.
37
+
38
+ ## Structure Convert
39
+
40
+ operation:`structure-convert`。
41
+
42
+ ```json
43
+ {
44
+ "input": "<CIF text>",
45
+ "input_format": "cif",
46
+ "output_format": "poscar",
47
+ "primitive": false
48
+ }
49
+ ```
50
+
51
+ Output formats: `cif`, `poscar`, `json`, `cssr`, `xsf`.
52
+
53
+ ## Symmetry
54
+
55
+ operation:`structure-symmetry`。
56
+
57
+ ```json
58
+ {
59
+ "input": "<CIF text>",
60
+ "format": "cif",
61
+ "primitive": false,
62
+ "symprec": 0.01,
63
+ "angle_tolerance": 5.0
64
+ }
65
+ ```
66
+
67
+ Returns `space_group_symbol`, `space_group_number`, `crystal_system`,
68
+ `point_group_symbol`, `hall`, and `nsites`.
@@ -0,0 +1,123 @@
1
+ # Quantum ESPRESSO DFT 详细规则
2
+
3
+ QE 用于通过 Chemistry Gateway 执行可追踪的异步 Quantum ESPRESSO 工作流。agent 只接触
4
+ Gateway/Science Server contract,不运行本地 `pw.x`,不调用内部 QE 容器,也不提交 shell
5
+ 命令、scheduler 脚本、`pseudo_dir`、`outdir` 或主机路径。
6
+
7
+ 本 reference 对应 CLI 的真实工具为 `qe`。实际 `tools.name` 与 `tool_endpoints.name`
8
+ 必须逐字取自当前 CLI catalog。下列路径是 QE 服务契约,不是可直接访问的 URL,也不是
9
+ 可以自动改写的 endpoint 别名。
10
+
11
+ ## 能力分组
12
+
13
+ | 服务路径 | 作用 | 类型 |
14
+ | --- | --- | --- |
15
+ | `/chem/qe/health`、`/healthz`、`/readyz` | 运行时、scheduler、存储和 PP 就绪 | 只读 |
16
+ | `/chem/qe/v1/qe/workflow-types` | workflow catalog 和支持状态 | 只读 |
17
+ | `/chem/qe/v1/pp-sets`、`/pp-locks/{digest}` | 已发布 PP profile/lock | 只读 |
18
+ | `/chem/qe/v1/pp-sets:resolve` | 按 campaign 元素全集解析 PP 候选 | 只读/校验 |
19
+ | `/chem/qe/v1/artifacts` | 上传、查询和下载结构/fixed-coordinate artifact | 文件/二进制 |
20
+ | `/chem/qe/v1/qe/jobs` | 提交异步计算并查询 job | 远端变更 |
21
+ | `/chem/qe/v1/qe/jobs/{job_id}/events`、`steps`、`logs`、`artifacts` | 读取作业过程和结果 | 只读 |
22
+ | `/chem/qe/v1/qe/jobs/{job_id}:cancel`、`:retry`、`:review` | 取消、重试和科学审核 | 远端变更 |
23
+
24
+ 选择新 operation 时,先使用:
25
+
26
+ ```text
27
+ delta-cli science list
28
+ delta-cli science endpoints list <exact tool name>
29
+ ```
30
+
31
+ 再用目录返回的精确名称调用;如果 catalog 没有 schema,不猜测 operation、路径参数、
32
+ 请求头或 body。
33
+
34
+ ## 当前 CLI 的文件和请求头边界
35
+
36
+ 结构 artifact 上传需要 `application/octet-stream` 和 query metadata,QE job 提交要求
37
+ 稳定的 `Idempotency-Key`。当前通用 `delta-cli science invoke` 只有 JSON body/query 参数,
38
+ 没有原始二进制上传、multipart 或自定义请求头 flag。因此:
39
+
40
+ - 只有在 Science Server 已提供明确等价 adapter 时,才可以通过 CLI 解析 PP、提交 job
41
+ 或上传 artifact;
42
+ - 不要把结构文本、文件路径、base64、`Idempotency-Key` 或 QE service credential 当成
43
+ 普通业务字段发送;
44
+ - 若目录没有 adapter,报告“当前 CLI 未暴露该 operation;未发送远端请求”,不要调用
45
+ 公开/私有 Gateway URL 或 `qe-cloud-compute:18020`。
46
+
47
+ ## 新作业的正确顺序
48
+
49
+ 1. 读取 health;需要部署诊断时再读取 readiness,并从 workflow catalog 选择当前
50
+ `supported` 的 task。
51
+ 2. 计算完整 `campaign_elements` 集合,使用 `pp-sets:resolve` 得到 profile;生产作业
52
+ 必须使用服务返回的 `pp_set_id` 与不可变 `lock_id`,不能只凭 profile 名称推断 lock。
53
+ 3. 让服务校验结构 artifact,job 只引用返回的 `sha256:<digest>` artifact ID。
54
+ 4. 用稳定幂等语义提交 `qe/jobs`;接收 `202` 只代表 accepted/queued,不代表 QE 已收敛。
55
+ 5. 轮询 job、events、steps、logs 和 artifacts;独立读取 `execution`、`solver`、
56
+ `scientific` 三个状态。
57
+ 6. 下载结果时校验每个 artifact 的 SHA-256,并分别报告 selected backend、资源 telemetry、
58
+ solver 状态、scientific review 状态和 warnings。
59
+
60
+ PP 解析的最小业务数据形状如下;其中值必须来自当前服务/目录,不能填入虚构的生产 lock:
61
+
62
+ ```json
63
+ {
64
+ "campaign_id": "si-bulk-scf-v1",
65
+ "campaign_elements": ["Si", "O"],
66
+ "workflows": ["qe.pw.scf"],
67
+ "explicit_mode": null
68
+ }
69
+ ```
70
+
71
+ 作业的核心结构如下,`workflow_inputs` 必须遵循当前 task schema:
72
+
73
+ ```json
74
+ {
75
+ "task": "qe.pw.scf",
76
+ "schema_version": "1.1",
77
+ "campaign_id": "si-bulk-scf-v1",
78
+ "campaign_elements": ["Si"],
79
+ "structure": {"format": "artifact", "artifact_id": "sha256:<64-hex>"},
80
+ "physics": {
81
+ "parameter_set": "<approved-parameter-set>",
82
+ "pp_policy": {
83
+ "mode": "sssp_single",
84
+ "pp_set_id": "<approved-pp-set>",
85
+ "lock_id": "sha256:<64-hex>"
86
+ },
87
+ "kpoints": [4, 4, 4]
88
+ },
89
+ "resources": {
90
+ "profile": "standard",
91
+ "nodes": 1,
92
+ "mpi_ranks_per_node": 1,
93
+ "omp_threads_per_rank": 1,
94
+ "walltime_seconds": 3600,
95
+ "gpu_policy": "cpu"
96
+ },
97
+ "client_request_id": "si-scf-v1",
98
+ "workflow_inputs": {}
99
+ }
100
+ ```
101
+
102
+ ## CPU/GPU 与状态解释
103
+
104
+ CPU 是默认策略,尤其适用于小/中型交互任务、PP/结构/审计/归档任务和成本敏感场景。
105
+ 只有用户明确要求或项目已有 GPU 预算,并且 live catalog 返回
106
+ `gpu_support_status: "verified"` 时,才使用 `gpu`;强制 GPU 不得静默回退 CPU。只有
107
+ 结果明确返回 `selected_backend: "gpu"` 才能声称实际使用 GPU;`auto` 不是 GPU 使用证明。
108
+
109
+ 三个状态通道不可合并:
110
+
111
+ - `execution`:prepared/submitted/queued/running/scheduler completion/cancelled/failed;
112
+ - `solver`:not started/running/converged/not converged/failed/unknown;
113
+ - `scientific`:unreviewed、scientifically accepted、accepted with limitations、needs
114
+ recalculation、not assessable、failed 或 archived。
115
+
116
+ scheduler 完成不等于 solver 收敛,solver 收敛也不等于 scientific acceptance。按稳定
117
+ 错误码而不是 message 分支,重点包括 `PP_SET_INCOMPLETE`、`PP_POLICY_INCOMPATIBLE`、
118
+ `PP_CAPABILITY_UNKNOWN`、`ARTIFACT_MISSING`、`SOLVER_NOT_CONVERGED`、
119
+ `SCIENTIFIC_GATE_FAILED`、`RESTART_INCOMPATIBLE`、`IDEMPOTENCY_CONFLICT`、
120
+ `EXECUTION_BACKEND_NOT_READY`、`GPU_UNSUPPORTED` 和 `GPU_UNAVAILABLE`。
121
+
122
+ 提交、取消、重试或审核属于远端变更,必须有用户明确授权;结果未知时禁止重试。不要把
123
+ GPU smoke test、scheduler 日志或可解析的 QE 输出描述成科学结论或客户级性能保证。
@@ -1,138 +1,138 @@
1
- # RDKit 详细规则
2
-
3
- 只能通过 `delta-cli science invoke` 调用。以下业务响应位于 CLI 顶层 `data`;只按本文件
4
- 说明读取字段,不得递归搜索。这里只记录 operation schema,不授权直接 HTTP。
5
-
6
- 一个请求只执行完成目标所需的最少调用。同时校验、规范化并计算基础描述符时使用一次
7
- `batch-parse-describe`,payload 使用 `molecules:[{id,smiles}]`,不得拆成 parse 和
8
- descriptors。多个分子的全对相似度使用一次 `similarity-matrix`;排名字段固定为
9
- `a`、`b`、`similarity`,不是 `i`、`j`、`score`。
10
-
11
- 只报告业务响应实际存在的描述符。渲染 PNG 时只解码文档指定字段,并验证字节以
12
- `89 50 4e 47 0d 0a 1a 0a` 开头;不得把 JSON envelope 保存成图片。
13
-
14
- ## Health
15
-
16
- operation:`health`,无 body。
17
-
18
- ## Parse
19
-
20
- operation:`parse`。
21
-
22
- ```json
23
- {"input": "CCO", "format": "smiles", "sanitize": true}
24
- ```
25
-
26
- Formats: `smiles`, `inchi`, `molblock`.
27
-
28
- Key response fields in `data`: `valid`, `canonical_smiles`, `formula`,
29
- `molecular_weight`, `exact_molecular_weight`, `inchi_key`, `atom_count`,
30
- `heavy_atom_count`, `bond_count`, `warnings`, `error`.
31
-
32
- ## Descriptors
33
-
34
- operation:`descriptors`。
35
-
36
- ```json
37
- {"smiles": "CCO", "descriptor_set": "basic", "sanitize": true}
38
- ```
39
-
40
- `descriptor_set` currently supports `basic`. Descriptor keys include `Formula`,
41
- `MolWt`, `ExactMolWt`, `HeavyAtomMolWt`, `TPSA`, `MolLogP`, `NumHDonors`,
42
- `NumHAcceptors`, `NumRotatableBonds`, `RingCount`, `FractionCSP3`,
43
- `HeavyAtomCount`, `AtomCount`, and `BondCount`.
44
-
45
- ## Batch Descriptors
46
-
47
- operation:`batch-descriptors`。
48
-
49
- ```json
50
- {"smiles": ["CCO", "c1ccccc1"], "descriptor_set": "basic", "sanitize": true}
51
- ```
52
-
53
- Limits: 1-500 SMILES.
54
-
55
- ## Batch Parse Describe
56
-
57
- operation:`batch-parse-describe`。
58
-
59
- ```json
60
- {
61
- "molecules": [
62
- {"id": "aspirin", "smiles": "CC(=O)Oc1ccccc1C(=O)O"},
63
- {"id": "caffeine", "smiles": "Cn1cnc2c1c(=O)n(C)c(=O)n2C"}
64
- ],
65
- "descriptor_set": "basic",
66
- "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
67
- "sanitize": true
68
- }
69
- ```
70
-
71
- Limits: 1-500 molecules. Returns per-item `valid`, `canonical_smiles`, parse
72
- fields, `descriptors`, optional `fingerprint_metadata`, `on_bits`, `bit_count`,
73
- `warnings`, and `error`.
74
-
75
- ## Render
76
-
77
- operation:`render`。
78
-
79
- ```json
80
- {"smiles": "CCO", "image_format": "svg", "width": 450, "height": 320}
81
- ```
82
-
83
- Image formats: `svg`, `png`. SVG returns text; PNG returns base64.
84
- Width/height range: 150-2000.
85
-
86
- ## Fingerprint
87
-
88
- operation:`fingerprint`。
89
-
90
- ```json
91
- {"smiles": "CCO", "radius": 2, "n_bits": 2048}
92
- ```
93
-
94
- Morgan fingerprint parameters: `radius` 1-6, `n_bits` 128-8192.
95
-
96
- ## Similarity
97
-
98
- operation:`similarity`。
99
-
100
- ```json
101
- {"query_smiles": "CCO", "target_smiles": "CCCO", "radius": 2, "n_bits": 2048}
102
- ```
103
-
104
- Returns Tanimoto similarity.
105
-
106
- ## Similarity Matrix
107
-
108
- operation:`similarity-matrix`。
109
-
110
- ```json
111
- {
112
- "molecules": [
113
- {"id": "aspirin", "smiles": "CC(=O)Oc1ccccc1C(=O)O"},
114
- {"id": "ibuprofen", "smiles": "CC(C)Cc1ccc(cc1)[C@@H](C)C(=O)O"}
115
- ],
116
- "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
117
- "sanitize": true
118
- }
119
- ```
120
-
121
- Returns `matrix` in input order and `ranked_pairs` sorted by descending
122
- Tanimoto similarity. Each ranked record is named, not index-based:
123
-
124
- ```json
125
- {"a":"aspirin","b":"ibuprofen","similarity":0.195122}
126
- ```
127
-
128
- Do not expect `i`, `j`, or `score` fields.
129
-
130
- ## Substructure
131
-
132
- operation:`substructure`。
133
-
134
- ```json
135
- {"query_smarts": "c1ccccc1", "target_smiles": ["c1ccccc1", "CCO"]}
136
- ```
137
-
138
- Limits: SMARTS max length 5000; target list size 1-500.
1
+ # RDKit 详细规则
2
+
3
+ 只能通过 `delta-cli science invoke` 调用。以下业务响应位于 CLI 顶层 `data`;只按本文件
4
+ 说明读取字段,不得递归搜索。这里只记录 operation schema,不授权直接 HTTP。
5
+
6
+ 一个请求只执行完成目标所需的最少调用。同时校验、规范化并计算基础描述符时使用一次
7
+ `batch-parse-describe`,payload 使用 `molecules:[{id,smiles}]`,不得拆成 parse 和
8
+ descriptors。多个分子的全对相似度使用一次 `similarity-matrix`;排名字段固定为
9
+ `a`、`b`、`similarity`,不是 `i`、`j`、`score`。
10
+
11
+ 只报告业务响应实际存在的描述符。渲染 PNG 时只解码文档指定字段,并验证字节以
12
+ `89 50 4e 47 0d 0a 1a 0a` 开头;不得把 JSON envelope 保存成图片。
13
+
14
+ ## Health
15
+
16
+ operation:`health`,无 body。
17
+
18
+ ## Parse
19
+
20
+ operation:`parse`。
21
+
22
+ ```json
23
+ {"input": "CCO", "format": "smiles", "sanitize": true}
24
+ ```
25
+
26
+ Formats: `smiles`, `inchi`, `molblock`.
27
+
28
+ Key response fields in `data`: `valid`, `canonical_smiles`, `formula`,
29
+ `molecular_weight`, `exact_molecular_weight`, `inchi_key`, `atom_count`,
30
+ `heavy_atom_count`, `bond_count`, `warnings`, `error`.
31
+
32
+ ## Descriptors
33
+
34
+ operation:`descriptors`。
35
+
36
+ ```json
37
+ {"smiles": "CCO", "descriptor_set": "basic", "sanitize": true}
38
+ ```
39
+
40
+ `descriptor_set` currently supports `basic`. Descriptor keys include `Formula`,
41
+ `MolWt`, `ExactMolWt`, `HeavyAtomMolWt`, `TPSA`, `MolLogP`, `NumHDonors`,
42
+ `NumHAcceptors`, `NumRotatableBonds`, `RingCount`, `FractionCSP3`,
43
+ `HeavyAtomCount`, `AtomCount`, and `BondCount`.
44
+
45
+ ## Batch Descriptors
46
+
47
+ operation:`batch-descriptors`。
48
+
49
+ ```json
50
+ {"smiles": ["CCO", "c1ccccc1"], "descriptor_set": "basic", "sanitize": true}
51
+ ```
52
+
53
+ Limits: 1-500 SMILES.
54
+
55
+ ## Batch Parse Describe
56
+
57
+ operation:`batch-parse-describe`。
58
+
59
+ ```json
60
+ {
61
+ "molecules": [
62
+ {"id": "aspirin", "smiles": "CC(=O)Oc1ccccc1C(=O)O"},
63
+ {"id": "caffeine", "smiles": "Cn1cnc2c1c(=O)n(C)c(=O)n2C"}
64
+ ],
65
+ "descriptor_set": "basic",
66
+ "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
67
+ "sanitize": true
68
+ }
69
+ ```
70
+
71
+ Limits: 1-500 molecules. Returns per-item `valid`, `canonical_smiles`, parse
72
+ fields, `descriptors`, optional `fingerprint_metadata`, `on_bits`, `bit_count`,
73
+ `warnings`, and `error`.
74
+
75
+ ## Render
76
+
77
+ operation:`render`。
78
+
79
+ ```json
80
+ {"smiles": "CCO", "image_format": "svg", "width": 450, "height": 320}
81
+ ```
82
+
83
+ Image formats: `svg`, `png`. SVG returns text; PNG returns base64.
84
+ Width/height range: 150-2000.
85
+
86
+ ## Fingerprint
87
+
88
+ operation:`fingerprint`。
89
+
90
+ ```json
91
+ {"smiles": "CCO", "radius": 2, "n_bits": 2048}
92
+ ```
93
+
94
+ Morgan fingerprint parameters: `radius` 1-6, `n_bits` 128-8192.
95
+
96
+ ## Similarity
97
+
98
+ operation:`similarity`。
99
+
100
+ ```json
101
+ {"query_smiles": "CCO", "target_smiles": "CCCO", "radius": 2, "n_bits": 2048}
102
+ ```
103
+
104
+ Returns Tanimoto similarity.
105
+
106
+ ## Similarity Matrix
107
+
108
+ operation:`similarity-matrix`。
109
+
110
+ ```json
111
+ {
112
+ "molecules": [
113
+ {"id": "aspirin", "smiles": "CC(=O)Oc1ccccc1C(=O)O"},
114
+ {"id": "ibuprofen", "smiles": "CC(C)Cc1ccc(cc1)[C@@H](C)C(=O)O"}
115
+ ],
116
+ "fingerprint": {"type": "morgan", "radius": 2, "n_bits": 2048},
117
+ "sanitize": true
118
+ }
119
+ ```
120
+
121
+ Returns `matrix` in input order and `ranked_pairs` sorted by descending
122
+ Tanimoto similarity. Each ranked record is named, not index-based:
123
+
124
+ ```json
125
+ {"a":"aspirin","b":"ibuprofen","similarity":0.195122}
126
+ ```
127
+
128
+ Do not expect `i`, `j`, or `score` fields.
129
+
130
+ ## Substructure
131
+
132
+ operation:`substructure`。
133
+
134
+ ```json
135
+ {"query_smarts": "c1ccccc1", "target_smiles": ["c1ccccc1", "CCO"]}
136
+ ```
137
+
138
+ Limits: SMARTS max length 5000; target list size 1-500.