Skip to content

Commit fd995b0

Browse files
update llm sandbox experience
1 parent e7caca9 commit fd995b0

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

examples/one_site_dmrg.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""
2+
One-site DMRG
3+
JITTABLE and GPU-accelerated
4+
"""
5+
16
from functools import partial
27
import time
38
import inspect

llm_experience.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,20 @@ To maintain high development standards, use the following specialized skills:
227227
2. **performance-optimize**: Scientific bottleneck diagnosis and refactoring. Enforces the "Hypothesis -> Benchmark -> Refactor" workflow using JAX primitives.
228228
3. **tc-rosetta**: End-to-end intent-based translation from Qiskit/PennyLane to TC-NG. Prioritizes functional rewrites over syntax mapping to achieve maximum speedup.
229229
4. **tutorial-crafter**: Transforms raw TC-NG scripts into comprehensive, narrative-driven Markdown educational tutorials, highlighting HPC programming practices.
230+
231+
## Agentic Sandbox & CLI Protocols
232+
233+
1. **Environment Variables for Read-Only Runtimes**:
234+
* **Context**: The agentic sandbox environment often has restricted write permissions to default configuration and cache directories (e.g., `~/.cache`, `~/.config`).
235+
* **Protocol**: Always prepend critical cache redirection variables when running scripts that use Numba, Matplotlib, or JAX.
236+
* **Required Variables**:
237+
* `NUMBA_CACHE_DIR=/tmp/numba_cache`: Prevents `PermissionError` when Numba (used by `quimb`, `scipy`) tries to write specialized kernels.
238+
* `MPLCONFIGDIR=/tmp/matplotlib_cache`: Prevents `PermissionError` when `matplotlib` attempts to write font caches or configuration.
239+
* **Execution Template**:
240+
```bash
241+
NUMBA_CACHE_DIR=/tmp/numba_cache MPLCONFIGDIR=/tmp/matplotlib_cache conda run -n <env> python3 <script.py>
242+
```
243+
244+
2. **Output Redirection and Paging**:
245+
* The sandbox terminal often handles large outputs poorly or requires non-interactive execution.
246+
* **Protocol**: Use `PAGER=cat` (often default in agent tools) to ensure logs are fully captured without getting stuck in a `less` prompt.

0 commit comments

Comments
 (0)