---
library_name: transformers
tags:
- Physics
- Quantum
- reasoning
- unsloth
- sft
- lora
license: apache-2.0
datasets:
- mattwesney/CoT_Reasoning_Quantom_Physics_And_Computing
language:
- en
base_model:
- unsloth/Qwen3-1.7B
pipeline_tag: text-generation
---

# Quantum-ToT

## Model Details

Quantum-ToT is a fine-tuned variant of Qwen3-1.7B, optimized for Chain-of-Thought (CoT) reasoning in quantum mechanics and quantum computing contexts.
This model was trained using the [moremilk/CoT_Reasoning_Quantum_Physics_And_Computing](https://huggingface.co/datasets/moremilk/CoT_Reasoning_Quantom_Physics_And_Computing) dataset — a curated collection of question–answer pairs that go beyond surface-level definitions to show the logical reasoning process behind quantum concepts.

The goal of this fine-tuning is to enhance the model’s ability to:

- Explain quantum principles with structured, step-by-step logic
- Reason through conceptual problems in quantum physics and computing
- Support educational and research applications that require interpretable reasoning chains


## Uses

### Direct Use

- Educational assistance in quantum physics and quantum computing
- AI tutors or reasoning assistants for STEM learning
- Conceptual reasoning benchmarks involving quantum phenomena
- Research in reasoning-aware model behavior and CoT interpretability

### Out of Scope  

- Predicting new or unverified physical phenomena
- Running quantum simulations or algorithmic derivations
- Hardware-level quantum design
- Real-time physics predictions

## Bias, Risks, and Limitations

- May hallucinate if prompted outside the quantum domain
- Not suitable for advanced quantum algorithm design or experimental predictions

## How to Get Started with the Model

Use the code below to get started with the model.

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("khazarai/Quantum-ToT")
model = AutoModelForCausalLM.from_pretrained(
    "khazarai/Quantum-ToT",
    device_map={"": 0}
)

question = """
Explain the Heisenberg Uncertainty Principle in detail, including its mathematical formulation, physical implications, and common misconceptions.
"""

messages = [
    {"role" : "user", "content" : question}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize = False,
    add_generation_prompt = True,
    enable_thinking = True,
)

from transformers import TextStreamer
_ = model.generate(
    **tokenizer(text, return_tensors = "pt").to("cuda"),
    max_new_tokens = 3000, 
    temperature = 0.6,
    top_p = 0.95,
    top_k = 20,
    streamer = TextStreamer(tokenizer, skip_prompt = True),
)
```

### Dataset

Dataset: [moremilk/CoT_Reasoning_Quantum_Physics_And_Computing](https://huggingface.co/datasets/moremilk/CoT_Reasoning_Quantom_Physics_And_Computing)

This dataset contains rich reasoning-based question–answer pairs covering:

- Core quantum principles: superposition, entanglement, measurement
- Effects of quantum gates (Hadamard, Pauli-X/Y/Z, etc.) on qubits
- Multi-qubit reasoning (e.g., Bell states, entangled systems)
- Basic quantum algorithms and logical operations
- Probabilistic interpretation of measurement outcomes

Each entry includes:

- think block → model’s internal reasoning process
- answer block → final concise explanation or solution

The dataset focuses on conceptual understanding rather than heavy mathematical derivations or complex quantum hardware design.