
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
github.com/kegliz/qcm
QCM is a modern, high-performance quantum circuit manager and simulator written in Go. It provides an intuitive fluent API for building quantum circuits, supports multiple quantum simulation backends through a plugin architecture, and includes advanced features like circuit visualization and performance optimization.
go get github.com/kegliz/qcm@v0.2.0
package main
import (
"fmt"
"log"
"github.com/kegliz/qcm/qc/builder"
"github.com/kegliz/qcm/qc/simulator"
// Import quantum backend plugins
_ "github.com/kegliz/qcm/qc/simulator/itsu"
)
func main() {
// Create a Bell state circuit
circuit := builder.New(builder.Q(2), builder.C(2)).
H(0). // Apply Hadamard to qubit 0
CNOT(0, 1). // Apply CNOT with control=0, target=1
Measure(0, 0). // Measure qubit 0 to classical bit 0
Measure(1, 1) // Measure qubit 1 to classical bit 1
// Build the circuit
circ, err := circuit.BuildCircuit()
if err != nil {
log.Fatal(err)
}
// Create and run simulator
sim, err := simulator.NewSimulatorWithDefaults("itsu")
if err != nil {
log.Fatal(err)
}
// Override default settings if needed
sim.Shots = 1024
results, err := sim.Run(circ)
if err != nil {
log.Fatal(err)
}
// Display results
for state, count := range results {
fmt.Printf("|%s⟩: %d shots (%.2f%%)\n",
state, count, float64(count)/1024*100)
}
}
QCM features a flexible plugin architecture that allows different quantum simulation backends to be registered and used interchangeably:
// Available backends
_ "github.com/kegliz/qcm/qc/simulator/itsu" // itsubaki/q backend
_ "github.com/kegliz/qcm/qc/simulator/qsim" // Custom optimized backend
Generate PNG visualizations of your quantum circuits:
import "github.com/kegliz/qcm/qc/renderer"
// Render circuit to PNG
err := renderer.SaveToPNG(circuit, "my_circuit.png",
renderer.WithTitle("Bell State Circuit"))
QCM includes several performance optimization features:
// Search for |11⟩ state using 2-qubit Grover's algorithm
circuit := builder.New(builder.Q(2), builder.C(2)).
H(0).H(1). // Initialize superposition
Z(0).Z(1).CNOT(0,1).Z(1).CNOT(0,1). // Oracle for |11⟩
H(0).H(1).Z(0).Z(1).CNOT(0,1).Z(1).CNOT(0,1).H(0).H(1). // Diffusion
Measure(0, 0).Measure(1, 1)
circ, _ := circuit.BuildCircuit()
sim, _ := simulator.NewSimulatorWithDefaults("itsu")
sim.Shots = 1024
results, _ := sim.Run(circ)
// Demonstrate Z-gate effect with Hadamard sandwich
circuit := builder.New(builder.Q(1), builder.C(1)).
H(0). // Create |+⟩ state
Z(0). // Apply Z-gate
H(0). // Convert back to computational basis
Measure(0, 0) // Should show bit flip compared to H-H
circ, _ := circuit.BuildCircuit()
QCM includes built-in performance benchmarking tools to compare different backends:
go run cmd/perf-comp/performance-comparison.go
Example benchmark results:
Backend Performance Comparison (1000 shots each)
================================================
Circuit: 4-qubit Grover
- itsu backend: 245.2ms ± 12.3ms
- qsim backend: 189.7ms ± 8.9ms (22.6% faster)
Circuit: Bell State
- itsu backend: 45.1ms ± 2.1ms
- qsim backend: 38.4ms ± 1.8ms (14.9% faster)
QCM provides several command-line tools:
# Run example simulations
go run cmd/cli/main.go
# Performance comparison between backends
go run cmd/perf-comp/performance-comparison.go
# Plugin demonstration
go run cmd/plugin-demo/main.go
Run the complete test suite:
go test ./...
Run benchmarks:
go test -bench=. ./...
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
If you use QCM in your research, please cite:
@software{qcm2025,
author = {kegliz},
title = {QCM: Quantum Circuit Manager},
url = {https://github.com/kegliz/qcm},
version = {0.2.0},
year = {2025}
}
Made with ❤️ for the quantum computing community
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.