### Run Quantum Circuit Locally with Simulator Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qiskit/references/setup.md Builds and executes a simple quantum circuit using Qiskit's local simulators. This example demonstrates creating a Bell state circuit and running it with the StatevectorSampler primitive. ```python from qiskit import QuantumCircuit from qiskit.primitives import StatevectorSampler qc = QuantumCircuit(2) pc.h(0) pc.cx(0, 1) pc.measure_all() # Run locally with simulator sampler = StatevectorSampler() result = sampler.run([qc], shots=1024).result() ``` -------------------------------- ### Install PennyLane and Plugins Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/pennylane/references/getting_started.md Installs the core PennyLane library and optional plugins for various quantum hardware and simulators using the 'uv' package manager. Ensure 'uv' is installed before running these commands. ```bash uv pip install pennylane # IBM Qiskit uv pip install pennylane-qiskit # Amazon Braket uv pip install amazon-braket-pennylane-plugin # Google Cirq uv pip install pennylane-cirq # Rigetti uv pip install pennylane-rigetti ``` -------------------------------- ### Verify OpenRouter and LiteLLM Setup Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/perplexity-search/references/openrouter_setup.md Scripts to verify that the OPENROUTER_API_KEY is set and LiteLLM is installed correctly. These checks ensure the environment is ready for use with Perplexity models. ```bash # Using the setup script python scripts/setup_env.py --validate ``` ```bash # Or using the search script python scripts/perplexity_search.py --check-setup ``` -------------------------------- ### Install Qiskit with uv Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qiskit/references/setup.md Installs the core Qiskit library using the uv package manager. For visualization features, install the 'visualization' extra and matplotlib. ```bash uv pip install qiskit ``` ```bash uv pip install "qiskit[visualization]" matplotlib ``` -------------------------------- ### Verify Installation Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/paper-2-web/references/installation.md Runs the main pipeline script with the --help flag to verify that the installation was successful and all options are accessible. ```bash python pipeline_all.py --help ``` -------------------------------- ### Verify Qiskit Installation Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qiskit/references/setup.md Checks if Qiskit is installed correctly by printing its version and creating a basic quantum circuit. A successful execution indicates that the library is accessible and functional. ```python import qiskit print(qiskit.__version__) from qiskit import QuantumCircuit pc = QuantumCircuit(2) print("Qiskit installed successfully!") ``` -------------------------------- ### Install Data Commons Client with Pandas Support Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/datacommons-client/references/getting_started.md Installs the Data Commons client library, including optional support for Pandas DataFrames, which is useful for data manipulation and analysis. It also shows how to set the Data Commons API key as an environment variable. ```bash # Install with Pandas support pip install "datacommons-client[Pandas]" # Set up API key for datacommons.org export DC_API_KEY="your_api_key_here" ``` -------------------------------- ### Install System Dependencies (Ubuntu/Debian) Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/paper-2-web/references/installation.md Installs necessary system-level packages, LibreOffice and Poppler utilities, on Ubuntu or Debian-based Linux distributions using apt-get. ```bash sudo apt-get install libreoffice poppler-utils ``` -------------------------------- ### Install LaminDB with Pip Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/lamindb/references/setup-deployment.md Installs the core LaminDB package using pip or pip3. This is the basic installation command. ```bash # Install LaminDB pip install lamindb # Or with pip3 pip3 install lamindb ``` -------------------------------- ### Initialize and Search ModelStore Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/molfeat/references/examples.md Demonstrates initializing the ModelStore, listing available models, searching for specific models by name, and retrieving model information such as version and authors. It also shows how to view usage instructions and load a model directly. ```python from molfeat.store import ModelStore # Initialize model store store = ModelStore() # List all available models print(f"Total available models: {len(store.available_models)}") # Search for specific models chemberta_models = store.search(name="ChemBERTa") for model in chemberta_models: print(f"- {model.name}: {model.description}") # Get model information model_card = store.search(name="ChemBERTa-77M-MLM")[0] print(f"Model: {model_card.name}") print(f"Version: {model_card.version}") print(f"Authors: {model_card.authors}") # View usage instructions model_card.usage() # Load model directly transformer = store.load("ChemBERTa-77M-MLM") ``` -------------------------------- ### Virtual Screening Setup Example Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/rowan/SKILL.md An example demonstrating the initial steps for a virtual screening workflow. It shows how to upload a protein target, sanitize its structure, and define a pocket for docking or screening. ```python import rowan # Upload protein once # protein = rowan.upload_protein("target.pdb", name="Drug Target") # protein.sanitize() # Clean structure # Define pocket # pocket = {"center": [x, y, z], "size": [20, 20, 20]} ``` -------------------------------- ### On-Policy Training Configuration with PPO in Python Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/stable-baselines3/references/algorithms.md Provides a configuration example for on-policy algorithms like PPO using vectorized environments for faster training. It specifies hyperparameters such as the number of steps per environment before an update, batch size, number of epochs, learning rate, and discount factor. ```python from stable_baselines3 import PPO from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.vec_env import SubprocVecEnv # Assuming 'env_id' is the environment identifier env = make_vec_env(env_id, n_envs=8, seed=0, vec_env_cls=SubprocVecEnv) model = PPO( "MlpPolicy", env, n_steps=2048, # Collect this many steps per environment before update batch_size=64, n_epochs=10, learning_rate=3e-4, gamma=0.99, verbose=1 ) ``` -------------------------------- ### Verify LaminDB and Bionty Installation Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/lamindb/references/setup-deployment.md Checks if LaminDB and Bionty are installed correctly by printing their respective version numbers. This is a basic verification step after installation. ```python import lamindb as ln print(ln.__version__) # Check available modules import bionty as bt print(bt.__version__) ``` -------------------------------- ### Install Denario with User Permissions Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/denario/references/installation.md Example of installing Denario using the '--user' flag with pip. This installs packages in the user's home directory, which can help avoid permission errors in environments where global installation is restricted. ```bash uv pip install --user "denario[app]" ``` -------------------------------- ### Install and Use IBM Quantum PennyLane Plugin Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/pennylane/references/devices_backends.md Provides instructions for installing the pennylane-qiskit plugin and demonstrates how to use PennyLane with IBM Quantum simulators and hardware. It covers device initialization for both simulators and QPUs, including backend selection and API token usage. ```bash # Install plugin uv pip install pennylane-qiskit ``` -------------------------------- ### Install LiteLLM Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/perplexity-search/references/openrouter_setup.md Installs the LiteLLM library, a key dependency for interacting with OpenRouter. Supports installation via uv or pip. Optional dependencies like python-dotenv and litellm[proxy] can also be installed. ```bash uv pip install litellm ``` ```bash pip install litellm ``` ```bash # For .env file support uv pip install python-dotenv # For additional features uv pip install litellm[proxy] # If using LiteLLM proxy server ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/paper-2-web/references/installation.md Clones the project repository from GitHub and changes the current directory to the project root. This is the first step in setting up the project locally. ```bash git clone https://github.com/YuhangChen1/Paper2All.git cd Paper2All ``` -------------------------------- ### Install LiteLLM (Bash) Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/perplexity-search/references/openrouter_setup.md Installs the LiteLLM package using 'uv pip'. LiteLLM is a library that simplifies the use of various LLM APIs, including OpenRouter. ```bash uv pip install litellm ``` -------------------------------- ### Transpile Circuit Before Running Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qiskit/references/backends.md Demonstrates the recommended practice of transpiling a quantum circuit before execution to optimize it for the target backend. Shows both incorrect and correct approaches. ```python # Bad: Run without transpilation job = sampler.run([qc], shots=1024) # Good: Transpile first qc_transpiled = transpile(qc, backend=backend, optimization_level=3) job = sampler.run([qc_transpiled], shots=1024) ``` -------------------------------- ### Basic PyTorch Deep Learning Setup Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/molfeat/references/examples.md Provides the initial imports required for setting up a deep learning model using PyTorch. This includes importing core PyTorch modules for neural networks, datasets, and dataloaders, along with relevant molfeat components for molecular featurization. ```python import torch import torch.nn as nn from torch.utils.data import Dataset, DataLoader from molfeat.trans import MoleculeTransformer from molfeat.calc import FPCalculator ``` -------------------------------- ### Install LaminDB Module Plugins Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/lamindb/references/setup-deployment.md Installs additional modules that extend LaminDB's functionality, such as Bionty for biological ontologies, lamindb-wetlab for wet lab operations, and lamindb-clinical for OMOP CDM data. ```bash # Biological ontologies (Bionty) pip install bionty # Wet lab functionality pip install lamindb-wetlab # Clinical data (OMOP CDM) pip install lamindb-clinical ``` -------------------------------- ### CLI Training with PufferLib Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/pufferlib/references/training.md Shows how to initiate training using the PufferLib command-line interface. It includes examples for basic training with specified device and learning rate, as well as custom configurations for batch size, learning rate, and number of iterations. ```bash # Basic training puffer train environment_name --train.device cuda --train.learning-rate 0.001 # Custom configuration puffer train environment_name \ --train.device cuda \ --train.batch-size 32768 \ --train.learning-rate 0.0003 \ --train.num-iterations 10000 ``` -------------------------------- ### Install LaminDB with Optional Extras Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/lamindb/references/setup-deployment.md Installs LaminDB with additional dependencies for specific functionalities like Google Cloud Platform (gcp), Flow Cytometry (fcs), Zarr storage (zarr), or AWS S3 (aws). Multiple extras can be installed together. ```bash # Google Cloud Platform support pip install 'lamindb[gcp]' # Flow cytometry formats pip install 'lamindb[fcs]' # Array storage and streaming (Zarr support) pip install 'lamindb[zarr]' # AWS S3 support (usually included by default) pip install 'lamindb[aws]' # Multiple extras pip install 'lamindb[gcp,zarr,fcs]' ``` -------------------------------- ### Setup Denario Project Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/denario/references/examples.md Initializes a Denario project by creating a directory and instantiating the Denario object. This sets up the environment for subsequent research pipeline steps. ```python from denario import Denario, Journal import os # Create project directory os.makedirs("climate_research", exist_ok=True) den = Denario(project_dir="./climate_research") ``` -------------------------------- ### Benchling Integration - Authentication & Setup Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/benchling-integration/SKILL.md Guides on installing the Benchling Python SDK and setting up authentication using API keys or OAuth client credentials. ```APIDOC ## Benchling Integration - Authentication & Setup ### Description This section details how to install the Benchling Python SDK and configure authentication methods, including API Key and OAuth Client Credentials, for interacting with the Benchling platform. ### Method N/A (SDK Installation and Configuration) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example **Python SDK Installation:** ```python # Stable release uv pip install benchling-sdk # or with Poetry poetry add benchling-sdk ``` **API Key Authentication:** ```python from benchling_sdk.benchling import Benchling from benchling_sdk.auth.api_key_auth import ApiKeyAuth benchling = Benchling( url="https://your-tenant.benchling.com", auth_method=ApiKeyAuth("your_api_key") ) ``` **OAuth Client Credentials:** ```python from benchling_sdk.auth.client_credentials_oauth2 import ClientCredentialsOAuth2 auth_method = ClientCredentialsOAuth2( client_id="your_client_id", client_secret="your_client_secret" ) benchling = Benchling( url="https://your-tenant.benchling.com", auth_method=auth_method ) ``` ### Response #### Success Response (200) N/A (Configuration) #### Response Example N/A ``` -------------------------------- ### Setup and Export DOCX Files with JavaScript/TypeScript Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/document-skills/docx/docx-js.md Installs the 'docx' library and demonstrates how to create and export .docx files using JavaScript. It shows Node.js and browser export methods. Assumes the 'docx' library is installed. ```javascript const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, ImageRun, Media, Header, Footer, AlignmentType, PageOrientation, LevelFormat, ExternalHyperlink, InternalHyperlink, TableOfContents, HeadingLevel, BorderStyle, WidthType, TabStopType, TabStopPosition, UnderlineType, ShadingType, VerticalAlign, SymbolRun, PageNumber, FootnoteReferenceRun, Footnote, PageBreak } = require('docx'); // Create & Save const doc = new Document({ sections: [{ children: [/* content */] }] }); Packer.toBuffer(doc).then(buffer => fs.writeFileSync("doc.docx", buffer)); // Node.js Packer.toBlob(doc).then(blob => { /* download logic */ }); // Browser ``` -------------------------------- ### Manual Multi-Node DDP Setup (Bash) Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/pytorch-lightning/references/distributed_training.md Demonstrates how to manually launch a distributed training script across multiple nodes. Node 0 acts as the master, coordinating the training process with other nodes. Requires specifying the total number of nodes, the rank of the current node, and the master address and port. ```bash python train.py --num_nodes=2 --node_rank=0 --master_addr=192.168.1.1 --master_port=12345 ``` ```bash python train.py --num_nodes=2 --node_rank=1 --master_addr=192.168.1.1 --master_port=12345 ``` -------------------------------- ### Reinstall LiteLLM (Bash) Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/perplexity-search/references/openrouter_setup.md Forcefully reinstalls the LiteLLM package using 'uv pip'. This can resolve issues related to corrupted installations or version conflicts. ```bash uv pip install --force-reinstall litellm ``` -------------------------------- ### Install and Use Google Cirq PennyLane Plugin Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/pennylane/references/devices_backends.md Provides instructions for installing the pennylane-cirq plugin and shows examples of using PennyLane with Cirq simulators, including the faster qsim, and Google's quantum hardware. ```bash # Install plugin uv pip install pennylane-cirq ``` -------------------------------- ### Deploy LaminDB: Multi-Region Strategy Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/lamindb/references/setup-deployment.md Example of deploying LaminDB instances in multiple geographic regions to ensure data sovereignty and reduce latency for users in different locations. ```bash # US instance lamin init --storage s3://us-bucket/data \ --db postgresql://user:pwd@us-db:5432/db \ --name us-production # EU instance lamin init --storage s3://eu-bucket/data \ --db postgresql://user:pwd@eu-db:5432/db \ --name eu-production ``` -------------------------------- ### Programmatic Usage of Denario Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/denario/references/installation.md Example of how to use the Denario library directly within Python scripts. It demonstrates initializing the Denario object with a project directory, preparing for further workflow operations. ```python from denario import Denario den = Denario(project_dir="./my_project") # Continue with workflow... ``` -------------------------------- ### Basic FSDP Trainer Setup (PyTorch Lightning) Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/pytorch-lightning/references/distributed_training.md Shows the basic initialization of a PyTorch Lightning Trainer using the Fully Sharded Data Parallel (FSDP) strategy for distributed training on GPUs. ```python trainer = L.Trainer( strategy="fsdp", accelerator="gpu", devices=4 ) ``` -------------------------------- ### Define a Quantum Node (QNode) with PennyLane Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/pennylane/references/getting_started.md Demonstrates how to define a QNode, which combines a quantum circuit with a quantum device. This example uses the 'default.qubit' simulator and returns an expectation value. ```python import pennylane as qml # Define a device dev = qml.device('default.qubit', wires=2) # Create a QNode @qml.qnode(dev) def circuit(params): qml.RX(params[0], wires=0) qml.RY(params[1], wires=1) qml.CNOT(wires=[0, 1]) return qml.expval(qml.PauliZ(0)) ``` -------------------------------- ### Install Scikit-learn using uv Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/scikit-learn/references/quick_reference.md This snippet shows how to install the scikit-learn library using the `uv` package installer, which is recommended. It also includes commands for installing optional dependencies like plotting utilities and common companion libraries such as pandas, numpy, and matplotlib. ```bash # Using uv (recommended) uv pip install scikit-learn # Optional dependencies uv pip install scikit-learn[plots] # For plotting utilities uv pip install pandas numpy matplotlib seaborn # Common companions ``` -------------------------------- ### Launch Denario Application (CLI) Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/denario/references/installation.md Command to launch the Denario graphical user interface (GUI) from the command line. This typically starts a web-based Streamlit application for interactive workflow management. ```bash denario run ``` -------------------------------- ### Quick Start: Simulate Quantum State Evolution with QuTiP Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qutip/SKILL.md Demonstrates a basic quantum simulation using QuTiP. It initializes a quantum state, defines a Hamiltonian, performs time evolution using sesolve, and plots the expectation value of an operator. ```python from qutip import * import numpy as np import matplotlib.pyplot as plt # Create quantum state psi = basis(2, 0) # |0⟩ state # Create operator H = sigmaz() # Hamiltonian # Time evolution tlist = np.linspace(0, 10, 100) result = sesolve(H, psi, tlist, e_ops=[sigmaz()]) # Plot results plt.plot(tlist, result.expect[0]) plt.xlabel('Time') plt.ylabel('⟨σz⟩') plt.show() ``` -------------------------------- ### Install Molfeat using Conda or Pip Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/molfeat/references/examples.md Instructions for installing the molfeat library. It recommends using conda/mamba for a streamlined installation with dependencies, provides a pip alternative, and shows how to install with optional dependencies for specific model types like GNNs, Graphormer, or transformers. ```bash # Recommended: Using conda/mamba mamba install -c conda-forge molfeat # Alternative: Using pip pip install molfeat # With all optional dependencies pip install "molfeat[all]" # With specific dependencies pip install "molfeat[dgl]" # For GNN models pip install "molfeat[graphormer]" # For Graphormer pip install "molfeat[transformer]" # For ChemBERTa, ChemGPT ``` -------------------------------- ### CrossRef API Basic DOI Lookup Request Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/citation-management/references/metadata_extraction.md An example HTTP GET request to the CrossRef API to retrieve metadata for a specific DOI. The CrossRef API is a primary source for DOI metadata. ```http GET https://api.crossref.org/works/10.1038/s41586-021-03819-2 ``` -------------------------------- ### Python Package Installation Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/drugbank-database/references/data-access.md Guide to installing the `drugbank-downloader` Python package and its optional dependencies. ```APIDOC ## Python Package Installation ### drugbank-downloader Primary tool for programmatic access: ```bash pip install drugbank-downloader ``` **Requirements:** Python >=3.9 ### Optional Dependencies ```bash pip install bioversions # For automatic latest version detection pip install lxml # For XML parsing optimization ``` ``` -------------------------------- ### Install QuTiP and Optional Packages Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qutip/SKILL.md Installs the QuTiP library using 'uv pip'. Optionally installs 'qutip-qip' for quantum information processing and 'qutip-qtrl' for quantum trajectory viewing. ```bash uv pip install qutip # Quantum information processing (circuits, gates) uv pip install qutip-qip # Quantum trajectory viewer uv pip install qutip-qtrl ``` -------------------------------- ### Create and Activate Python Virtual Environment Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qiskit/references/setup.md Sets up an isolated Python environment using the venv module. This is crucial for managing project dependencies separately. Activation commands differ for macOS/Linux and Windows. ```bash # macOS/Linux python3 -m venv .venv source .venv/bin/activate # Windows python -m venv .venv .venv\Scripts\activate ``` -------------------------------- ### Install Molfeat with All Dependencies Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/molfeat/references/available_featurizers.md This command installs the Molfeat library along with all its optional dependencies. This is a convenient way to ensure all features and models are available for use. ```bash pip install "molfeat[all]" ``` -------------------------------- ### Basic DeepSpeed Training Setup Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/pytorch-lightning/references/distributed_training.md Configure the Trainer to use DeepSpeed with specified stages and precision. This example shows setting up for DeepSpeed Stage 2 or Stage 3 with 16-bit mixed precision. ```python trainer = L.Trainer( strategy="deepspeed_stage_2", # or "deepspeed_stage_3" accelerator="gpu", devices=4, precision="16-mixed" ) ``` -------------------------------- ### Complete Presentation Creation Example in JavaScript Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/document-skills/pptx/html2pptx.md A comprehensive example showing the entire workflow: initializing PptxGenJS, using html2pptx to create slides from HTML files, adding a chart to a slide using placeholders, and saving the final presentation. ```javascript const pptxgen = require('pptxgenjs'); const html2pptx = require('./html2pptx'); async function createPresentation() { const pptx = new pptxgen(); pptx.layout = 'LAYOUT_16x9'; pptx.author = 'Your Name'; pptx.title = 'My Presentation'; // Slide 1: Title const { slide: slide1 } = await html2pptx('slides/title.html', pptx); // Slide 2: Content with chart const { slide: slide2, placeholders } = await html2pptx('slides/data.html', pptx); const chartData = [{ name: 'Sales', labels: ['Q1', 'Q2', 'Q3', 'Q4'], values: [4500, 5500, 6200, 7100] }]; slide2.addChart(pptx.charts.BAR, chartData, { ...placeholders[0], showTitle: true, title: 'Quarterly Sales', showCatAxisTitle: true, catAxisTitle: 'Quarter', showValAxisTitle: true, valAxisTitle: 'Sales ($000s)' }); // Save await pptx.writeFile({ fileName: 'presentation.pptx' }); console.log('Presentation created successfully!'); } createPresentation().catch(console.error); ``` -------------------------------- ### SimPy Resource Monitoring Setup Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/simpy/SKILL.md Shows how to set up resource monitoring in SimPy using a hypothetical `ResourceMonitor` class. This involves creating a resource, instantiating the monitor, and later reporting the collected metrics. ```python from scripts.resource_monitor import ResourceMonitor # Create and monitor resource resource = simpy.Resource(env, capacity=2) monitor = ResourceMonitor(env, resource, "Server") # After simulation monitor.report() ``` -------------------------------- ### Set IBM Quantum Token via Environment Variable Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qiskit/references/setup.md Configures authentication for Qiskit by setting the IBM Quantum API token as an environment variable. This method avoids hardcoding the token directly in the script. ```bash export QISKIT_IBM_TOKEN="YOUR_IBM_QUANTUM_TOKEN" ``` -------------------------------- ### Test Transpilation with Local Simulator Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qiskit/references/transpilation.md This example demonstrates how to test quantum circuit transpilation locally using `AerSimulator`. By creating a simulator backend from a real backend, you can verify transpilation results and performance without consuming cloud resources. The `optimization_level` parameter can be adjusted for performance tuning. ```python from qiskit_aer import AerSimulator # Test transpilation locally sim_backend = AerSimulator.from_backend(backend) nc_test = transpile(qc, backend=sim_backend, optimization_level=3) ``` -------------------------------- ### Load .env File with Python Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/perplexity-search/references/openrouter_setup.md Demonstrates how to load environment variables, including OPENROUTER_API_KEY, from a .env file using the python-dotenv library in a Python script. Requires 'pip install python-dotenv'. ```python from dotenv import load_dotenv load_dotenv() # Loads .env file automatically import os api_key = os.environ.get("OPENROUTER_API_KEY") ``` -------------------------------- ### Parameterized Quantum Circuits in PennyLane Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/pennylane/references/getting_started.md Defines a parameterized quantum circuit where both input data and trainable parameters are used. This example encodes data `x` and then applies parameterized layers using RY gates and CNOTs. ```python @qml.qnode(dev) def parameterized_circuit(params, x): # Encode data qml.RX(x, wires=0) # Apply parameterized layers for param in params: qml.RY(param, wires=0) qml.CNOT(wires=[0, 1]) return qml.expval(qml.PauliZ(0)) ``` -------------------------------- ### Device-Independent Quantum Circuits in PennyLane Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/pennylane/references/getting_started.md Illustrates how to write quantum circuits that can be run on different backends (simulators or hardware) without modification. The example shows the same circuit definition applied to both a simulator and a hypothetical hardware device. ```python # Same circuit, different backends @qml.qnode(qml.device('default.qubit', wires=2)) def circuit_simulator(x): qml.RX(x, wires=0) return qml.expval(qml.PauliZ(0)) # Switch to hardware (if available) @qml.qnode(qml.device('qiskit.ibmq', wires=2)) def circuit_hardware(x): qml.RX(x, wires=0) return qml.expval(qml.PauliZ(0)) ``` -------------------------------- ### Basic HEOM Setup and Time Evolution in Python Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qutip/references/advanced.md Sets up and runs the Hierarchical Equations of Motion (HEOM) solver for non-Markovian open quantum systems. Requires QuTiP. This example demonstrates a single bath with an exponential correlation function. Inputs include system Hamiltonian, bath definition, initial state, and time list. Outputs are the time-evolved system density matrices. ```python from qutip import heom # System Hamiltonian H_sys = sigmaz() # Bath correlation function (exponential) Q = sigmax() # System-bath coupling operator ck_real = [0.1] # Coupling strengths vk_real = [0.5] # Bath frequencies # HEOM bath bath = heom.BosonicBath(Q, ck_real, vk_real) # Initial state rho0 = basis(2, 0) * basis(2, 0).dag() # Create HEOM solver max_depth = 5 hsolver = heom.HEOMSolver(H_sys, [bath], max_depth=max_depth) # Time evolution tlist = np.linspace(0, 10, 100) result = hsolver.run(rho0, tlist) # Extract reduced system density matrix rho_sys = [r.extract_state(0) for r in result.states] ``` -------------------------------- ### Error Handling: Check for Resolution Candidates Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/datacommons-client/references/getting_started.md Provides an example of robust error handling when resolving names to DCIDs. It checks if any candidates were found and suggests handling cases where no matches or multiple ambiguous matches occur. ```python client = DataCommonsClient() # Always check for candidates resolve_response = client.resolve.fetch_dcids_by_name(names=["Unknown Place"]) result = resolve_response.to_dict()["Unknown Place"] if not result["candidates"]: print("No matches found - try a more specific name") # Handle error appropriately else: dcid = result["candidates"][0]["dcid"] # Proceed with query # Check for multiple candidates (ambiguity) if len(result["candidates"]) > 1: print(f"Multiple matches found: {len(result['candidates'])}") for candidate in result["candidates"]: print(f" {candidate['dcid']} ({candidate.get('dominantType', 'N/A')})") # Let user select or use additional filtering ``` -------------------------------- ### Configure IBM Quantum Account Authentication Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qiskit/references/setup.md Saves IBM Quantum credentials for accessing IBM hardware. The `save_account` method stores the token, and subsequent sessions can load it using `QiskitRuntimeService()`. An alternative is to use an environment variable. ```python from qiskit_ibm_runtime import QiskitRuntimeService # Save credentials (first time only) QiskitRuntimeService.save_account( channel="ibm_quantum", token="YOUR_IBM_QUANTUM_TOKEN" ) # Later sessions - load saved credentials service = QiskitRuntimeService() ``` -------------------------------- ### Qiskit Development: Parameter Initialization Strategies Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qiskit/references/algorithms.md Discusses best practices for parameter initialization in Qiskit. It suggests using problem-specific initialization when possible, provides an example of random initialization using numpy, and mentions the possibility of using classical preprocessing results to set initial parameters. ```python import numpy as np # Assuming 'num_params' is defined # Use problem-specific initialization when possible # Random initialization initial_params = np.random.uniform(0, 2*np.pi, num_params) # Or use classical preprocessing # initial_params = classical_solution_to_params(classical_result) ``` -------------------------------- ### Install FluidSim Basic (Bash) Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/fluidsim/references/installation.md Installs the basic FluidSim package using the 'uv pip' command. This is the simplest installation method and does not include optional dependencies. ```bash uv pip install fluidsim ``` -------------------------------- ### QuTiP: Simulate Time Evolution with Different Solvers Source: https://github.com/k-dense-ai/claude-scientific-skills/blob/main/scientific-skills/qutip/SKILL.md Illustrates QuTiP's time evolution solvers for closed (sesolve) and open (mesolve, mcsolve) quantum systems. It shows how to define Hamiltonians, initial states, collapse operators, and expectation operators. ```python # Closed systems (unitary evolution) result = sesolve(H, psi0, tlist, e_ops=[num(N)]) # Open systems (dissipation) c_ops = [np.sqrt(0.1) * destroy(N)] # Collapse operators result = mesolve(H, psi0, tlist, c_ops, e_ops=[num(N)]) # Quantum trajectories (Monte Carlo) result = mcsolve(H, psi0, tlist, c_ops, ntraj=500, e_ops=[num(N)]) ```