@bgicli/bgicli 2.2.8 → 2.2.9

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 (113) hide show
  1. package/data/skills/anthropic-algorithmic-art/SKILL.md +405 -0
  2. package/data/skills/anthropic-canvas-design/SKILL.md +130 -0
  3. package/data/skills/anthropic-claude-api/SKILL.md +243 -0
  4. package/data/skills/anthropic-doc-coauthoring/SKILL.md +375 -0
  5. package/data/skills/anthropic-docx/SKILL.md +590 -0
  6. package/data/skills/anthropic-frontend-design/SKILL.md +42 -0
  7. package/data/skills/anthropic-internal-comms/SKILL.md +32 -0
  8. package/data/skills/anthropic-mcp-builder/SKILL.md +236 -0
  9. package/data/skills/anthropic-pdf/SKILL.md +314 -0
  10. package/data/skills/anthropic-pptx/SKILL.md +232 -0
  11. package/data/skills/anthropic-skill-creator/SKILL.md +485 -0
  12. package/data/skills/anthropic-webapp-testing/SKILL.md +96 -0
  13. package/data/skills/anthropic-xlsx/SKILL.md +292 -0
  14. package/data/skills/arxiv-database/SKILL.md +362 -0
  15. package/data/skills/astropy/SKILL.md +329 -0
  16. package/data/skills/ctx-advanced-evaluation/SKILL.md +402 -0
  17. package/data/skills/ctx-bdi-mental-states/SKILL.md +311 -0
  18. package/data/skills/ctx-context-compression/SKILL.md +272 -0
  19. package/data/skills/ctx-context-degradation/SKILL.md +206 -0
  20. package/data/skills/ctx-context-fundamentals/SKILL.md +201 -0
  21. package/data/skills/ctx-context-optimization/SKILL.md +195 -0
  22. package/data/skills/ctx-evaluation/SKILL.md +251 -0
  23. package/data/skills/ctx-filesystem-context/SKILL.md +287 -0
  24. package/data/skills/ctx-hosted-agents/SKILL.md +260 -0
  25. package/data/skills/ctx-memory-systems/SKILL.md +225 -0
  26. package/data/skills/ctx-multi-agent-patterns/SKILL.md +257 -0
  27. package/data/skills/ctx-project-development/SKILL.md +291 -0
  28. package/data/skills/ctx-tool-design/SKILL.md +271 -0
  29. package/data/skills/dhdna-profiler/SKILL.md +162 -0
  30. package/data/skills/generate-image/SKILL.md +183 -0
  31. package/data/skills/geomaster/SKILL.md +365 -0
  32. package/data/skills/get-available-resources/SKILL.md +275 -0
  33. package/data/skills/hamelsmu-build-review-interface/SKILL.md +96 -0
  34. package/data/skills/hamelsmu-error-analysis/SKILL.md +164 -0
  35. package/data/skills/hamelsmu-eval-audit/SKILL.md +183 -0
  36. package/data/skills/hamelsmu-evaluate-rag/SKILL.md +177 -0
  37. package/data/skills/hamelsmu-generate-synthetic-data/SKILL.md +131 -0
  38. package/data/skills/hamelsmu-validate-evaluator/SKILL.md +212 -0
  39. package/data/skills/hamelsmu-write-judge-prompt/SKILL.md +144 -0
  40. package/data/skills/hf-cli/SKILL.md +174 -0
  41. package/data/skills/hf-mcp/SKILL.md +178 -0
  42. package/data/skills/hugging-face-dataset-viewer/SKILL.md +121 -0
  43. package/data/skills/hugging-face-datasets/SKILL.md +542 -0
  44. package/data/skills/hugging-face-evaluation/SKILL.md +651 -0
  45. package/data/skills/hugging-face-jobs/SKILL.md +1042 -0
  46. package/data/skills/hugging-face-model-trainer/SKILL.md +717 -0
  47. package/data/skills/hugging-face-paper-pages/SKILL.md +239 -0
  48. package/data/skills/hugging-face-paper-publisher/SKILL.md +624 -0
  49. package/data/skills/hugging-face-tool-builder/SKILL.md +110 -0
  50. package/data/skills/hugging-face-trackio/SKILL.md +115 -0
  51. package/data/skills/hugging-face-vision-trainer/SKILL.md +593 -0
  52. package/data/skills/huggingface-gradio/SKILL.md +245 -0
  53. package/data/skills/matlab/SKILL.md +376 -0
  54. package/data/skills/modal/SKILL.md +381 -0
  55. package/data/skills/openai-cloudflare-deploy/SKILL.md +224 -0
  56. package/data/skills/openai-develop-web-game/SKILL.md +149 -0
  57. package/data/skills/openai-doc/SKILL.md +80 -0
  58. package/data/skills/openai-figma/SKILL.md +42 -0
  59. package/data/skills/openai-figma-implement-design/SKILL.md +264 -0
  60. package/data/skills/openai-gh-address-comments/SKILL.md +25 -0
  61. package/data/skills/openai-gh-fix-ci/SKILL.md +69 -0
  62. package/data/skills/openai-imagegen/SKILL.md +174 -0
  63. package/data/skills/openai-jupyter-notebook/SKILL.md +107 -0
  64. package/data/skills/openai-linear/SKILL.md +87 -0
  65. package/data/skills/openai-netlify-deploy/SKILL.md +247 -0
  66. package/data/skills/openai-notion-knowledge-capture/SKILL.md +56 -0
  67. package/data/skills/openai-notion-meeting-intelligence/SKILL.md +60 -0
  68. package/data/skills/openai-notion-research-documentation/SKILL.md +59 -0
  69. package/data/skills/openai-notion-spec-to-implementation/SKILL.md +58 -0
  70. package/data/skills/openai-openai-docs/SKILL.md +69 -0
  71. package/data/skills/openai-pdf/SKILL.md +67 -0
  72. package/data/skills/openai-playwright/SKILL.md +147 -0
  73. package/data/skills/openai-render-deploy/SKILL.md +479 -0
  74. package/data/skills/openai-screenshot/SKILL.md +267 -0
  75. package/data/skills/openai-security-best-practices/SKILL.md +86 -0
  76. package/data/skills/openai-security-ownership-map/SKILL.md +206 -0
  77. package/data/skills/openai-security-threat-model/SKILL.md +81 -0
  78. package/data/skills/openai-sentry/SKILL.md +123 -0
  79. package/data/skills/openai-sora/SKILL.md +178 -0
  80. package/data/skills/openai-speech/SKILL.md +144 -0
  81. package/data/skills/openai-spreadsheet/SKILL.md +145 -0
  82. package/data/skills/openai-transcribe/SKILL.md +81 -0
  83. package/data/skills/openai-vercel-deploy/SKILL.md +77 -0
  84. package/data/skills/openai-yeet/SKILL.md +28 -0
  85. package/data/skills/pennylane/SKILL.md +224 -0
  86. package/data/skills/polars-bio/SKILL.md +374 -0
  87. package/data/skills/primekg/SKILL.md +97 -0
  88. package/data/skills/pymatgen/SKILL.md +689 -0
  89. package/data/skills/qiskit/SKILL.md +273 -0
  90. package/data/skills/qutip/SKILL.md +316 -0
  91. package/data/skills/recursive-decomposition/SKILL.md +185 -0
  92. package/data/skills/rowan/SKILL.md +427 -0
  93. package/data/skills/scholar-evaluation/SKILL.md +298 -0
  94. package/data/skills/sentry-create-alert/SKILL.md +210 -0
  95. package/data/skills/sentry-fix-issues/SKILL.md +126 -0
  96. package/data/skills/sentry-pr-code-review/SKILL.md +105 -0
  97. package/data/skills/sentry-python-sdk/SKILL.md +317 -0
  98. package/data/skills/sentry-setup-ai-monitoring/SKILL.md +217 -0
  99. package/data/skills/stable-baselines3/SKILL.md +297 -0
  100. package/data/skills/sympy/SKILL.md +498 -0
  101. package/data/skills/trailofbits-ask-questions-if-underspecified/SKILL.md +85 -0
  102. package/data/skills/trailofbits-audit-context-building/SKILL.md +302 -0
  103. package/data/skills/trailofbits-differential-review/SKILL.md +220 -0
  104. package/data/skills/trailofbits-insecure-defaults/SKILL.md +117 -0
  105. package/data/skills/trailofbits-modern-python/SKILL.md +333 -0
  106. package/data/skills/trailofbits-property-based-testing/SKILL.md +123 -0
  107. package/data/skills/trailofbits-semgrep-rule-creator/SKILL.md +172 -0
  108. package/data/skills/trailofbits-sharp-edges/SKILL.md +292 -0
  109. package/data/skills/trailofbits-variant-analysis/SKILL.md +142 -0
  110. package/data/skills/transformers.js/SKILL.md +637 -0
  111. package/data/skills/writing/SKILL.md +419 -0
  112. package/dist/bgi.js +2 -2
  113. package/package.json +1 -1
@@ -0,0 +1,273 @@
1
+ ---
2
+ name: qiskit
3
+ description: IBM quantum computing framework. Use when targeting IBM Quantum hardware, working with Qiskit Runtime for production workloads, or needing IBM optimization tools. Best for IBM hardware execution, quantum error mitigation, and enterprise quantum computing. For Google hardware use cirq; for gradient-based quantum ML use pennylane; for open quantum system simulations use qutip.
4
+ license: Apache-2.0 license
5
+ metadata:
6
+ skill-author: K-Dense Inc.
7
+ ---
8
+
9
+ # Qiskit
10
+
11
+ ## Overview
12
+
13
+ Qiskit is the world's most popular open-source quantum computing framework with 13M+ downloads. Build quantum circuits, optimize for hardware, execute on simulators or real quantum computers, and analyze results. Supports IBM Quantum (100+ qubit systems), IonQ, Amazon Braket, and other providers.
14
+
15
+ **Key Features:**
16
+ - 83x faster transpilation than competitors
17
+ - 29% fewer two-qubit gates in optimized circuits
18
+ - Backend-agnostic execution (local simulators or cloud hardware)
19
+ - Comprehensive algorithm libraries for optimization, chemistry, and ML
20
+
21
+ ## Quick Start
22
+
23
+ ### Installation
24
+
25
+ ```bash
26
+ uv pip install qiskit
27
+ uv pip install "qiskit[visualization]" matplotlib
28
+ ```
29
+
30
+ ### First Circuit
31
+
32
+ ```python
33
+ from qiskit import QuantumCircuit
34
+ from qiskit.primitives import StatevectorSampler
35
+
36
+ # Create Bell state (entangled qubits)
37
+ qc = QuantumCircuit(2)
38
+ qc.h(0) # Hadamard on qubit 0
39
+ qc.cx(0, 1) # CNOT from qubit 0 to 1
40
+ qc.measure_all() # Measure both qubits
41
+
42
+ # Run locally
43
+ sampler = StatevectorSampler()
44
+ result = sampler.run([qc], shots=1024).result()
45
+ counts = result[0].data.meas.get_counts()
46
+ print(counts) # {'00': ~512, '11': ~512}
47
+ ```
48
+
49
+ ### Visualization
50
+
51
+ ```python
52
+ from qiskit.visualization import plot_histogram
53
+
54
+ qc.draw('mpl') # Circuit diagram
55
+ plot_histogram(counts) # Results histogram
56
+ ```
57
+
58
+ ## Core Capabilities
59
+
60
+ ### 1. Setup and Installation
61
+ For detailed installation, authentication, and IBM Quantum account setup:
62
+ - **See `references/setup.md`**
63
+
64
+ Topics covered:
65
+ - Installation with uv
66
+ - Python environment setup
67
+ - IBM Quantum account and API token configuration
68
+ - Local vs. cloud execution
69
+
70
+ ### 2. Building Quantum Circuits
71
+ For constructing quantum circuits with gates, measurements, and composition:
72
+ - **See `references/circuits.md`**
73
+
74
+ Topics covered:
75
+ - Creating circuits with QuantumCircuit
76
+ - Single-qubit gates (H, X, Y, Z, rotations, phase gates)
77
+ - Multi-qubit gates (CNOT, SWAP, Toffoli)
78
+ - Measurements and barriers
79
+ - Circuit composition and properties
80
+ - Parameterized circuits for variational algorithms
81
+
82
+ ### 3. Primitives (Sampler and Estimator)
83
+ For executing quantum circuits and computing results:
84
+ - **See `references/primitives.md`**
85
+
86
+ Topics covered:
87
+ - **Sampler**: Get bitstring measurements and probability distributions
88
+ - **Estimator**: Compute expectation values of observables
89
+ - V2 interface (StatevectorSampler, StatevectorEstimator)
90
+ - IBM Quantum Runtime primitives for hardware
91
+ - Sessions and Batch modes
92
+ - Parameter binding
93
+
94
+ ### 4. Transpilation and Optimization
95
+ For optimizing circuits and preparing for hardware execution:
96
+ - **See `references/transpilation.md`**
97
+
98
+ Topics covered:
99
+ - Why transpilation is necessary
100
+ - Optimization levels (0-3)
101
+ - Six transpilation stages (init, layout, routing, translation, optimization, scheduling)
102
+ - Advanced features (virtual permutation elision, gate cancellation)
103
+ - Common parameters (initial_layout, approximation_degree, seed)
104
+ - Best practices for efficient circuits
105
+
106
+ ### 5. Visualization
107
+ For displaying circuits, results, and quantum states:
108
+ - **See `references/visualization.md`**
109
+
110
+ Topics covered:
111
+ - Circuit drawings (text, matplotlib, LaTeX)
112
+ - Result histograms
113
+ - Quantum state visualization (Bloch sphere, state city, QSphere)
114
+ - Backend topology and error maps
115
+ - Customization and styling
116
+ - Saving publication-quality figures
117
+
118
+ ### 6. Hardware Backends
119
+ For running on simulators and real quantum computers:
120
+ - **See `references/backends.md`**
121
+
122
+ Topics covered:
123
+ - IBM Quantum backends and authentication
124
+ - Backend properties and status
125
+ - Running on real hardware with Runtime primitives
126
+ - Job management and queuing
127
+ - Session mode (iterative algorithms)
128
+ - Batch mode (parallel jobs)
129
+ - Local simulators (StatevectorSampler, Aer)
130
+ - Third-party providers (IonQ, Amazon Braket)
131
+ - Error mitigation strategies
132
+
133
+ ### 7. Qiskit Patterns Workflow
134
+ For implementing the four-step quantum computing workflow:
135
+ - **See `references/patterns.md`**
136
+
137
+ Topics covered:
138
+ - **Map**: Translate problems to quantum circuits
139
+ - **Optimize**: Transpile for hardware
140
+ - **Execute**: Run with primitives
141
+ - **Post-process**: Extract and analyze results
142
+ - Complete VQE example
143
+ - Session vs. Batch execution
144
+ - Common workflow patterns
145
+
146
+ ### 8. Quantum Algorithms and Applications
147
+ For implementing specific quantum algorithms:
148
+ - **See `references/algorithms.md`**
149
+
150
+ Topics covered:
151
+ - **Optimization**: VQE, QAOA, Grover's algorithm
152
+ - **Chemistry**: Molecular ground states, excited states, Hamiltonians
153
+ - **Machine Learning**: Quantum kernels, VQC, QNN
154
+ - **Algorithm libraries**: Qiskit Nature, Qiskit ML, Qiskit Optimization
155
+ - Physics simulations and benchmarking
156
+
157
+ ## Workflow Decision Guide
158
+
159
+ **If you need to:**
160
+
161
+ - Install Qiskit or set up IBM Quantum account → `references/setup.md`
162
+ - Build a new quantum circuit → `references/circuits.md`
163
+ - Understand gates and circuit operations → `references/circuits.md`
164
+ - Run circuits and get measurements → `references/primitives.md`
165
+ - Compute expectation values → `references/primitives.md`
166
+ - Optimize circuits for hardware → `references/transpilation.md`
167
+ - Visualize circuits or results → `references/visualization.md`
168
+ - Execute on IBM Quantum hardware → `references/backends.md`
169
+ - Connect to third-party providers → `references/backends.md`
170
+ - Implement end-to-end quantum workflow → `references/patterns.md`
171
+ - Build specific algorithm (VQE, QAOA, etc.) → `references/algorithms.md`
172
+ - Solve chemistry or optimization problems → `references/algorithms.md`
173
+
174
+ ## Best Practices
175
+
176
+ ### Development Workflow
177
+
178
+ 1. **Start with simulators**: Test locally before using hardware
179
+ ```python
180
+ from qiskit.primitives import StatevectorSampler
181
+ sampler = StatevectorSampler()
182
+ ```
183
+
184
+ 2. **Always transpile**: Optimize circuits before execution
185
+ ```python
186
+ from qiskit import transpile
187
+ qc_optimized = transpile(qc, backend=backend, optimization_level=3)
188
+ ```
189
+
190
+ 3. **Use appropriate primitives**:
191
+ - Sampler for bitstrings (optimization algorithms)
192
+ - Estimator for expectation values (chemistry, physics)
193
+
194
+ 4. **Choose execution mode**:
195
+ - Session: Iterative algorithms (VQE, QAOA)
196
+ - Batch: Independent parallel jobs
197
+ - Single job: One-off experiments
198
+
199
+ ### Performance Optimization
200
+
201
+ - Use optimization_level=3 for production
202
+ - Minimize two-qubit gates (major error source)
203
+ - Test with noisy simulators before hardware
204
+ - Save and reuse transpiled circuits
205
+ - Monitor convergence in variational algorithms
206
+
207
+ ### Hardware Execution
208
+
209
+ - Check backend status before submitting
210
+ - Use least_busy() for testing
211
+ - Save job IDs for later retrieval
212
+ - Apply error mitigation (resilience_level)
213
+ - Start with fewer shots, increase for final runs
214
+
215
+ ## Common Patterns
216
+
217
+ ### Pattern 1: Simple Circuit Execution
218
+
219
+ ```python
220
+ from qiskit import QuantumCircuit, transpile
221
+ from qiskit.primitives import StatevectorSampler
222
+
223
+ qc = QuantumCircuit(2)
224
+ qc.h(0)
225
+ qc.cx(0, 1)
226
+ qc.measure_all()
227
+
228
+ sampler = StatevectorSampler()
229
+ result = sampler.run([qc], shots=1024).result()
230
+ counts = result[0].data.meas.get_counts()
231
+ ```
232
+
233
+ ### Pattern 2: Hardware Execution with Transpilation
234
+
235
+ ```python
236
+ from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2 as Sampler
237
+ from qiskit import transpile
238
+
239
+ service = QiskitRuntimeService()
240
+ backend = service.backend("ibm_brisbane")
241
+
242
+ qc_optimized = transpile(qc, backend=backend, optimization_level=3)
243
+
244
+ sampler = Sampler(backend)
245
+ job = sampler.run([qc_optimized], shots=1024)
246
+ result = job.result()
247
+ ```
248
+
249
+ ### Pattern 3: Variational Algorithm (VQE)
250
+
251
+ ```python
252
+ from qiskit_ibm_runtime import Session, EstimatorV2 as Estimator
253
+ from scipy.optimize import minimize
254
+
255
+ with Session(backend=backend) as session:
256
+ estimator = Estimator(session=session)
257
+
258
+ def cost_function(params):
259
+ bound_qc = ansatz.assign_parameters(params)
260
+ qc_isa = transpile(bound_qc, backend=backend)
261
+ result = estimator.run([(qc_isa, hamiltonian)]).result()
262
+ return result[0].data.evs
263
+
264
+ result = minimize(cost_function, initial_params, method='COBYLA')
265
+ ```
266
+
267
+ ## Additional Resources
268
+
269
+ - **Official Docs**: https://quantum.ibm.com/docs
270
+ - **Qiskit Textbook**: https://qiskit.org/learn
271
+ - **API Reference**: https://docs.quantum.ibm.com/api/qiskit
272
+ - **Patterns Guide**: https://quantum.cloud.ibm.com/docs/en/guides/intro-to-patterns
273
+
@@ -0,0 +1,316 @@
1
+ ---
2
+ name: qutip
3
+ description: Quantum physics simulation library for open quantum systems. Use when studying master equations, Lindblad dynamics, decoherence, quantum optics, or cavity QED. Best for physics research, open system dynamics, and educational simulations. NOT for circuit-based quantum computing—use qiskit, cirq, or pennylane for quantum algorithms and hardware execution.
4
+ license: BSD-3-Clause license
5
+ metadata:
6
+ skill-author: K-Dense Inc.
7
+ ---
8
+
9
+ # QuTiP: Quantum Toolbox in Python
10
+
11
+ ## Overview
12
+
13
+ QuTiP provides comprehensive tools for simulating and analyzing quantum mechanical systems. It handles both closed (unitary) and open (dissipative) quantum systems with multiple solvers optimized for different scenarios.
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ uv pip install qutip
19
+ ```
20
+
21
+ Optional packages for additional functionality:
22
+
23
+ ```bash
24
+ # Quantum information processing (circuits, gates)
25
+ uv pip install qutip-qip
26
+
27
+ # Quantum trajectory viewer
28
+ uv pip install qutip-qtrl
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ```python
34
+ from qutip import *
35
+ import numpy as np
36
+ import matplotlib.pyplot as plt
37
+
38
+ # Create quantum state
39
+ psi = basis(2, 0) # |0⟩ state
40
+
41
+ # Create operator
42
+ H = sigmaz() # Hamiltonian
43
+
44
+ # Time evolution
45
+ tlist = np.linspace(0, 10, 100)
46
+ result = sesolve(H, psi, tlist, e_ops=[sigmaz()])
47
+
48
+ # Plot results
49
+ plt.plot(tlist, result.expect[0])
50
+ plt.xlabel('Time')
51
+ plt.ylabel('⟨σz⟩')
52
+ plt.show()
53
+ ```
54
+
55
+ ## Core Capabilities
56
+
57
+ ### 1. Quantum Objects and States
58
+
59
+ Create and manipulate quantum states and operators:
60
+
61
+ ```python
62
+ # States
63
+ psi = basis(N, n) # Fock state |n⟩
64
+ psi = coherent(N, alpha) # Coherent state |α⟩
65
+ rho = thermal_dm(N, n_avg) # Thermal density matrix
66
+
67
+ # Operators
68
+ a = destroy(N) # Annihilation operator
69
+ H = num(N) # Number operator
70
+ sx, sy, sz = sigmax(), sigmay(), sigmaz() # Pauli matrices
71
+
72
+ # Composite systems
73
+ psi_AB = tensor(psi_A, psi_B) # Tensor product
74
+ ```
75
+
76
+ **See** `references/core_concepts.md` for comprehensive coverage of quantum objects, states, operators, and tensor products.
77
+
78
+ ### 2. Time Evolution and Dynamics
79
+
80
+ Multiple solvers for different scenarios:
81
+
82
+ ```python
83
+ # Closed systems (unitary evolution)
84
+ result = sesolve(H, psi0, tlist, e_ops=[num(N)])
85
+
86
+ # Open systems (dissipation)
87
+ c_ops = [np.sqrt(0.1) * destroy(N)] # Collapse operators
88
+ result = mesolve(H, psi0, tlist, c_ops, e_ops=[num(N)])
89
+
90
+ # Quantum trajectories (Monte Carlo)
91
+ result = mcsolve(H, psi0, tlist, c_ops, ntraj=500, e_ops=[num(N)])
92
+ ```
93
+
94
+ **Solver selection guide:**
95
+ - `sesolve`: Pure states, unitary evolution
96
+ - `mesolve`: Mixed states, dissipation, general open systems
97
+ - `mcsolve`: Quantum jumps, photon counting, individual trajectories
98
+ - `brmesolve`: Weak system-bath coupling
99
+ - `fmmesolve`: Time-periodic Hamiltonians (Floquet)
100
+
101
+ **See** `references/time_evolution.md` for detailed solver documentation, time-dependent Hamiltonians, and advanced options.
102
+
103
+ ### 3. Analysis and Measurement
104
+
105
+ Compute physical quantities:
106
+
107
+ ```python
108
+ # Expectation values
109
+ n_avg = expect(num(N), psi)
110
+
111
+ # Entropy measures
112
+ S = entropy_vn(rho) # Von Neumann entropy
113
+ C = concurrence(rho) # Entanglement (two qubits)
114
+
115
+ # Fidelity and distance
116
+ F = fidelity(psi1, psi2)
117
+ D = tracedist(rho1, rho2)
118
+
119
+ # Correlation functions
120
+ corr = correlation_2op_1t(H, rho0, taulist, c_ops, A, B)
121
+ w, S = spectrum_correlation_fft(taulist, corr)
122
+
123
+ # Steady states
124
+ rho_ss = steadystate(H, c_ops)
125
+ ```
126
+
127
+ **See** `references/analysis.md` for entropy, fidelity, measurements, correlation functions, and steady state calculations.
128
+
129
+ ### 4. Visualization
130
+
131
+ Visualize quantum states and dynamics:
132
+
133
+ ```python
134
+ # Bloch sphere
135
+ b = Bloch()
136
+ b.add_states(psi)
137
+ b.show()
138
+
139
+ # Wigner function (phase space)
140
+ xvec = np.linspace(-5, 5, 200)
141
+ W = wigner(psi, xvec, xvec)
142
+ plt.contourf(xvec, xvec, W, 100, cmap='RdBu')
143
+
144
+ # Fock distribution
145
+ plot_fock_distribution(psi)
146
+
147
+ # Matrix visualization
148
+ hinton(rho) # Hinton diagram
149
+ matrix_histogram(H.full()) # 3D bars
150
+ ```
151
+
152
+ **See** `references/visualization.md` for Bloch sphere animations, Wigner functions, Q-functions, and matrix visualizations.
153
+
154
+ ### 5. Advanced Methods
155
+
156
+ Specialized techniques for complex scenarios:
157
+
158
+ ```python
159
+ # Floquet theory (periodic Hamiltonians)
160
+ T = 2 * np.pi / w_drive
161
+ f_modes, f_energies = floquet_modes(H, T, args)
162
+ result = fmmesolve(H, psi0, tlist, c_ops, T=T, args=args)
163
+
164
+ # HEOM (non-Markovian, strong coupling)
165
+ from qutip.nonmarkov.heom import HEOMSolver, BosonicBath
166
+ bath = BosonicBath(Q, ck_real, vk_real)
167
+ hsolver = HEOMSolver(H_sys, [bath], max_depth=5)
168
+ result = hsolver.run(rho0, tlist)
169
+
170
+ # Permutational invariance (identical particles)
171
+ psi = dicke(N, j, m) # Dicke states
172
+ Jz = jspin(N, 'z') # Collective operators
173
+ ```
174
+
175
+ **See** `references/advanced.md` for Floquet theory, HEOM, permutational invariance, stochastic solvers, superoperators, and performance optimization.
176
+
177
+ ## Common Workflows
178
+
179
+ ### Simulating a Damped Harmonic Oscillator
180
+
181
+ ```python
182
+ # System parameters
183
+ N = 20 # Hilbert space dimension
184
+ omega = 1.0 # Oscillator frequency
185
+ kappa = 0.1 # Decay rate
186
+
187
+ # Hamiltonian and collapse operators
188
+ H = omega * num(N)
189
+ c_ops = [np.sqrt(kappa) * destroy(N)]
190
+
191
+ # Initial state
192
+ psi0 = coherent(N, 3.0)
193
+
194
+ # Time evolution
195
+ tlist = np.linspace(0, 50, 200)
196
+ result = mesolve(H, psi0, tlist, c_ops, e_ops=[num(N)])
197
+
198
+ # Visualize
199
+ plt.plot(tlist, result.expect[0])
200
+ plt.xlabel('Time')
201
+ plt.ylabel('⟨n⟩')
202
+ plt.title('Photon Number Decay')
203
+ plt.show()
204
+ ```
205
+
206
+ ### Two-Qubit Entanglement Dynamics
207
+
208
+ ```python
209
+ # Create Bell state
210
+ psi0 = bell_state('00')
211
+
212
+ # Local dephasing on each qubit
213
+ gamma = 0.1
214
+ c_ops = [
215
+ np.sqrt(gamma) * tensor(sigmaz(), qeye(2)),
216
+ np.sqrt(gamma) * tensor(qeye(2), sigmaz())
217
+ ]
218
+
219
+ # Track entanglement
220
+ def compute_concurrence(t, psi):
221
+ rho = ket2dm(psi) if psi.isket else psi
222
+ return concurrence(rho)
223
+
224
+ tlist = np.linspace(0, 10, 100)
225
+ result = mesolve(qeye([2, 2]), psi0, tlist, c_ops)
226
+
227
+ # Compute concurrence for each state
228
+ C_t = [concurrence(state.proj()) for state in result.states]
229
+
230
+ plt.plot(tlist, C_t)
231
+ plt.xlabel('Time')
232
+ plt.ylabel('Concurrence')
233
+ plt.title('Entanglement Decay')
234
+ plt.show()
235
+ ```
236
+
237
+ ### Jaynes-Cummings Model
238
+
239
+ ```python
240
+ # System parameters
241
+ N = 10 # Cavity Fock space
242
+ wc = 1.0 # Cavity frequency
243
+ wa = 1.0 # Atom frequency
244
+ g = 0.05 # Coupling strength
245
+
246
+ # Operators
247
+ a = tensor(destroy(N), qeye(2)) # Cavity
248
+ sm = tensor(qeye(N), sigmam()) # Atom
249
+
250
+ # Hamiltonian (RWA)
251
+ H = wc * a.dag() * a + wa * sm.dag() * sm + g * (a.dag() * sm + a * sm.dag())
252
+
253
+ # Initial state: cavity in coherent state, atom in ground state
254
+ psi0 = tensor(coherent(N, 2), basis(2, 0))
255
+
256
+ # Dissipation
257
+ kappa = 0.1 # Cavity decay
258
+ gamma = 0.05 # Atomic decay
259
+ c_ops = [np.sqrt(kappa) * a, np.sqrt(gamma) * sm]
260
+
261
+ # Observables
262
+ n_cav = a.dag() * a
263
+ n_atom = sm.dag() * sm
264
+
265
+ # Evolve
266
+ tlist = np.linspace(0, 50, 200)
267
+ result = mesolve(H, psi0, tlist, c_ops, e_ops=[n_cav, n_atom])
268
+
269
+ # Plot
270
+ fig, axes = plt.subplots(2, 1, figsize=(8, 6), sharex=True)
271
+ axes[0].plot(tlist, result.expect[0])
272
+ axes[0].set_ylabel('⟨n_cavity⟩')
273
+ axes[1].plot(tlist, result.expect[1])
274
+ axes[1].set_ylabel('⟨n_atom⟩')
275
+ axes[1].set_xlabel('Time')
276
+ plt.tight_layout()
277
+ plt.show()
278
+ ```
279
+
280
+ ## Tips for Efficient Simulations
281
+
282
+ 1. **Truncate Hilbert spaces**: Use smallest dimension that captures dynamics
283
+ 2. **Choose appropriate solver**: `sesolve` for pure states is faster than `mesolve`
284
+ 3. **Time-dependent terms**: String format (e.g., `'cos(w*t)'`) is fastest
285
+ 4. **Store only needed data**: Use `e_ops` instead of storing all states
286
+ 5. **Adjust tolerances**: Balance accuracy with computation time via `Options`
287
+ 6. **Parallel trajectories**: `mcsolve` automatically uses multiple CPUs
288
+ 7. **Check convergence**: Vary `ntraj`, Hilbert space size, and tolerances
289
+
290
+ ## Troubleshooting
291
+
292
+ **Memory issues**: Reduce Hilbert space dimension, use `store_final_state` option, or consider Krylov methods
293
+
294
+ **Slow simulations**: Use string-based time-dependence, increase tolerances slightly, or try `method='bdf'` for stiff problems
295
+
296
+ **Numerical instabilities**: Decrease time steps (`nsteps` option), increase tolerances, or check Hamiltonian/operators are properly defined
297
+
298
+ **Import errors**: Ensure QuTiP is installed correctly; quantum gates require `qutip-qip` package
299
+
300
+ ## References
301
+
302
+ This skill includes detailed reference documentation:
303
+
304
+ - **`references/core_concepts.md`**: Quantum objects, states, operators, tensor products, composite systems
305
+ - **`references/time_evolution.md`**: All solvers (sesolve, mesolve, mcsolve, brmesolve, etc.), time-dependent Hamiltonians, solver options
306
+ - **`references/visualization.md`**: Bloch sphere, Wigner functions, Q-functions, Fock distributions, matrix plots
307
+ - **`references/analysis.md`**: Expectation values, entropy, fidelity, entanglement measures, correlation functions, steady states
308
+ - **`references/advanced.md`**: Floquet theory, HEOM, permutational invariance, stochastic methods, superoperators, performance tips
309
+
310
+ ## External Resources
311
+
312
+ - Documentation: https://qutip.readthedocs.io/
313
+ - Tutorials: https://qutip.org/qutip-tutorials/
314
+ - API Reference: https://qutip.readthedocs.io/en/stable/apidoc/apidoc.html
315
+ - GitHub: https://github.com/qutip/qutip
316
+