> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/vi/theo-linh-vuc/04-molecular-orbital-diagrams.md).

# Sơ đồ orbital phân tử

Bài viết này cung cấp phần giới thiệu ngắn gọn về việc tạo [các sơ đồ obitan phân tử](https://en.wikipedia.org/wiki/Molecular_orbital_diagram) trong LaTeX bằng [`modiagram` gói](https://ctan.org/pkg/modiagram?lang=en). Bạn đọc được khuyến khích mạnh mẽ tham khảo [`modiagram` tài liệu gói](http://mirrors.ctan.org/macros/latex/contrib/modiagram/modiagram_en.pdf) tài liệu, trong đó chứa rất nhiều ví dụ hữu ích để minh họa nhiều tính năng của nó—nhiều hơn những gì chúng tôi có thể đề cập trong bài viết ngắn này.

Để biết thông tin về các *sơ đồ cấu trúc phân tử* truyền thống hơn, hãy xem tài liệu của chúng tôi về [công thức hóa học](/latex/vi/theo-linh-vuc/02-chemistry-formulae.md).

## Giới thiệu

Các sơ đồ phân tử được tạo bằng [`modiagram` gói](https://ctan.org/pkg/modiagram?lang=en) gói này, mà bạn nhập vào tài liệu bằng cách thêm dòng sau vào phần mở đầu:

`\usepackage{modiagram}`\[$$\langle$$`tùy chọn`$$\rangle$$]

Bộ $$\langle$$`tùy chọn`$$\rangle$$ được liệt kê và minh họa trong [tài liệu gói](http://mirrors.ctan.org/macros/latex/contrib/modiagram/modiagram_en.pdf).

Để áp dụng các tùy chọn của gói $$\langle$$`tùy chọn`$$\rangle$$ *toàn cục* bạn có thể

* đặt chúng khi nạp gói qua `\usepackage{modiagram}`\[$$\langle$$`tùy chọn`$$\rangle$$], hoặc
* sử dụng lệnh thiết lập `\setmodiagram`{$$\langle$$`tùy chọn`$$\rangle$$}

Các sơ đồ MO được tạo bằng `modiagram` môi trường, hỗ trợ sử dụng cục bộ các tùy chọn của gói $$\langle$$`tùy chọn`$$\rangle$$:

`\begin{modiagram}`\[$$\langle$$`tùy chọn`$$\rangle$$] ...

`\end{modiagram}`

Ví dụ sau minh họa một `modiagram` môi trường tối giản mà không sử dụng bất kỳ $$\langle$$`tùy chọn`$$\rangle$$:

```latex
\documentclass{article}
\usepackage{modiagram}
\begin{document}

Các nguyên tử ví dụ đầu tiên:

\begin{modiagram}
\atom{left}{1s, 2s, 2p}
\end{modiagram}
\end{document}
```

[Mở ví dụ này trong Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=example+of+molecular+diagram\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bmodiagram%7D%0A%5Cbegin%7Bdocument%7D%0A%0AFirst+example+atoms%3A%0A%0A%5Cbegin%7Bmodiagram%7D%0A%5Catom%7Bleft%7D%7B1s%2C+2s%2C+2p%7D%0A%5Cend%7Bmodiagram%7D%0A%5Cend%7Bdocument%7D)

Ví dụ này tạo ra kết quả sau:

![Ví dụ về sơ đồ obitan phân tử được tạo trong LaTeX](/files/5622a45c518abe4161118f0e7c55f93194fa67f2)

Lệnh cơ bản để vẽ sơ đồ MO là `\atom` mà, như minh họa ở ví dụ trên, nhận hai đối số:

* `trái`: sự căn chỉnh của nguyên tử.
* `1s, 2s, 2p`: các phân mức năng lượng sẽ được vẽ. Chúng có thể được tùy chỉnh thêm như bạn sẽ học trong [phần tiếp theo](#atoms).

## Nguyên tử

Bạn có thể truyền thêm một số thông tin về các obitan nguyên tử cho lệnh được trình bày trong ví dụ mở đầu.

```latex
\documentclass{article}
\usepackage{modiagram}
\begin{document}

\begin{modiagram}
 \atom{right}{
    1s = { 0; pair} ,
    2s = { 1; pair} ,
    2p = {1.5; up, down }
 }

 \atom{left}{
    1s = { 0; pair} ,
    2s = { 1; pair} ,
    2p = {1.5; up, down }
 }
 \end{modiagram}
\end{document}
```

[Mở ví dụ này trong Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=example+of+molecular+diagram\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bmodiagram%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cbegin%7Bmodiagram%7D%0A+%5Catom%7Bright%7D%7B%0A++++1s+%3D+%7B+0%3B+pair%7D+%2C%0A++++2s+%3D+%7B+1%3B+pair%7D+%2C%0A++++2p+%3D+%7B1.5%3B+up%2C+down+%7D%0A+%7D%0A%0A+%5Catom%7Bleft%7D%7B%0A++++1s+%3D+%7B+0%3B+pair%7D+%2C%0A++++2s+%3D+%7B+1%3B+pair%7D+%2C%0A++++2p+%3D+%7B1.5%3B+up%2C+down+%7D%0A+%7D%0A+%5Cend%7Bmodiagram%7D%0A%5Cend%7Bdocument%7D)

Ví dụ này tạo ra kết quả sau:

![ví dụ về các obitan nguyên tử](/files/36c5df77af31c231405ab563a2e7d18046be28c5)

Trong ví dụ này, hai nguyên tử giống hệt nhau được vẽ, lần lượt căn trái và căn phải.

Theo phong cách của `modiagram` tài liệu gói, cú pháp tổng quát để tạo nguyên tử có thể được viết như sau:

`\atom`\[$$\langle$$`tên`$$\rangle$$]{$$\langle$$`trái`$$\rangle$$|$$\langle$$`phải`$$\rangle$$}{$$\langle$$`AO-spec`$$\rangle$$}

trong đó

* $$\langle$$`tên`$$\rangle$$ là tên tùy chọn cho nguyên tử
* $$\langle$$`trái`$$\rangle$$ và $$\langle$$`phải`$$\rangle$$ xác định vị trí trong sơ đồ
* $$\langle$$`AO-spec`$$\rangle$$ là đặc tả của obitan nguyên tử.

Tính năng $$\langle$$`AO-spec`$$\rangle$$ có dạng tổng quát

```latex
phân mức = {năng lượng; đặc tả}
```

trong đó

* `phân mức` có thể là `1s`, `2s` hoặc `2p`
* `năng lượng` là mức năng lượng, một số xác định khoảng cách theo chiều dọc trong sơ đồ. Nếu bỏ qua, nó được đặt thành 0.
* `đặc tả` là danh sách các spin của các electron chứa trong mỗi obitan, được phân tách bằng dấu phẩy. Các giá trị có thể là `spin lên`, `spin xuống`, `cặp` và rỗng (chỉ cần gõ dấu chấm phẩy) đối với một obitan trống. Nếu bỏ qua, nó được đặt thành `cặp`.

Dưới đây là mô tả các lệnh dùng trong ví dụ trước:

* `1s = { 0; pair}`. Phân mức `1s` ở `0` mức năng lượng, obitan chứa hai electron (đã ghép cặp).
* `2s = { 1; pair}`. Phân mức `2s` được vẽ ở `1` mức năng lượng, có hai electron trong obitan này.
* `2p = {1.5; up, down}`. Phân mức `2p` được vẽ ở mức năng lượng `1.5`, tức là trong sơ đồ, khoảng cách theo chiều dọc được đặt thành 1,5; phân mức năng lượng này có hai electron: một với spin `spin lên` trong obitan thứ nhất và một electron khác với spin `spin xuống` trong obitan thứ hai.

Các lệnh tương tự được lặp lại cho nguyên tử thứ hai ở bên phải.

Để hiển thị tên (tùy chọn) `tên` của một `modiagram` nguyên tử, hãy dùng `[names]` :

```latex
\documentclass{article}
\usepackage{modiagram}
\begin{document}
\begin{modiagram}[names]
 \atom[Nguyên tử bên phải]{right}{
    1s = { 0; pair} ,
    2s = { 1; pair} ,
    2p = {1.5; up, down }
 }

 \atom[Nguyên tử bên trái]{left}{
    1s = { 0; pair} ,
    2s = { 1; pair} ,
    2p = {1.5; up, down }
 }
\end{modiagram}
\end{document}
```

[Mở ví dụ này trong Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Using+the+names+option+in+a+molecular+diagram\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bmodiagram%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bmodiagram%7D%5Bnames%5D%0A+%5Catom%5BAtom+on+the+right%5D%7Bright%7D%7B%0A++++1s+%3D+%7B+0%3B+pair%7D+%2C%0A++++2s+%3D+%7B+1%3B+pair%7D+%2C%0A++++2p+%3D+%7B1.5%3B+up%2C+down+%7D%0A+%7D%0A%0A+%5Catom%5BAtom+on+the+left%5D%7Bleft%7D%7B%0A++++1s+%3D+%7B+0%3B+pair%7D+%2C%0A++++2s+%3D+%7B+1%3B+pair%7D+%2C%0A++++2p+%3D+%7B1.5%3B+up%2C+down+%7D%0A+%7D%0A%5Cend%7Bmodiagram%7D%0A%5Cend%7Bdocument%7D)

Ví dụ này tạo ra kết quả sau:

![Ví dụ về obitan phân tử](/files/91b6a353b03be4bb2747a53b6f5ef9b72f2c7bf7)

## Phân tử

Cú pháp cho các phân tử rất giống với cú pháp của [`\atom`](#atoms) và, theo phong cách của tài liệu, có thể được viết như sau:

`\molecule`\[$$\langle$$`tên`$$\rangle$$]{$$\langle$$`MO-spec`$$\rangle$$}

trong đó

* $$\langle$$`tên`$$\rangle$$ là chú thích tùy chọn của phân tử
* $$\langle$$`MO-spec`$$\rangle$$ là đặc tả của Obitan phân tử

Các phân mức năng lượng `1s`, `2s` và `2p` trở thành `1sMO`, `2sMO` và `2pMO` tương ứng. Dưới đây là một ví dụ cơ bản:

```latex
\documentclass{article}
\usepackage{modiagram}
\begin{document}
\begin{modiagram}
 \atom{left}{1s}
 \atom{right}{1s={;up}}
 \molecule{
    1sMO={0.75;pair,up}
  }
\end{modiagram}
\end{document}
```

[Mở ví dụ này trong Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Molecule+example+with+modiagram+package\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bmodiagram%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bmodiagram%7D%0A+%5Catom%7Bleft%7D%7B1s%7D%0A+%5Catom%7Bright%7D%7B1s%3D%7B%3Bup%7D%7D%0A+%5Cmolecule%7B%0A++++1sMO%3D%7B0.75%3Bpair%2Cup%7D%0A++%7D%0A%5Cend%7Bmodiagram%7D%0A%5Cend%7Bdocument%7D)

Ví dụ này tạo ra kết quả sau:

![ví dụ sơ đồ phân tử](/files/9a05960d3fb2134d8a874cea7e244ab1c461f2bc)

Trong ví dụ trên, đặc tả obitan phân tử ($$\langle$$`MO-spec`$$\rangle$$ ) là

```latex
1sMO={0.75;pair,up}
```

trong đó

* `0.75` bây giờ là tỉ số *(năng lượng tăng)/(năng lượng giảm)*.
* `pair, up` là spin của các electron trong các obitan phân tử liên kết và phản liên kết, tương ứng.

Ví dụ tiếp theo, hơi phức tạp hơn, sẽ giúp bạn hiểu cú pháp:

```latex
\documentclass{article}
\usepackage{modiagram}
\begin{document}
\begin{modiagram}
 \atom{left}{
      1s, 2s, 2p = {;pair,up,up}
  }
  \atom{right}{
      1s, 2s, 2p = {;pair,up,up}
  }
  \molecule{
      1sMO, 2sMO, 2pMO = {;pair,pair,pair,up,up}
  }
\end{modiagram}
\end{document}
```

[Mở ví dụ này trong Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=More+elaborate+modiagram+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bmodiagram%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bmodiagram%7D%0A+%5Catom%7Bleft%7D%7B%0A++++++1s%2C+2s%2C+2p+%3D+%7B%3Bpair%2Cup%2Cup%7D%0A++%7D%0A++%5Catom%7Bright%7D%7B%0A++++++1s%2C+2s%2C+2p+%3D+%7B%3Bpair%2Cup%2Cup%7D%0A++%7D%0A++%5Cmolecule%7B%0A++++++1sMO%2C+2sMO%2C+2pMO+%3D+%7B%3Bpair%2Cpair%2Cpair%2Cup%2Cup%7D%0A++%7D%0A%5Cend%7Bmodiagram%7D%0A%5Cend%7Bdocument%7D)

Ví dụ này tạo ra kết quả sau:

![ví dụ chi tiết về obitan phân tử](/files/e10a8e1f8c48286388d9bb2e7f3238b2087bae25)

Ba nguyên tử được đặt ở mỗi bên của sơ đồ và phân tử tương ứng nằm ở giữa.

## Quy ước đặt tên

Sơ đồ sau được sao chép từ [`modiagram` gói](https://ctan.org/pkg/modiagram?lang=en) tài liệu. Nó chứa các tên (nhãn) được dùng cho các obitan, vốn là các nút trong một `tikzpicture` và do đó có thể được sử dụng trong các lệnh vẽ TikZ tiêu chuẩn trong một `modiagram` môi trường.

![tên modiagram cho các obitan](/files/b70283ab30d474c446ab7194e20c9455b4fc0338)

Dưới đây là một ví dụ sử dụng tên của obitan phản liên kết `1sigma*` để định vị tương đối.

```latex
\documentclass{article}
\usepackage{modiagram}
\begin{document}
\begin{modiagram}
 \atom{left}{1s}
 \atom{right}{1s={;up}}
 \molecule{
    1sMO={;pair,up}
 }
 \draw[<-,shorten <=8pt,shorten >=15pt,blue]
 (1sigma*) --++(2,1) node {MO phản liên kết};
\end{modiagram}
\end{document}
```

[Mở ví dụ này trong Overleaf.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Using+orbital+labels+in+an+modiagram+environment\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bmodiagram%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bmodiagram%7D%0A+%5Catom%7Bleft%7D%7B1s%7D%0A+%5Catom%7Bright%7D%7B1s%3D%7B%3Bup%7D%7D%0A+%5Cmolecule%7B%0A++++1sMO%3D%7B%3Bpair%2Cup%7D%0A+%7D%0A+%5Cdraw%5B%3C-%2Cshorten+%3C%3D8pt%2Cshorten+%3E%3D15pt%2Cblue%5D%0A+%281sigma%2A%29+--%2B%2B%282%2C1%29+node+%7Banti-bonding+MO%7D%3B%0A%5Cend%7Bmodiagram%7D%0A%5Cend%7Bdocument%7D)

Ví dụ này tạo ra kết quả sau:

![ví dụ về obitan có phản liên kết](/files/e79c94d828ef800bb364c41e8d0aeca623af22ab)

## Đọc thêm

Để biết thêm thông tin, xem:

* [Công thức hóa học](/latex/vi/theo-linh-vuc/02-chemistry-formulae.md)
* [Sơ đồ Feynman](/latex/vi/theo-linh-vuc/03-feynman-diagrams.md)
* [Gói TikZ](/latex/vi/hinh-va-bang/05-tikz-package.md)
* [Vẽ sơ đồ trực tiếp trong LaTeX](/latex/vi/hinh-va-bang/04-picture-environment.md)
* [Chèn hình ảnh](/latex/vi/chu-de-khac/27-inserting-images.md)
* [Danh sách các chữ cái Hy Lạp và ký hiệu toán học](/latex/vi/toan-hoc/11-list-of-greek-letters-and-math-symbols.md)
* [Tính năng `modiagram` manual](http://mirrors.ctan.org/macros/latex/contrib/modiagram/modiagram_en.pdf)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/vi/theo-linh-vuc/04-molecular-orbital-diagrams.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
