File size: 4,296 Bytes
ffb005a
 
 
 
 
 
 
 
 
 
 
c302d52
 
 
 
 
 
ffb005a
 
c302d52
ffb005a
 
 
c302d52
 
ffb005a
c302d52
ffb005a
c302d52
 
 
ffb005a
 
 
 
 
 
c302d52
 
 
 
ffb005a
c302d52
ffb005a
c302d52
 
 
 
ffb005a
 
 
c302d52
 
ffb005a
 
 
 
 
5824c54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c302d52
ffb005a
5824c54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ffb005a
c302d52
ffb005a
5824c54
ffb005a
c302d52
ffb005a
c302d52
 
 
 
 
ffb005a
c302d52
ffb005a
870a039
 
ffb005a
c302d52
ffb005a
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
base_model: unsloth/Qwen3-1.7B
library_name: peft
pipeline_tag: text-generation
tags:
- base_model:adapter:unsloth/Qwen3-1.7B
- lora
- sft
- transformers
- trl
- unsloth
- Quantum
license: mit
datasets:
- moremilk/CoT_Reasoning_Quantom_Physics_And_Computing
language:
- en
---

# 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
from peft import PeftModel


tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen3-1.7B",)
base_model = AutoModelForCausalLM.from_pretrained(
    "unsloth/Qwen3-1.7B",
    device_map={"": 0}
)

model = PeftModel.from_pretrained(base_model,"khazarai/Quantum-ToT")

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),
)
```

**For pipeline:**

```python
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen3-1.7B")
base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3-1.7B")
model = PeftModel.from_pretrained(base_model, "khazarai/Quantum-ToT")

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

pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
messages = [
    {"role": "user", "content": question}
]
pipe(messages)
```

### 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.

### Framework versions

- PEFT 0.16.0