Quantum computing tasks require specialized knowledge of circuit design and optimization. PennyLane provides a unified interface for building, training, and executing quantum circuits with automatic differentiation across simulators and real hardware.
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「pennylane」。 Create a simple variational quantum classifier that classifies two-dimensional data points
預期結果:
- Define a 2-qubit device with default.qubit backend
- Build a QNode with angle encoding for input features
- Create variational layers with trainable weights
- Use expectation value of PauliZ as classification output
- Train with GradientDescentOptimizer minimizing mean squared error
- Evaluate accuracy on training and test datasets
正在使用「pennylane」。 Show me how to run VQE for H2 molecule
預期結果:
- Import qchem module and define atomic coordinates for H2
- Build molecular Hamiltonian using qchem.molecular_hamiltonian
- Initialize Hartree-Fock state for the molecule
- Create VQE ansatz with UCCSD (unitary coupled cluster) template
- Run optimization loop using AdamOptimizer
- Extract ground state energy in Hartree units
正在使用「pennylane」。 How do I switch between simulator and real quantum hardware
預期結果:
- Define your quantum circuit as a function accepting a device parameter
- Create simulator device: qml.device('default.qubit', wires=4)
- Create hardware device: qml.device('qiskit.ibmq', wires=4, backend='ibmq_manila')
- Pass the device to your QNode decorator
- Circuit code remains identical - only the execution backend changes
- Use parameter-shift rule for gradients on hardware (backprop only works on simulators)
安全審計
安全Pure documentation skill containing educational Python code examples for quantum computing workflows. All 419 static findings are false positives: code examples in markdown files are documentation, not executable code. The skill has no scripts, no network calls, no file system access, and no real credentials. The api_key placeholders are documentation examples, not actual secrets. Quantum computing algorithms flagged as 'weak crypto' are legitimate scientific computing patterns.
風險因素
⚙️ 外部命令 (354)
🌐 網路存取 (10)
品質評分
你能建構什麼
Quantum chemistry simulations
Calculate molecular ground state energies using VQE with UCCSD ansatz for drug discovery research
Hybrid quantum-classical models
Build variational classifiers combining quantum circuits with PyTorch or TensorFlow layers
Optimization algorithms
Implement QAOA for combinatorial optimization problems like MaxCut on graphs
試試這些提示
Show me how to create a 2-qubit quantum circuit in PennyLane that applies RX and RY rotations then measures PauliZ on qubit 0
Write a PennyLane script to compute the ground state energy of H2 molecule using VQE with Adam optimizer
Create a hybrid quantum-classical classifier in PennyLane that integrates with PyTorch for training on a dataset
Show how to execute a PennyLane circuit on IBM Quantum hardware using the qiskit.ibmq device with parameter-shift gradients
最佳實務
- Start with simulators before deploying to quantum hardware
- Use parameter-shift rule for gradient computation on hardware
- Initialize parameters carefully to avoid barren plateaus
- Cache device objects to reduce initialization overhead
避免
- Using backpropagation on quantum hardware (only works on simulators)
- Skipping circuit validation on simulators before hardware execution
- Using too many qubits beyond simulator capacity
- Ignoring noise models when simulating hardware behavior