#![allow(clippy::pedantic, clippy::assertions_on_constants)]
#[test]
fn test_core_always_available() {
use quantrs2::core;
let _q = core::qubit::QubitId::new(0);
}
#[cfg(feature = "circuit")]
#[test]
fn test_circuit_feature() {
use quantrs2::circuit;
use quantrs2::prelude::circuits::*;
let _circuit = Circuit::<2>::new();
let _q = QubitId::new(0);
}
#[cfg(not(feature = "circuit"))]
#[test]
fn test_circuit_not_available() {
}
#[cfg(feature = "sim")]
#[test]
fn test_sim_feature() {
use quantrs2::prelude::simulation::*;
use quantrs2::sim;
let _simulator = StateVectorSimulator::new();
let _circuit = Circuit::<2>::new();
}
#[cfg(feature = "ml")]
#[test]
fn test_ml_feature() {
use quantrs2::ml;
use quantrs2::prelude::algorithms::*;
}
#[cfg(feature = "anneal")]
#[test]
fn test_anneal_feature() {
use quantrs2::anneal;
use quantrs2::prelude::quantum_annealing::*;
}
#[cfg(feature = "tytan")]
#[test]
fn test_tytan_feature() {
use quantrs2::prelude::tytan::*;
use quantrs2::tytan;
}
#[cfg(feature = "device")]
#[test]
fn test_device_feature() {
use quantrs2::device;
use quantrs2::prelude::hardware::*;
}
#[cfg(feature = "symengine")]
#[test]
fn test_symengine_feature() {
use quantrs2::symengine;
}
#[test]
fn test_essentials_prelude_always_works() {
use quantrs2::prelude::essentials::*;
let _q = QubitId::new(0);
assert!(!VERSION.is_empty());
}
#[test]
fn test_full_prelude_includes_available_features() {
use quantrs2::prelude::full::*;
let _q = QubitId::new(0);
#[cfg(feature = "circuit")]
{
let _circuit = Circuit::<2>::new();
}
#[cfg(feature = "sim")]
{
let _simulator = StateVectorSimulator::new();
}
}
#[cfg(all(feature = "circuit", feature = "sim"))]
#[test]
fn test_circuit_sim_integration() {
use quantrs2::prelude::simulation::*;
let mut circuit = Circuit::<2>::new();
circuit.h(QubitId::new(0)).unwrap();
circuit.cnot(QubitId::new(0), QubitId::new(1)).unwrap();
let simulator = StateVectorSimulator::new();
}
#[cfg(all(feature = "sim", feature = "ml"))]
#[test]
fn test_sim_ml_integration() {
use quantrs2::prelude::algorithms::*;
}
#[cfg(all(feature = "anneal", feature = "tytan"))]
#[test]
fn test_anneal_tytan_integration() {
use quantrs2::prelude::tytan::*;
}
#[test]
fn test_feature_dependencies() {
#[cfg(feature = "sim")]
{
#[cfg(not(feature = "circuit"))]
compile_error!("sim feature requires circuit feature");
}
#[cfg(feature = "tytan")]
{
#[cfg(not(feature = "anneal"))]
compile_error!("tytan feature requires anneal feature");
}
#[cfg(feature = "ml")]
{
#[cfg(not(feature = "sim"))]
compile_error!("ml feature requires sim feature");
#[cfg(not(feature = "anneal"))]
compile_error!("ml feature requires anneal feature");
}
}