소스 정보
- 저장소
- ffsshhttiikk/opencode-agents-skills
- 최근 소스 활동
- 2026년 2월 28일 22:54
- 감지된 SKILL.md 언어
- 영어
- 스타
- 2
- 포크
- 2
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/ffsshhttiikk/opencode-agents-skills --skill quantum-computing명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | quantum-computing |
| description | Quantum computing concepts and NeuralBlitz quantum neuron implementation |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"developers","category":"domain-specific"} |
When working with the NeuralBlitz quantum computing components or implementing quantum-inspired algorithms.
import numpy as np
from typing import Optional, Tuple
from scipy.linalg import expm
class QuantumState:
"""
Quantum state vector in Hilbert space.
The state is represented as a normalized complex vector.
For n qubits, the state space has dimension 2^n.
"""
def __init__(self, num_qubits: int) -> None:
"""
Initialize quantum state to |0⟩^n.
Args:
num_qubits: Number of qubits (must be positive integer)
"""
self.num_qubits = num_qubits
self.dim = 2 ** num_qubits
self.state = np.zeros(self.dim, dtype=complex)
self.state[0] = 1.0 # |0⟩ state
@property
def data(self) -> np.ndarray:
"""Return the state vector (read-only view)."""
return self.state.copy()
def normalize(self) -> None:
"""Normalize state vector to unit length."""
norm = np.linalg.norm(self.state)
if norm > 0:
self.state /= norm
def measure(self) -> int:
"""
Measure state in computational basis.
Returns:
Measured basis state index with probability = |<x|ψ⟩|²
"""
probs = np.abs(self.state) ** 2
probs /= probs.sum()
return np.random.choice(len(self.state), p=probabilities)
def fidelity(self, other: 'QuantumState') -> float:
"""
Calculate fidelity between two quantum states.
Fidelity = |⟨ψ|φ⟩|² for pure states.
Args:
other: Another quantum state to compare
Returns:
Fidelity value between 0 and 1
"""
overlap = np.vdot(self.state, other.state)
return np.abs(overlap) ** 2
class QuantumGate:
"""Quantum gate operations on state vectors."""
@staticmethod
def hadamard(num_qubits: int, target: int) -> np.ndarray:
"""
Create Hadamard gate for superposition.
H|0⟩ = (|0⟩ + |1⟩)/√2
H|1⟩ = (|0⟩ - |1⟩)/√2
"""
H = np.array([[1, 1], [1, -1]]) / np.sqrt(2)
return QuantumGate.expand_gate(H, num_qubits, target)
@staticmethod
def pauli_x(num_qubits: int, target: int) -> np.ndarray:
"""Pauli-X (NOT) gate: |0⟩→|1⟩, |1⟩→|0⟩"""
X = np.array([[0, 1], [1, 0]])
return QuantumGate.expand_gate(X, num_qubits, target)
@staticmethod
def pauli_z(num_qubits: int, target: int) -> np.ndarray:
"""Pauli-Z gate: |1⟩→-|1⟩, |0⟩→|0⟩"""
Z = np.array([[1, 0], [0, -1]])
return QuantumGate.expand_gate(Z, num_qubits, target)
@staticmethod
def cnot(num_qubits: int, control: int, target: ) -> np.ndarray:
dim = ** num_qubits
matrix = np.eye(dim, dtype=)
i (dim):
(i >> control) & (i >> target) & :
j = i | ( << target)
k = i & ~( << target)
matrix[j, i] =
matrix[k, i] =
matrix
() -> np.ndarray:
RZ = np.array([
[np.exp(- * angle / ), ],
[, np.exp( * angle / )]
])
QuantumGate.expand_gate(RZ, num_qubits, target)
() -> np.ndarray:
dim = ** num_qubits
target < target >= num_qubits:
ValueError()
result = np.eye(, dtype=)
i (num_qubits):
i == target:
result = np.kron(result, gate)
:
result = np.kron(result, np.eye(, dtype=))
result
class QuantumSpikingNeuron:
"""
Quantum-inspired spiking neuron model.
Combines quantum mechanics with spiking neural network principles:
- Quantum superposition for input integration
- Quantum tunneling for spike generation
- Coherence time limiting neural activity
"""
def __init__(
self,
num_qubits: int = 4,
coherence_time: float = 100.0,
tunneling: float = 0.1,
threshold: float = 0.5,
) -> None:
self.num_qubits = num_qubits
self.coherence_time = coherence_time
self.tunneling = tunneling
self.threshold = threshold
self.state = QuantumState(num_qubits)
self.weights = np.random.randn(num_qubits) * 0.1
self.spike_history: list[float] = []
self.last_update: float = 0.0
def evolve(
self,
inputs: np.ndarray,
dt: float,
hamiltonian: Optional[np.ndarray] = None
) -> Tuple[np.ndarray, bool]:
"""
Evolve quantum state and potentially spike.
Args:
inputs: Input currents from connected neurons
dt: Time step in milliseconds
hamiltonian: Optional custom Hamiltonian matrix
Returns:
Tuple of (output_state, did_spike)
"""
(inputs) != .num_qubits:
ValueError()
.last_update = dt
hamiltonian :
hamiltonian = np.diag(-.weights * inputs)
evolution = expm(- * hamiltonian * dt)
.state.state = evolution @ .state.state
spike_probability = ._calculate_spike_probability()
should_spike = np.random.random() < spike_probability
should_spike:
._emit_spike()
.state.state,
.state.state,
() -> :
excited_prob = np.(np.(.state.state[ ** (.num_qubits - ):]) ** )
coherence_factor = np.exp(-.last_update / .coherence_time)
excited_prob * .tunneling * coherence_factor
() -> :
.spike_history.append(.last_update)
.state = QuantumState(.num_qubits)
._refractory_timer =
() -> :
np.(
np.arange( ** .num_qubits) *
np.(.state.state) **
)
class MultiRealityNetwork:
"""
Network that spans multiple parallel realities.
Each reality maintains its own quantum state,
and entanglement allows correlation between realities.
"""
def __init__(
self,
num_realities: int = 4,
neurons_per_reality: int = 20,
entanglement_strength: float = 0.1,
) -> None:
self.num_realities = num_realities
self.neurons_per_reality = neurons_per_reality
self.entanglement_strength = entanglement_strength
self.neurons: list[list[QuantumSpikingNeuron]] = []
self.entanglement_matrix: np.ndarray
self._initialize_network()
def _initialize_network(self) -> None:
"""Initialize neurons in each reality."""
for r in range(self.num_realities):
reality_neurons = [
QuantumSpikingNeuron(
num_qubits=4,
coherence_time=100.0,
tunneling=0.1,
)
for _ in range(self.neurons_per_reality)
]
self.neurons.append(reality_neurons)
self.entanglement_matrix = np.eye(.num_realities)
() -> [[]]:
spike_matrix = []
r (.num_realities):
reality_spikes = []
neuron .neurons[r]:
inputs = ._get_inputs(r, neuron)
_, spiked = neuron.evolve(inputs, dt)
reality_spikes.append(spiked)
spike_matrix.append(reality_spikes)
._apply_entanglement(spike_matrix)
spike_matrix
() -> np.ndarray:
inputs = np.zeros(target_neuron.num_qubits)
i, neuron (.neurons[reality]):
neuron target_neuron:
inputs[i] = neuron.get_membrane_potential()
inputs
() -> :
spike_array = np.array(spike_matrix)
i (.num_realities):
j (i + , .num_realities):
correlation = .entanglement_matrix[i, j]
correlation > :
._entangle_realities(
spike_array[i],
spike_array[j],
correlation
)
() -> :
agreement = np.(spikes_a == spikes_b) / (spikes_a)
agreement > :
adjustment = strength * ( - agreement)
agreement < :
adjustment = -strength * ( - agreement)
:
adjustment =
.entanglement_matrix = np.clip(
.entanglement_matrix + adjustment * ,
,
)