<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>孤筝の温暖小家</title><link>https://www.guzhengsvt.cn/en/</link><description>Recent content from 孤筝の温暖小家</description><generator>Hugo</generator><language>en</language><managingEditor>lvbowen040427@163.com (孤筝)</managingEditor><webMaster>lvbowen040427@163.com (孤筝)</webMaster><copyright>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</copyright><lastBuildDate>Tue, 11 Nov 2025 18:44:15 +0800</lastBuildDate><atom:link href="https://www.guzhengsvt.cn/en/index.xml" rel="self" type="application/rss+xml"/><item><title>Getting into Amateur Radio from Scratch</title><link>https://www.guzhengsvt.cn/en/post/othernotes/the-path-to-amateur-radio-from-scratch/</link><pubDate>Tue, 03 Jun 2025 20:44:15 +0800</pubDate><author>lvbowen040427@163.com (孤筝)</author><guid>https://www.guzhengsvt.cn/en/post/othernotes/the-path-to-amateur-radio-from-scratch/</guid><description>
<![CDATA[<h1>Getting into Amateur Radio from Scratch</h1><p>Author: 孤筝(lvbowen040427@163.com)</p>
        
          <h2 id="getting-the-class-a-operator-certificate">
<a class="header-anchor" href="#getting-the-class-a-operator-certificate"></a>
Getting the Class A Operator Certificate
</h2><p>Last year, in 2024, I took the exam in Xi&rsquo;an and got my Class A certificate. I bought a Quansheng UV-K6 handheld, and the first time I formally listened to an amateur radio contact was on the balcony of Dorm Hai-8 at XDU on $483.100 \text{MHz}$. Since I did not yet have a call sign at the time, transmitting would have been illegal, so I neither chatted nor logged the contact.</p>
<p>The A-class exam itself is not difficult. The hardest part is getting a seat. In Xi&rsquo;an, Class A exams are held only about once every six months, and registration is basically first-come, first-served with no mercy. The sign-up system also breaks quite often. If you are serious about taking it, I would suggest first following the radio society in either your registered hometown or your place of long-term residence, and booking somewhere that runs exams more often, has more seats, and processes certificates faster.</p>
<p>For students who simply want to get the A certificate quickly, setting aside about three days in advance for question drilling is already more than safe, honestly even one day can be enough. You can use platforms like the Zhipu app or HAM mini-programs for practice and mock tests. I would recommend first reading this 2018 <a href="https://www.jimmytian.com/archives/crac-aro-licence-a-review-guide.html">blog post</a>.</p>
<p><strong>==Waring==</strong>: The question bank was updated in 2025, so the blog post above may no longer fully apply. Still, it remains useful for getting a feel for the questions.</p>
<h2 id="getting-a-call-sign-and-a-station-license">
<a class="header-anchor" href="#getting-a-call-sign-and-a-station-license"></a>
Getting a Call Sign and a Station License
</h2><p>Once you have the operator certificate, you can buy or build equipment, apply to set up a station, and obtain a call sign. As a beginner, I went with the very popular 5 W handheld Quansheng UV-K6. A brand-new one only costs a bit over a hundred RMB, and that is enough to get started. After getting a B certificate, I can move on to better equipment and antennas for HF.</p>
<p>Xi&rsquo;an really is slow when it comes to administration. I went to the society in early March to apply for my station, and I did not receive my station license until the end of May, almost three months later.<br>
Judging from the stamped date on the license, it had already been approved on May 8. I honestly have no idea why they could drag it out that long, apparently only issuing them once a month.</p>
<p>With a call sign, you can legally conduct RTT. With a station license, you can use your registered equipment to transmit and receive on the legal bands.</p>
<p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/%E7%94%B5%E5%8F%B0%E6%89%A7%E7%85%A7-%E6%AD%A3%E9%9D%A2.jpeg" alt="电台执照-正面.jpeg"></p>
<h2 id="on-designing-qsl-cards-and-call-sign-stamps">
<a class="header-anchor" href="#on-designing-qsl-cards-and-call-sign-stamps"></a>
On Designing QSL Cards and Call Sign Stamps
</h2><p>Strictly speaking, QSL cards and call sign stamps are part of amateur radio culture rather than actual necessities. But when in Rome, making meaningful or good-looking QSL cards and stamps is a nice way to preserve a record and a memory of a contact for both yourself and the other operator.</p>
<p>Naturally, both have a few accepted &ldquo;industry standards.&rdquo;</p>
<h3 id="qsl-cards">
<a class="header-anchor" href="#qsl-cards"></a>
QSL Cards
</h3><p>For mailing convenience, QSL cards are usually postcard-sized, about $14 \text{cm} \times 9 \text{cm}$. Since printing requires trimming, some extra margin is needed. For example, the Taobao shop run by BG9GXM advised me to set the canvas to $14.4\text{cm} \times 9.4\text{cm}$, add $3 \text{mm}$ guide lines around the edges for trimming, and keep all content except the background image inside the safe area.</p>
<p>I use Krita, which is free and open source. Most people probably still use Photoshop. Exporting a PSD file also makes it easier for the printer to tweak things if necessary.</p>
<p>QSL cards can be single-sided, double-sided, or even folded, as long as the required information is present. You can look at the <a href="https://forum.hamcq.cn/qslCardShow">QSL card gallery</a> on the HamCQ community, as well as the following posts:</p>
<ul>
<li><a href="https://forum.hamcq.cn/d/1882">设计自己的 QSL 卡片 —— 来自广告从业者的分享 - HamCQ 社区</a></li>
<li><a href="https://www.hellocq.net/forum/read.php?tid=207871">哈罗CQ火腿社区 - QSL卡展板 - QSL卡片制作【新手必看Q&amp;A】</a></li>
<li><a href="https://forum.hamcq.cn/d/418">分享一版自己设计的 QSL 卡片背面模板 - HamCQ 社区</a></li>
</ul>
<p>Or you can simply ask 久美印业, BG9GXM&rsquo;s Taobao shop. That was where I printed my first batch of cards. The print quality was clear, and communication was patient.</p>
<p>Below is the first QSL card I designed:</p>
<p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/QSL-%E6%A0%87-1.jpeg" alt="QSL-标-1.jpeg"></p>
<p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/QSL-%E6%A0%87-2.jpeg" alt="QSL-标-2.jpeg"></p>
<p>Problems:</p>
<ol>
<li>The BA-style call sign logo on the front was scaled too small. The black part is hard to make out unless you stare at it. Next time I need to pay more attention to placement and contrast with the background.</li>
<li>I wanted the text on the window to look like Noa had handwritten it directly on the glass, but the font still did not feel handwritten enough. I could not find a better one in Krita, so I need to revise that later.</li>
<li>Once the background was added on the back, I could only really choose double-sided coated paper or expensive art paper. Coated paper takes oil-based ink better than water-based ink, so gel pens write poorly on it. After testing, a ballpoint pen actually worked quite well and did not smudge easily.</li>
<li>The background opacity on the back was set to 80 percent, which was still too high. I should probably try 60 percent next time. In the actual print, the small black text is hard to read.</li>
<li>The reserved writing height after &ldquo;To Radio:&rdquo; is too small, with too little room between the top blank margin and the form below.</li>
<li>$300 \text{g}$ coated business-card stock is still too soft. A stiffer card stock would be better.</li>
</ol>
<h3 id="call-sign-stamp-and-eyeball-stamp">
<a class="header-anchor" href="#call-sign-stamp-and-eyeball-stamp"></a>
Call Sign Stamp and EyeBall Stamp
</h3><p>Custom stamp shops usually make stamps with a diameter of about $40 \text{mm}$. If you design one yourself, you can simply create a $40\text{mm} \times 40\text{mm}$ canvas and then refer to existing call sign stamp designs for the rest. Of course, designing call sign stamps does not necessarily require Photoshop-type software. Vector tools may be better. <a href="https://forum.hamcq.cn/d/5865">使用 Visio 制作呼号章的手把手教学 - HamCQ 社区</a></p>
<p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/%E5%91%BC%E5%8F%B7%E7%AB%A0.png" alt="呼号章.png"></p>
<p>The stamp above is my own design, and I included the following elements:</p>
<ol>
<li>A gear decoration on the outer ring, representing workers and also a bit of engineering flavor.</li>
<li>The Chinese and English wording for &ldquo;Chinese Amateur Radio Station,&rdquo; the call sign itself, and &ldquo;Shaan Xi&rdquo; to indicate the province.</li>
<li>A five-pointed star decoration.</li>
<li>A radio set and radio waves on the screen, a BeiDou satellite for satellite operation, an arrow representing rockets and aircraft, a ground signal station for antennas, and a signal icon representing radio waves in space.</li>
</ol>
<p>I personally pay a lot of attention to aerospace, so I am especially fond of that arrow motif. Our school and our school&rsquo;s science association both use arrows in their logos as well. I originally thought about adding a few stars to suggest the night sky, but then I reconsidered. If I someday also get into &ldquo;plane spotting&rdquo; in the sense of monitoring airport towers and aviation bands, then a purely rocket-like arrow would feel too narrow.<br>
So in the end I went with something more general: the arrow can represent either a space rocket or an aircraft, with an angle somewhere between vertical launch and level flight.</p>
<p>Compared with QSL cards, call sign stamps are not really bound by strict content requirements, nor do they have to be stamped onto QSL cards at all. In the end, stamping is simply a cultural habit and a way to show personality.</p>
<p>An EyeBall QSO stamp is used for <strong>non-radio contacts</strong>, such as meeting in person or exchanging cards on a forum.</p>
<p>Sometimes, if you have too many cards to send, signing them one by one is also a pain, and in that case a signature stamp can help.</p>
<p>As I see it, <strong>the essence of amateur radio lies in exchanging technical knowledge, improving one&rsquo;s skills, and serving society. Whether cards or stamps, they are there to support the culture of the community, not to become the main thing.</strong></p>
<h2 id="contact-logging">
<a class="header-anchor" href="#contact-logging"></a>
Contact Logging
</h2><p>After each contact, the following information should be logged promptly:</p>
<ul>
<li>Requird:
<ol>
<li>Start and end time of the QSO, with attention to the time zone</li>
<li>Both call signs</li>
<li>Both QTHs</li>
<li>Both signal reports</li>
<li>Operating mode</li>
<li>Frequency, including repeater and tone information if applicable</li>
</ol>
</li>
<li>Optional:
<ol>
<li>Equipment</li>
<li>Antenna</li>
<li>Transmit power</li>
<li>Local weather</li>
<li>Whether cards will be exchanged</li>
</ol>
</li>
</ul>
<p>If these logs are kept properly, they can later be uploaded to platforms such as LoTW, Logbook of The World.</p>
<h2 id="sending-and-receiving-qsl-cards">
<a class="header-anchor" href="#sending-and-receiving-qsl-cards"></a>
Sending and Receiving QSL Cards
</h2><h3 id="mainland-china">
<a class="header-anchor" href="#mainland-china"></a>
Mainland China
</h3><p>Within the same province or city in mainland China, an ordinary letter costs 0.8 RMB in postage, while a registered letter costs 3.8 RMB, meaning 3 + 0.8.<br>
Across provinces or municipalities, ordinary mail costs 1.2 RMB and registered mail costs 4.2 RMB, meaning 3 + 1.2.<br>
The first weight bracket is 20 g. For every additional 20 g, or any fraction thereof, postage increases by 0.8 RMB within the province or 1.2 RMB across provinces.</p>
<p>There are three main ways to pay postage:</p>
<ol>
<li>Go to the post office and hand it directly to the staff, who will charge you and apply the stamps.</li>
<li>Buy stamps yourself and attach them to the envelope or postcard.</li>
<li>Buy a <strong>prepaid envelope</strong>, meaning the envelope already carries postage.</li>
</ol>
<h3 id="buying-stamps">
<a class="header-anchor" href="#buying-stamps"></a>
Buying Stamps
</h3><ol>
<li>Local post offices: usually limited selection, face value</li>
<li>Specialty postal branches: more varieties, sometimes themed stamps, face value</li>
<li>Postal website or app: broad selection, face value</li>
<li>E-commerce platforms: ordinary stamps often sold at 50 to 90 percent of face value, good for regular mailing</li>
<li>Private sales: Xianyu and individual sellers, with higher risk</li>
</ol>
<p><strong>Warning:</strong> When buying from unofficial postal channels, be careful about authenticity. I do not recommend stamps sold below half price.<br>
I usually buy discounted stamps from high-volume Taobao shops and check them with a UV light.</p>
<p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/%E9%B9%B0%E7%A5%A8.JPG" alt="一张很帅的老鹰，紫外灯照射后会显示红色荧光骨架"></p>
<h2 id="getting-the-class-b-certificate">
<a class="header-anchor" href="#getting-the-class-b-certificate"></a>
Getting the Class B Certificate
</h2><p>The Shaanxi Class B operator exam in 2025 was held on November 8, and my station license was issued on May 8, which meant I had just barely crossed the required six-month mark. Otherwise I would have missed this once-a-year exam.<br>
This was also the first exam after the question bank revision. Compared with Class A, the old B bank had a bit over 600 questions, while the new B bank has over 1100, almost doubling in size. The difficulty naturally increased as well.</p>
<p>Still, the revision was not entirely a bad thing. Being among the first batch to sit the new exam, I found the actual paper surprisingly easy.<br>
While practicing, all the frequency questions and calculation questions were a headache, especially the frequency questions, which are all numbers and much harder to memorize than plain-language items. On top of that, there were topics like antenna-feed systems, signal modulation and demodulation, and radio-wave theory, which forced me to revisit the Electromagnetic Fields and Waves course I had taken two years ago, and even learn a bit of Communication Principles that I had never properly studied.<br>
I went through the whole bank in random order, marked the hard ones, drilled them again and again until I could tell the answer from the first line, and then redid the wrong questions. Even so, time was tight, and I never even did a full mock exam, so I still felt uncertain inside.</p>
<p>After all that preparation, the real paper turned out not to contain a single truly difficult question. I finished the 60 questions in a bit more than ten minutes, checked them once more, and honestly spent longer filling in the answer sheet than solving the paper itself.<br>
I handed it in after half an hour, then waited downstairs for over an hour before the results came out. I got 58 out of 60 without much trouble. Even classmates who had only finished about 700 questions in the bank still scored above 50. There was no helping it, almost none of the later questions in the bank showed up at all.</p>
<p>Now I just have to wait for the certificate to be issued. I have no idea whether it will come in the new Class B format or the older-looking one. By &ldquo;old&rdquo; here I mean the appearance, not the truly old B license from before the new regulations, the one that still allowed 100 W HF operation.<br>
To take the Class C exam, one must have had an HF station established for 18 months. I would really like to set one up as soon as possible, but money is the problem. HF stations often cost several thousand or even more, and antennas and feed lines are not cheap either.<br>
Maybe I will save up for a Xiegu, or perhaps build a μSDX myself.</p>

        
        <hr><p>Published on 2025-06-03 at <a href='https://www.guzhengsvt.cn/'>孤筝の温暖小家</a>, last modified on 2025-11-11</p><p>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</p>]]></description><category>OtherNotes</category></item><item><title>Building a NAS with an Old Computer and fnOS</title><link>https://www.guzhengsvt.cn/en/post/othernotes/use-old-computers-and-fnos-to-build-your-own-nas/</link><pubDate>Thu, 16 Oct 2025 23:04:15 +0800</pubDate><author>lvbowen040427@163.com (孤筝)</author><guid>https://www.guzhengsvt.cn/en/post/othernotes/use-old-computers-and-fnos-to-build-your-own-nas/</guid><description>
<![CDATA[<h1>Building a NAS with an Old Computer and fnOS</h1><p>Author: 孤筝(lvbowen040427@163.com)</p>
        
          <h2 id="preface">
<a class="header-anchor" href="#preface"></a>
Preface
</h2><p>Ever since I canceled my NetEase Cloud Music subscription, every time I open the app to listen to music I have to endure five or more VIP pop-ups, and a huge chunk of my playlists has gone gray.<br>
So does paying money to capital actually solve the problem? Not really. Even when I still had VIP, it was constantly throwing SVIP ads at me anyway, and the splash ads never became any fewer. It is not that I cannot afford the fee. It is that I am paying, still getting ads, and still watching the licensing catalog shrink. What exactly am I paying for?<br>
As an Apple user, I also tried the 5 RMB student plan for Apple Music, but too much of the music I actually listen to is locked up by domestic streaming platforms. Downloading everything myself and importing it into Apple Music is just too much trouble.<br>
As a spiritually tech-obsessed Virgo, I absolutely refuse to accept ads shoved in my face inside software and devices I already paid for. I had been too lazy to build my own music library before, and the third-party music services floating around online, especially the ones without proper licenses, are unstable anyway. At this point I really have no choice but to start cleaning up the mess myself.</p>
<p>There are many ways to build a personal music library, but since I have already decided to clean house, I might as well do it thoroughly.<br>
This is not only about music. I used to sync photos with Aliyun Drive and left some in Baidu Netdisk. As for movies and TV shows, storage on my everyday devices was limited, so only my Mac mini M4 had a few hundred gigabytes from PT, and even that was not much. My books were even worse, scattered between cloud drives and local folders with no real synchronization, amounting to several hundred volumes.</p>
<p>As it happened, I had an old laptop lying around: a Thinkbook 16+ 2022 with an i5-12500H, RTX 2050, 512 GB SSD, and 2 TB SSD. It felt almost wasteful not to turn it into an all-flash NAS.<br>
As for the NAS system, fnOS was the obvious choice. It is currently very popular, has an active community, and even offers 2 Mb of free relay service.</p>
<h2 id="system-installation">
<a class="header-anchor" href="#system-installation"></a>
System Installation
</h2><p>Installing fnOS is actually simple. If you follow the official guide, there is usually no problem.<br>
The issue I ran into was this: my USB drive had already been turned into a multi-boot drive with Ventoy. Since fnOS is based on Debian, in theory I should have been able to just drop the ISO into it. But after plugging in the USB stick and selecting the fnOS installer through Ventoy, it kept saying that no hard drive could be found, and changing modes did not help. In the end I followed the official guide, rebuilt the boot disk with Rufus, and it worked on the first try.</p>
<h2 id="special-reminder">
<a class="header-anchor" href="#special-reminder"></a>
Special Reminder
</h2><p>When running Docker, make sure to configure storage paths properly. Map your data folders, such as your music folder, into the container storage space, and set file permissions in the file manager so they apply to child items as well.</p>
<h2 id="building-a-music-library-with-navidrome">
<a class="header-anchor" href="#building-a-music-library-with-navidrome"></a>
Building a Music Library with Navidrome
</h2><p>Navidrome is a web-based open-source music collection server and streaming service.</p>
<p>In system settings, under app settings, add the music folder so Navidrome is allowed to access it. The default port is 4533.<br>
After setting up the account and password, open the web interface. In most cases Navidrome can directly scan accessible folders and import your music.</p>
<h3 id="music_tag_web">
<a class="header-anchor" href="#music_tag_web"></a>
music_tag_web
</h3><p>This is a Docker-based multifunction music tag editor with a web interface. Common features include metadata scraping, library organization, duplicate checking, and format conversion.<br>
Its most important background scraping feature requires version 2, which is paid. I paid 10 RMB on Aifadian for a one-month activation code just to try it out first.</p>
<p>Most of my music files came from NetEase Cloud Music. Because I never had any real sense of organization before, the filenames were a mess. There were duplicates all over my iPhone, Redmi, Mac, and Baidu Drive, and a lot of songs existed in multiple versions or multiple cover versions, such as 《アイロニ (双声道版)》 by 鹿乃 and *菜乃. Many songs I used to listen to years ago have already gone gray on NetEase, such as 双笙&rsquo;s old version of 道姑 or 封茗囧菌&rsquo;s 《静悄悄》.</p>
<p>The first step is to choose the music files you want to scrape and organize the file structure into artist - album - track.<br>
For automatic scraping, I usually start with standard mode, matching title, artist, and album. For the data source, I choose the platform the song mostly came from, for example NetEase Cloud Music in my case. I restrict modifications to cover art, lyrics, and lyric files. If title and artist information were not already messed up, most tracks match perfectly.</p>
<p>For songs that cannot be scraped normally, such as very obscure tracks or tracks that have gone unavailable, I switch to loose mode and enable several sources at once, such as NetEase, QQ Music, Kugou, and iTunes, while keeping the modification scope unchanged.<br>
If you let the software modify the artist field as well, it can easily replace lesser-known cover singers with the original performer.<br>
Sometimes the same piece of music exists in different albums. In some cases the actual audio file is identical, such as Merry Christmas Mr. Lawrence; in others it is not, such as TV-size anime inserts versus full-length versions. If album data is also allowed to change, this can easily lead to bad matches.</p>
<p>After scraping everything, I organize the files once more and delete empty folders.<br>
If there are duplicates, I run duplicate checking and strongly recommend enabling acoustic fingerprint comparison. When the fingerprints match, the files are usually just the same song in different formats, such as mp3 and flac, and I normally keep the larger-bitrate or otherwise preferred version and delete the smaller one.<br>
Then I organize the files again and clean up the empty folders one last time.</p>
<p>Once paid for, music_tag_web can also function as the music library itself. It comes with a built-in Subsonic server, and its interface looks more modern and polished than Navidrome.<br>
That said, I am still cautious about the long-term operational reliability of a solo developer project, so for now I am just watching.</p>
<h3 id="playlist-matcher">
<a class="header-anchor" href="#playlist-matcher"></a>
Playlist Matcher
</h3><p>Someone on LINUX DO made a Windows tool for importing playlists from streaming platforms into Navidrome: <a href="https://linux.do/t/topic/757204">分享一个适配Navidrome的歌单匹配器</a>.<br>
It supports importing playlists from NetEase Cloud Music, QQ Music, and Apple Music into Navidrome, and also outputs a list of unmatched tracks.</p>
<h3 id="clients">
<a class="header-anchor" href="#clients"></a>
Clients
</h3><p>After the music library is built, the next question is how to listen on mobile and desktop devices.<br>
There are many clients that support Navidrome, and they are easy enough to find online.</p>
<p>I am currently using 音流 (1.3.9), which supports most of the platforms I care about, including Android, iOS, iPadOS, Windows, and macOS. It costs under 60 RMB as a one-time purchase and supports up to seven devices at once.<br>
As a player, it basically meets my needs: a fairly decent-looking interface, the ability to download songs from the NAS for local playback, desktop lyrics, playlists, likes, ratings, and shuffle playback.</p>
<p>There are still issues. It crashes sometimes. Background playback occasionally fails to move on to the next track after finishing one song, though not in a reliably reproducible way. Connection to the NAS can feel slow. And when the client cannot connect to the NAS, it only shows already-downloaded tracks and downloaded playlists. If one song appears in multiple playlists, offline it will appear only in the playlist through which it was originally downloaded.<br>
Since it is a non-open-source app by an individual developer, I would still recommend caution before paying. Try the regular version first.</p>
<h2 id="building-a-book-library-with-talebook">
<a class="header-anchor" href="#building-a-book-library-with-talebook"></a>
Building a Book Library with talebook
</h2><p>talebook is a Docker-based open-source project and a compact but powerful private book management system. It is built on calibre and offers book management, online reading and delivery, user management, SSO login, and metadata fetching from Baidu and Douban.</p>
<p>Most configuration is straightforward if you just go through the talebook web admin page item by item. The one thing worth noting is the set of user permissions. Some clients cannot log in normally, and in those cases you need to enable &ldquo;allow arbitrary download&rdquo; so that downloads will work.</p>
<p>In book management, you can manually edit some metadata and add tags. My reading is all over the place, so I prefer to classify both the physical folders and the tags according to the <a href="https://www.clcindex.com/"><strong>Chinese Library Classification</strong></a>.</p>
<h3 id="douban-api-rs">
<a class="header-anchor" href="#douban-api-rs"></a>
douban-api-rs
</h3><p>This is the Douban plugin for talebook, and there is an image for it in fnOS. After running the Docker container, copy the corresponding API address into talebook&rsquo;s &ldquo;internet book metadata source&rdquo; setting. Only then will the automatic metadata update function in book management work properly.<br>
For most well-known literary books, Douban scraping works well. But for unpublished materials such as 《业余无线电爱好者的道德和操作守则》 or very obscure or older books such as 《中国的野菜》 from Hainan Publishing House in 2008, Douban either cannot find anything or matches the wrong thing.</p>
<p>I even have a whole pile of &ldquo;barefoot doctor manuals, militia training guides, martial arts collections, and transmigrator survival texts&rdquo; sitting in Baidu Drive, a full 120 GB plus.<br>
Most of the martial arts and military manuals are impossible to scrape properly, but historical and literary works fare much better.</p>
<h3 id="clients-1">
<a class="header-anchor" href="#clients-1"></a>
Clients
</h3><p>For talebook, or rather OPDS clients in general, genuinely good and modern apps are surprisingly rare.</p>
<p>On Android, I currently download books through the fnOS Android client and then read them locally in eBoox, which can still sync through Google.<br>
tachiyomi is dead because of copyright issues, and its successor Mihon, or similar tools, are much better suited to manga than to books. Their design logic just is not built for ordinary reading. I even ran into a problem where the address could not be set at all when trying to import my self-hosted Komaga source through the komaga plugin.</p>
<p>That said, Kahon, which is derived from Mihon, becomes almost hilariously useful for R18 image sources after you import plugin libraries. As a no-ad way to browse porn, it is honestly pretty great.</p>
<p>On iOS and iPadOS, it is hard for any reading app to beat the built-in iBooks experience. Right now I am trying KyBook 3, though it does not support account login.<br>
When entering the OPDS address, be sure to include both the correct port and the <code>/opds/</code> path.</p>
<h2 id="building-a-video-library">
<a class="header-anchor" href="#building-a-video-library"></a>
Building a Video Library
</h2><p>For me, the built-in fnOS media app is already good enough. It can scrape metadata and classify content. There are clients for Android, iOS, iPadOS, macOS, and Windows. It can also import video resources from Baidu Drive and remotely mounted disks, such as an external drive connected to a Mac and then imported into the fnOS media library over the LAN. Subtitle matching also works online.<br>
If it could also connect to the Bangumi API and the Douban API, that would be even better.</p>
<h2 id="pt">
<a class="header-anchor" href="#pt"></a>
PT
</h2><p>When it comes to acquiring resources, PT is still king. My first recommendation remains qBittorrent from the fnOS app center.<br>
As for how to use the software and where to find torrents, that is left to your own exploration. In any case, it is best to maintain a decent share ratio and seeding time.<br>
One for all, all for one.</p>
<h2 id="photos">
<a class="header-anchor" href="#photos"></a>
Photos
</h2><p>Image management is even easier.<br>
Upload or download photos from all your cloud drives and local devices into the NAS Photos folder. There is no need to carefully organize physical folders beforehand. Once you open the album, it can scan and import automatically. You can also add other local or externally mounted folders under Album - Settings - Folder Management.<br>
In the AI album settings, download the required models first, then run analysis on the unrecognized photos and videos. Classification will happen automatically in the background. All of this runs locally, so if privacy matters more, you can simply leave it disabled.<br>
If you enable GPU acceleration, recognition becomes significantly faster, though that does require installing the proper graphics driver.</p>
<p>I backed up photos from my iPhone, Redmi, and iPad at the same time, which left me with a huge number of duplicates under different filenames. After AI-based recognition and then reviewing similar photos for deduplication, the results were excellent.</p>
<h2 id="other-handy-small-tools">
<a class="header-anchor" href="#other-handy-small-tools"></a>
Other Handy Small Tools
</h2><h3 id="hivisionidphoto">
<a class="header-anchor" href="#hivisionidphoto"></a>
HivisionIDPhoto
</h3><p>For making your own ID photos. Available as a Docker app in the app center.</p>
<h3 id="peazip">
<a class="header-anchor" href="#peazip"></a>
peazip
</h3><p>Compression and decompression through Docker. The built-in archive tool in fnOS file management is currently extremely bare-bones and does not even support split archives properly.</p>
<h3 id="singbox">
<a class="header-anchor" href="#singbox"></a>
singbox
</h3><p>Docker-based. An occasionally necessary little miraculous tool.</p>
<h3 id="fnos-sync">
<a class="header-anchor" href="#fnos-sync"></a>
fnOS Sync
</h3><p>Synchronizes folders from other devices to the NAS. Supports bidirectional sync, download-only, and upload-only.<br>
You need to install the matching client on the other devices first.</p>
<h3 id="text-editor">
<a class="header-anchor" href="#text-editor"></a>
Text Editor
</h3><p>After installing it, you can open txt, yml, log, html, js, md, nfo, and other plain-text files directly from the file manager.</p>
<h3 id="office-preview">
<a class="header-anchor" href="#office-preview"></a>
Office Preview
</h3><p>Lets you open Office files up to 500 MB directly inside the file manager.</p>
<h3 id="omnitools">
<a class="header-anchor" href="#omnitools"></a>
OmniTools
</h3><p>A toolbox that bundles more than ten small utilities together.</p>
<h3 id="baidu-netdisk-for-fnos">
<a class="header-anchor" href="#baidu-netdisk-for-fnos"></a>
Baidu Netdisk for fnOS
</h3><p>&ldquo;Almost&rdquo; ad-free, fairly clean, but you cannot copy file URLs, there is no proper file or folder details page, and it does not seem to show folder sizes either.<br>
Selling the NAS membership separately is terrible.</p>
<h3 id="not-recommended-the-browser-in-the-app-center">
<a class="header-anchor" href="#not-recommended-the-browser-in-the-app-center"></a>
Not Recommended: the Browser in the App Center
</h3><p>This is basically a Dockerized Google Chrome. The web image is blurry because it is streaming the interface instead of rendering pages directly. Chinese input methods do not work properly, downloaded files have to be moved out manually from the app folder, the default Google search engine requires a proxy, though you can switch it to Bing, and download speed is still poor.</p>
<p>So if you need to download something, I strongly recommend first finding the direct link in your local browser, then adding the download task through the fnOS client instead.</p>
<h2 id="summary">
<a class="header-anchor" href="#summary"></a>
Summary
</h2><p>After several days of initial tinkering, this laptop &ldquo;NAS&rdquo; can already manage video, music, photos, and books, while also backing up critical files such as manuals, documentation, manuscripts, PCB files, code, certificates, and passwords.<br>
The next things I want to play with are dashboards, domain names, reverse proxying, IPv6, RSSHub, and an off-site triple-backup setup.</p>
<p>And finally, NetEase Cloud Music can go to hell.</p>
<p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/Soyo.JPG" alt="无语"></p>

        
        <hr><p>Published on 2025-10-16 at <a href='https://www.guzhengsvt.cn/'>孤筝の温暖小家</a>, last modified on 2025-10-16</p><p>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</p>]]></description><category>OtherNotes</category></item><item><title>Quantum Physics</title><link>https://www.guzhengsvt.cn/en/post/physics/quantum-physics/</link><pubDate>Fri, 05 Sep 2025 11:05:15 +0800</pubDate><author>lvbowen040427@163.com (孤筝)</author><guid>https://www.guzhengsvt.cn/en/post/physics/quantum-physics/</guid><description>
<![CDATA[<h1>Quantum Physics</h1><p>Author: 孤筝(lvbowen040427@163.com)</p>
        
          <h2 id="chapter-1-wave-particle-duality-and-state-description">
<a class="header-anchor" href="#chapter-1-wave-particle-duality-and-state-description"></a>
Chapter 1 Wave-Particle Duality and State Description
</h2><h3 id="11-formation-and-applications-of-quantum-mechanics">
<a class="header-anchor" href="#11-formation-and-applications-of-quantum-mechanics"></a>
1.1 Formation and Applications of Quantum Mechanics
</h3><h4 id="111-old-quantum-theory">
<a class="header-anchor" href="#111-old-quantum-theory"></a>
1.1.1 Old Quantum Theory
</h4><h5 id="photoelectric-effect-and-the-photon-hypothesis">
<a class="header-anchor" href="#photoelectric-effect-and-the-photon-hypothesis"></a>
Photoelectric Effect and the Photon Hypothesis
</h5><ul>
<li><strong>Photon energy</strong>: $E = h\nu$</li>
<li><strong>Threshold frequency</strong>: $\nu_0 = \dfrac{W_0}{h}$; no photoelectrons are emitted when $\nu < \nu_0$</li>
<li><strong>Photoelectric equation</strong>:<br>

$$
  E_k^{\text{max}} = \frac{1}{2}\mu v^2_m = h\nu - W_0
  $$</li>
<li>The photoelectric effect demonstrates the particle nature of light.</li>
</ul>
<h5 id="energy-momentum-relation-of-photons-and-wave-particle-unity">
<a class="header-anchor" href="#energy-momentum-relation-of-photons-and-wave-particle-unity"></a>
Energy-Momentum Relation of Photons and Wave-Particle Unity
</h5><ul>
<li>
<p><strong>Relativistic energy-momentum relation</strong><br>
</p>
$$
  E^2=(pc)^2+(m_0c^2)^2,\quad m_0=0\ \Rightarrow\ E=c\,\lVert\vec p\rVert
  $$</li>
<li>
<p><strong>Photon energy</strong><br>
</p>
$$
  E=h\nu=\frac{hc}{\lambda}=\hbar\omega
  $$</li>
<li>
<p><strong>Photon momentum (vector form)</strong><br>
Let $\mathbf n$ be the unit vector in the propagation direction, then
</p>
$$
  \vec p=\frac{E}{c}\,\mathbf n=\frac{h}{\lambda}\,\mathbf n=\hbar\vec k,\quad
  \vec k=\frac{2\pi}{\lambda}\,\mathbf n
  $$</li>
<li>
<p><strong>Unified correspondence of wave and particle pictures</strong><br>
</p>
$$
  E\ \longleftrightarrow\ \hbar\omega,\qquad
  \vec p\ \longleftrightarrow\ \hbar\vec k
  $$</li>
</ul>
<h5 id="bohr-structure-of-the-hydrogen-atom">
<a class="header-anchor" href="#bohr-structure-of-the-hydrogen-atom"></a>
Bohr Structure of the Hydrogen Atom
</h5><ul>
<li>Quantization of orbital angular momentum:

$$
  L = n\hbar,\quad n=1,2,3,\dots
  $$</li>
<li>Energy levels:

$$
  E_n = -\frac{13.6\ \text{eV}}{n^2}
  $$</li>
<li>This successfully explains the line spectrum of hydrogen.</li>
</ul>
<h5 id="bohrs-postulates">
<a class="header-anchor" href="#bohrs-postulates"></a>
Bohr&rsquo;s Postulates
</h5><ul>
<li>Electrons moving in stable orbits do not radiate energy.</li>
<li>Electrons absorb or emit energy when they jump between energy levels:

$$
  \Delta E = h\nu
  $$</li>
</ul>
<h5 id="compton-effect">
<a class="header-anchor" href="#compton-effect"></a>
Compton Effect
</h5><ul>
<li>The wavelength of a high-energy photon increases after scattering from an electron:

$$
  \Delta\lambda = \lambda' - \lambda = \frac{h}{m_ec}(1-\cos\theta)
  $$</li>
<li>The experiment confirms both the particle nature of light and conservation of momentum.</li>
</ul>
<h5 id="blackbody-radiation">
<a class="header-anchor" href="#blackbody-radiation"></a>
Blackbody Radiation
</h5><ul>
<li>Energy quantization assumption: the energy of the electromagnetic field takes discrete values $E=nh\nu$.</li>
<li>Planck formula:

$$
  u(\nu,T)=\frac{8\pi h\nu^3}{c^3}\frac{1}{e^{h\nu/kT}-1}
  $$</li>
<li>This successfully explains the blackbody spectrum and marks the birth of quantum theory.</li>
</ul>
<h4 id="112-wave-particle-duality-of-microscopic-particles">
<a class="header-anchor" href="#112-wave-particle-duality-of-microscopic-particles"></a>
1.1.2 Wave-Particle Duality of Microscopic Particles
</h4><h5 id="de-broglie-hypothesis">
<a class="header-anchor" href="#de-broglie-hypothesis"></a>
de Broglie Hypothesis
</h5><ul>
<li>Microscopic particles have not only particle properties but also wave properties.</li>
<li>Every particle with momentum $\vec p$ corresponds to a matter wave whose wavelength and frequency are related to its momentum and energy.</li>
</ul>
<h5 id="de-broglie-relations">
<a class="header-anchor" href="#de-broglie-relations"></a>
de Broglie Relations
</h5><ul>
<li>Wavelength:

$$
  \lambda = \frac{h}{p}
  $$</li>
<li>Vector form:

$$
  \vec p = \hbar \vec k
  $$</li>
<li>Frequency:

$$
  E = h\nu = \hbar\omega
  $$</li>
</ul>
<hr>
<h3 id="12-states-and-wave-functions">
<a class="header-anchor" href="#12-states-and-wave-functions"></a>
1.2 States and Wave Functions
</h3><h4 id="121-uncertainty-principle">
<a class="header-anchor" href="#121-uncertainty-principle"></a>
1.2.1 Uncertainty Principle
</h4><ul>
<li>The position and momentum of a microscopic particle cannot be measured simultaneously with arbitrary precision.</li>
<li>Heisenberg uncertainty relation:

$$
  \Delta x \cdot \Delta p_x \geq \frac{\hbar}{2}
  $$</li>
<li>Energy-time uncertainty relation:

$$
  \Delta E \cdot \Delta t \geq \frac{\hbar}{2}
  $$</li>
<li>Its origin lies in wave-particle duality and the non-commutativity of operators.</li>
</ul>
<h4 id="122-wave-function">
<a class="header-anchor" href="#122-wave-function"></a>
1.2.2 Wave Function
</h4><ul>
<li>To describe the state of a microscopic particle, we introduce the <strong>wave function</strong> $\psi(\vec r,t)$.</li>
<li><strong>Probabilistic interpretation</strong>: $|\psi(\vec r,t)|^2 dV$ gives the probability of finding the particle in the volume element $dV$.</li>
<li>The wave function must satisfy the superposition principle and the Schrödinger equation.</li>
<li>The total probability over all space is 1, so the probability distribution depends only on the relative magnitude of the wave function, not its absolute scale.</li>
<li>Multiplying the wave function by a constant does not change the physical state it describes.</li>
<li>Standard requirements for a wave function: single-valued, finite, and continuous.</li>
</ul>
<h4 id="123-normalization-of-the-wave-function">
<a class="header-anchor" href="#123-normalization-of-the-wave-function"></a>
1.2.3 Normalization of the Wave Function
</h4><ul>
<li><strong>Normalization condition</strong>:

$$
  \int_{-\infty}^{\infty} \psi^* (\vec r,t) \psi (\vec r,t) dV = 1
  $$</li>
<li><strong>How to normalize a wave function</strong>

$$
  \int_{-\infty}^{\infty} |\Psi(\vec r,t)|^2 dV = A^2 \int_{-\infty}^{\infty} |\psi(\vec r,t)|^2 dV = 1
  $$
where $A$ is the normalization constant.</li>
</ul>
<hr>
<h3 id="13-schrödinger-equation">
<a class="header-anchor" href="#13-schr%c3%b6dinger-equation"></a>
1.3 Schrödinger Equation
</h3><h4 id="131-wave-equation-for-a-free-particle">
<a class="header-anchor" href="#131-wave-equation-for-a-free-particle"></a>
1.3.1 Wave Equation for a Free Particle
</h4><p><strong>Concept</strong><br>
A free particle is a particle not subject to external forces. In quantum mechanics, its state is described by the wave function $\psi(\vec{r},t)$ and satisfies the Schrödinger equation.</p>
<p><strong>Schrödinger equation for a free particle</strong><br>
</p>
$$
i\hbar \frac{\partial \psi(\vec{r},t)}{\partial t} = -\frac{\hbar^2}{2m} \nabla^2 \psi(\vec{r},t)
$$<p>
where:</p>
<ul>
<li>$\hbar$: reduced Planck constant</li>
<li>$m$: mass of the particle</li>
<li>$\nabla^2$: Laplacian operator</li>
</ul>
<p><strong>Plane-wave solution</strong><br>
</p>
$$
\psi(\vec{r},t) = A e^{i(\vec{k}\cdot\vec{r} - \omega t)}
$$<p>
where:</p>
<ul>
<li>$\vec{k}$ is the wave vector, with $|\vec{k}| = k$</li>
<li>$\omega$ is the angular frequency, satisfying

$$
E = \hbar \omega = \frac{\hbar^2 k^2}{2m}
$$</li>
</ul>
<p><strong>Momentum-wave vector relation</strong>
</p>
$$
\vec{p} = \hbar \vec{k}
$$<h5 id="plane-wave-derivation-of-the-free-particle-schrödinger-equation">
<a class="header-anchor" href="#plane-wave-derivation-of-the-free-particle-schr%c3%b6dinger-equation"></a>
Plane-Wave Derivation of the Free-Particle Schrödinger Equation
</h5><p><strong>1. Assume a plane-wave form</strong>
</p>
$$
\psi(\vec{r},t) = A e^{i(\vec{k}\cdot\vec{r} - \omega t)}
$$<p>
with $\vec{k}$ the wave vector, $\omega$ the angular frequency, and $A$ the amplitude constant.</p>
<p><strong>2. Time derivative</strong>
</p>
$$
\frac{\partial \psi}{\partial t} = \frac{\partial}{\partial t} \left[ A e^{i(\vec{k}\cdot\vec{r} - \omega t)} \right] 
= -i \omega A e^{i(\vec{k}\cdot\vec{r} - \omega t)} 
= -i \omega \psi
$$<p>
Multiplying by $i\hbar$ gives
</p>
$$
i\hbar \frac{\partial \psi}{\partial t} = \hbar \omega \psi
$$<p><strong>3. Spatial Laplacian</strong>
</p>
$$
\nabla^2 \psi = \nabla^2 \left[ A e^{i \vec{k}\cdot\vec{r}} e^{-i\omega t} \right] 
= -k^2 A e^{i(\vec{k}\cdot\vec{r} - \omega t)} 
= -k^2 \psi
$$<p>
Thus,
</p>
$$
-\frac{\hbar^2}{2m} \nabla^2 \psi = \frac{\hbar^2 k^2}{2m} \psi
$$<p><strong>4. Energy relation</strong>
</p>
$$
E = \frac{\hbar^2 k^2}{2m} = \hbar \omega
$$<p><strong>5. Final equation</strong>
</p>
$$
i\hbar \frac{\partial \psi}{\partial t} = -\frac{\hbar^2}{2m} \nabla^2 \psi
$$<p><strong>Remark</strong></p>
<ul>
<li>This derivation uses only the plane-wave form and differentiation, without relying on operator definitions.</li>
<li>It corresponds to the case $V=0$.</li>
</ul>
<h4 id="133-stationary-state-schrödinger-equation-and-stationary-wave-functions">
<a class="header-anchor" href="#133-stationary-state-schr%c3%b6dinger-equation-and-stationary-wave-functions"></a>
1.3.3 Stationary-State Schrödinger Equation and Stationary Wave Functions
</h4><p><strong>Concept</strong><br>
A stationary-state wave function has separable time dependence:
</p>
$$
\psi(\vec{r},t) = \phi(\vec{r}) e^{-i E t / \hbar}
$$<p>
Let $f(t)=e^{-i E t / \hbar}$.<br>
Here $\phi(\vec{r})$ depends only on spatial coordinates, and $E$ is the total energy of the particle.</p>
<p><strong>Derivation</strong>
Starting from the time-dependent Schrödinger equation:
</p>
$$
i\hbar \frac{\partial \psi(\vec{r},t)}{\partial t} = \left[ -\frac{\hbar^2}{2m} \nabla^2 + V(\vec{r}) \right] \psi(\vec{r},t)
$$<p>
substitute $\psi(\vec{r},t) = \phi(\vec{r}) e^{-i E t / \hbar}$ to obtain
</p>
$$
\left[ -\frac{\hbar^2}{2m} \nabla^2 + V(\vec{r}) \right] \phi(\vec{r}) = E \phi(\vec{r})
$$<p><strong>Time-independent form</strong>
</p>
$$
i \hbar \frac{df}{dt}=E f , \; f= e^{-i E t / \hbar}
$$<p>
</p>
$$
-\frac{\hbar^2}{2m} \nabla^2 \phi(\vec{r}) + V(\vec{r}) \phi(\vec{r}) = E \phi(\vec{r})
$$<p><strong>Remark</strong></p>
<ul>
<li>$\phi(\vec{r})$ is called a stationary-state wave function or eigenfunction.</li>
<li>$E$ is the corresponding energy eigenvalue.</li>
</ul>
<h4 id="derivation-of-the-schrödinger-equation-from-operators">
<a class="header-anchor" href="#derivation-of-the-schr%c3%b6dinger-equation-from-operators"></a>
Derivation of the Schrödinger Equation from Operators
</h4><p><strong>1. Start from classical energy</strong>
</p>
$$
E = \frac{p^2}{2m} + V(\vec{r},t)
$$<p><strong>2. Introduce the de Broglie relations</strong>
</p>
$$
\vec{p} = \hbar \vec{k}, \quad E = \hbar \omega
$$<p>
and the plane-wave form
</p>
$$
\psi(\vec{r},t) \sim e^{i(\vec{k}\cdot\vec{r} - \omega t)}
$$<p><strong>3. Operator representation</strong>
</p>
$$
\hat{E} = i\hbar \frac{\partial}{\partial t}, \quad \hat{\vec{p}} = -i\hbar \nabla
$$<p><strong>4. Kinetic-energy and Hamiltonian operators</strong>
</p>
$$
\hat{T} = \frac{\hat{p}^2}{2m} = -\frac{\hbar^2}{2m}\nabla^2
$$<p>
</p>
$$
\hat{H} = \hat{T} + V(\vec{r},t) = -\frac{\hbar^2}{2m}\nabla^2 + V(\vec{r},t)
$$<p><strong>5. Schrödinger equation</strong>
</p>
$$
i\hbar \frac{\partial \psi(\vec{r},t)}{\partial t} = \hat{H} \psi(\vec{r},t)
$$<p>
that is,
</p>
$$
i\hbar \frac{\partial \psi(\vec{r},t)}{\partial t} = \left[ -\frac{\hbar^2}{2m}\nabla^2 + V(\vec{r},t) \right] \psi(\vec{r},t)
$$<p>For a free particle ($V=0$), this reduces to
</p>
$$
i\hbar \frac{\partial \psi}{\partial t} = -\frac{\hbar^2}{2m}\nabla^2 \psi
$$<h4 id="principle-of-superposition-of-states">
<a class="header-anchor" href="#principle-of-superposition-of-states"></a>
Principle of Superposition of States
</h4><p><strong>Concept</strong><br>
If $\psi_1$ and $\psi_2$ are two possible states of the same system, then their linear combination
</p>
$$
\psi = c_1 \psi_1 + c_2 \psi_2
$$<p>
is also a possible state, where $c_1$ and $c_2$ are complex coefficients.</p>
<p><strong>General expansion</strong>
</p>
$$
\psi(\vec{r},t) = \sum_{n} c_n \phi_n(\vec{r},t)
$$<p>
with</p>
<ul>
<li>$c_n$ the expansion coefficients, or probability amplitudes;</li>
<li>probabilities $|c_n|^2$ satisfying

$$
\sum_n |c_n|^2 = 1
$$</li>
</ul>
<p><strong>Remark</strong></p>
<ul>
<li>Superposition is one of the most fundamental principles of quantum mechanics.</li>
<li>Different eigenstates may superpose, but a measurement yields only one eigenvalue.</li>
<li>Interference in superposed states is one of the essential features that distinguishes quantum mechanics from classical mechanics.</li>
</ul>
<h2 id="chapter-2-simple-applications-of-the-schrödinger-equation">
<a class="header-anchor" href="#chapter-2-simple-applications-of-the-schr%c3%b6dinger-equation"></a>
Chapter 2 Simple Applications of the Schrödinger Equation
</h2><h3 id="21-one-dimensional-infinite-potential-well">
<a class="header-anchor" href="#21-one-dimensional-infinite-potential-well"></a>
2.1 One-Dimensional Infinite Potential Well
</h3><h4 id="211-solving-the-equation">
<a class="header-anchor" href="#211-solving-the-equation"></a>
2.1.1 Solving the Equation
</h4><p><strong>1. Potential</strong>
</p>
$$
V(x) =
\begin{cases}
0, & 0 < x < L \\
\infty, & x \leq 0 \ \text{or} \ x \geq L
\end{cases}
$$<p><strong>2. Schrödinger equation in the well</strong>
</p>
$$
-\frac{\hbar^2}{2m} \frac{d^2 \phi(x)}{dx^2} = E \phi(x)
$$<p>
which becomes
</p>
$$
\frac{d^2 \phi(x)}{dx^2} + k^2 \phi(x) = 0,\qquad
k^2 = \frac{2mE}{\hbar^2}
$$<p><strong>3. General solution</strong>
</p>
$$
\phi(x) = A \sin(kx) + B \cos(kx)
$$<p><strong>4. Boundary conditions</strong>
</p>
$$
\phi(0) = 0, \quad \phi(L) = 0
$$<p>
Hence $B=0$ and $kL = n\pi$ for $n=1,2,3,\dots$.</p>
<p><strong>5. Eigenfunctions and eigenvalues</strong>
</p>
$$
\phi_n(x) = \sqrt{\frac{2}{L}} \sin\left(\frac{n\pi x}{L}\right), \quad n=1,2,3,\dots
$$<p>
</p>
$$
E_n = \frac{n^2 \pi^2 \hbar^2}{2mL^2}, \quad n=1,2,3,\dots
$$<p><strong>Remark</strong></p>
<ul>
<li>The energy is quantized.</li>
<li>The ground-state energy is nonzero, showing the zero-point energy.</li>
</ul>
<hr>
<h3 id="22-special-functions-in-mathematical-physics">
<a class="header-anchor" href="#22-special-functions-in-mathematical-physics"></a>
2.2 Special Functions in Mathematical Physics
</h3><h4 id="221-orthogonality-and-normalization">
<a class="header-anchor" href="#221-orthogonality-and-normalization"></a>
2.2.1 Orthogonality and Normalization
</h4><p><strong>Orthogonality</strong>
</p>
$$
\int_a^b \phi_m(x)\,\phi_n(x)\,dx = 0 \quad (m \neq n)
$$<p><strong>Normalization</strong>
</p>
$$
\int_a^b |\phi_n(x)|^2 dx = 1
$$<p><strong>Orthonormality</strong>
</p>
$$
\int_a^b \phi_m(x)\,\phi_n(x)\,dx = \delta_{mn}
$$<h4 id="222-expansion-in-an-orthonormal-set">
<a class="header-anchor" href="#222-expansion-in-an-orthonormal-set"></a>
2.2.2 Expansion in an Orthonormal Set
</h4>$$
f(x) = \sum_{n=1}^{\infty} c_n \phi_n(x), \qquad
c_n = \int_a^b f(x)\,\phi_n(x)\,dx
$$<h4 id="223-fourier-series">
<a class="header-anchor" href="#223-fourier-series"></a>
2.2.3 Fourier Series
</h4>$$
f(x) = \frac{a_0}{2} + \sum_{n=1}^\infty \left[ a_n \cos\left(\frac{n\pi x}{L}\right) + b_n \sin\left(\frac{n\pi x}{L}\right) \right]
$$<p>
where
</p>
$$
a_n = \frac{1}{L} \int_{-L}^L f(x)\cos\left(\frac{n\pi x}{L}\right)\,dx, \quad
b_n = \frac{1}{L} \int_{-L}^L f(x)\sin\left(\frac{n\pi x}{L}\right)\,dx
$$<h4 id="224-constructing-orthonormal-functions">
<a class="header-anchor" href="#224-constructing-orthonormal-functions"></a>
2.2.4 Constructing Orthonormal Functions
</h4><p>The standard method is <strong>Gram-Schmidt orthogonalization</strong>:
</p>
$$
\phi_1(x) = \frac{f_1(x)}{\sqrt{\int |f_1(x)|^2 dx}}
$$<p>
</p>
$$
\phi_2(x) = \frac{f_2(x) - \int \phi_1(x) f_2(x)\,dx \,\phi_1(x)}{\sqrt{\int \left|f_2(x) - \int \phi_1(x) f_2(x)\,dx \,\phi_1(x)\right|^2 dx}}
$$<h4 id="225-legendre-polynomials-and-other-special-functions">
<a class="header-anchor" href="#225-legendre-polynomials-and-other-special-functions"></a>
2.2.5 Legendre Polynomials and Other Special Functions
</h4><p><strong>Legendre polynomials</strong>
</p>
$$
(1-x^2)\frac{d^2 y}{dx^2} - 2x \frac{dy}{dx} + l(l+1)y = 0
$$<p>
with orthogonality
</p>
$$
\int_{-1}^{1} P_l(x) P_{l'}(x)\,dx = \frac{2}{2l+1}\delta_{ll'}
$$<p><strong>Other common special functions</strong></p>
<ul>
<li><strong>Spherical harmonics</strong> $Y_l^m(\theta,\phi)$ appear in angular momentum problems.</li>
<li><strong>Bessel functions</strong> $J_n(x)$ appear in cylindrical symmetry problems.</li>
<li><strong>Hermite polynomials</strong> $H_n(x)$ appear in harmonic oscillator problems.</li>
</ul>
<p>These special functions are solutions of the Schrödinger equation under different boundary conditions and symmetries.</p>
<hr>
<h3 id="23-linear-harmonic-oscillator">
<a class="header-anchor" href="#23-linear-harmonic-oscillator"></a>
2.3 Linear Harmonic Oscillator
</h3><hr>
<h3 id="24-hydrogen-atom">
<a class="header-anchor" href="#24-hydrogen-atom"></a>
2.4 Hydrogen Atom
</h3><h4 id="241-solution-of-the-equation-separated-into--parts">
<a class="header-anchor" href="#241-solution-of-the-equation-separated-into--parts"></a>
2.4.1 Solution of the Equation (Separated into $r,\ \theta,\ \phi$ Parts)
</h4><p><strong>1. Time-independent Schrödinger equation under a Coulomb potential</strong>
</p>
$$
V(r) = -\dfrac{e^2}{4\pi\varepsilon_0 r}
$$<p>
and
</p>
$$
-\dfrac{\hbar^2}{2m}\nabla^2\Psi(r,\theta,\phi) + V(r)\Psi = E\Psi.
$$<p><strong>2. Separation of variables</strong>
</p>
$$
\Psi(r,\theta,\phi)=R(r)\,Y(\theta,\phi).
$$<p>
This leads to three equations in $r$, $\theta$, and $\phi$ after separation.</p>
<p><strong>3. Equation in $\phi$</strong>
</p>
$$
\frac{1}{\Phi(\phi)}\frac{d^2\Phi}{d\phi^2} = -m^2 \quad\Rightarrow\quad
\Phi_m(\phi)=\frac{1}{\sqrt{2\pi}} e^{i m\phi},\quad m\in\mathbb{Z}.
$$<p><strong>4. Equation in $\theta$</strong>
</p>
$$
\frac{1}{\sin\theta}\frac{d}{d\theta}\!\left(\sin\theta\frac{d\Theta}{d\theta}\right)
+\left[l(l+1)-\frac{m^2}{\sin^2\theta}\right]\Theta=0
$$<p>
with solutions proportional to the associated Legendre functions:
</p>
$$
\Theta_{l}^{m}(\theta)\propto P_l^{m}(\cos\theta).
$$<p><strong>5. Angular part: spherical harmonics</strong>
</p>
$$
Y_l^m(\theta,\phi)=N_{l}^{m}\,P_l^{m}(\cos\theta)\,e^{im\phi},
$$<p>
which satisfy
</p>
$$
\hat L^2 Y_l^m = l(l+1)\hbar^2 Y_l^m,\qquad \hat L_z Y_l^m = m\hbar Y_l^m.
$$<p><strong>6. Radial equation</strong>
Let $u(r)=rR(r)$, then
</p>
$$
-\frac{\hbar^2}{2m}\frac{d^2 u}{dr^2} + \left[ -\frac{e^2}{4\pi\varepsilon_0 r} + \frac{\hbar^2 l(l+1)}{2m r^2} \right] u = E u.
$$<p><strong>7. Energy eigenvalues</strong>
</p>
$$
E_n = -\frac{m e^4}{2(4\pi\varepsilon_0)^2 \hbar^2}\,\frac{1}{n^2} = -\frac{13.6057\ \mathrm{eV}}{n^2},\qquad n=1,2,3,\dots
$$<p>
with $l=0,1,\dots,n-1$.</p>
<p><strong>8. Wave function</strong>
</p>
$$
\Psi_{n l m}(r,\theta,\phi)=R_{n l}(r)\,Y_l^m(\theta,\phi),
$$<p>
and
</p>
$$
R_{n l}(r)=N_{n l}\left(\frac{2r}{n a_0}\right)^{l} e^{-r/(n a_0)} L_{n-l-1}^{2l+1}\!\left(\frac{2r}{n a_0}\right),
$$<p>
where $a_0=\dfrac{4\pi\varepsilon_0\hbar^2}{m e^2}$ is the Bohr radius.</p>
<h4 id="242-results-and-discussion">
<a class="header-anchor" href="#242-results-and-discussion"></a>
2.4.2 Results and Discussion
</h4><p><strong>1. Quantum numbers and their meanings</strong></p>
<ul>
<li>$n$: principal quantum number</li>
<li>$l$: orbital angular momentum quantum number</li>
<li>$m$: magnetic quantum number</li>
</ul>
<p><strong>2. Degeneracy</strong><br>
For the Coulomb potential, the energy depends only on $n$. The degeneracy of the level with principal quantum number $n$ is $n^2$.</p>
<p><strong>3. Spatial structure of the wave function</strong></p>
<ul>
<li>The angular part is given by the spherical harmonics.</li>
<li>The radial part $R_{nl}(r)$ has $n-l-1$ radial nodes.</li>
<li>The ground state $(1,0,0)$ is spherically symmetric and has no radial node.</li>
</ul>
<p><strong>4. Summary</strong><br>
The hydrogen atom is solved by separating variables in spherical coordinates. The angular equations give spherical harmonics and angular quantum numbers, while the radial equation yields the discrete energy levels and radial eigenfunctions.</p>
<h2 id="chapter-3-operator-representation-of-dynamical-variables-and-representation-theory">
<a class="header-anchor" href="#chapter-3-operator-representation-of-dynamical-variables-and-representation-theory"></a>
Chapter 3 Operator Representation of Dynamical Variables and Representation Theory
</h2><h3 id="31-relation-between-dynamical-variables-and-operators">
<a class="header-anchor" href="#31-relation-between-dynamical-variables-and-operators"></a>
3.1 Relation Between Dynamical Variables and Operators
</h3><h4 id="311-mathematical-knowledge-of-operators">
<a class="header-anchor" href="#311-mathematical-knowledge-of-operators"></a>
3.1.1 Mathematical Knowledge of Operators
</h4><ol>
<li>
<p><strong>Definition of an operator</strong><br>
An operator is a rule acting on a function space or state space. In quantum mechanics, physical quantities are represented by operators, and the wave function is the object on which they act.</p>
</li>
<li>
<p><strong>Linearity</strong><br>
If
</p>
$$
   A(c_1\psi_1 + c_2\psi_2) = c_1 A\psi_1 + c_2 A\psi_2,
   $$<p>
then $A$ is a linear operator.</p>
</li>
<li>
<p><strong>Commutation relations</strong><br>
The commutator is defined by
</p>
$$
   [A,B] = AB - BA.
   $$<p>
If $[A,B]=0$, the two operators are said to commute.</p>
</li>
<li>
<p><strong>Hermitian operators</strong><br>
If
</p>
$$
   \langle \psi | A\varphi \rangle = \langle A\psi | \varphi \rangle,
   $$<p>
then $A$ is Hermitian. Hermitian operators have real eigenvalues and represent observables.</p>
</li>
</ol>
<h4 id="312-dynamical-variables-and-operators">
<a class="header-anchor" href="#312-dynamical-variables-and-operators"></a>
3.1.2 Dynamical Variables and Operators
</h4><ol>
<li>
<p><strong>Basic idea</strong><br>
Every classical quantity $f(q,p)$ corresponds to a quantum operator $\hat f$.</p>
</li>
<li>
<p><strong>Typical operator forms in the coordinate representation</strong>
</p>
$$
   \hat{x} = x, \qquad \hat{p} = -i\hbar \frac{\partial}{\partial x}
   $$</li>
<li>
<p><strong>Fundamental commutation relation</strong>
</p>
$$
   [\hat{x}, \hat{p}] = i\hbar
   $$</li>
<li>
<p><strong>Measurement and eigenvalue equations</strong>
</p>
$$
   \hat{A}\psi_a = a\psi_a
   $$<p>
Here $a$ is a possible measurement outcome, and $\psi_a$ is the corresponding eigenfunction.</p>
</li>
</ol>
<hr>
<h3 id="32-commutation-relations-and-the-uncertainty-principle">
<a class="header-anchor" href="#32-commutation-relations-and-the-uncertainty-principle"></a>
3.2 Commutation Relations and the Uncertainty Principle
</h3><h4 id="321-commutation-relations">
<a class="header-anchor" href="#321-commutation-relations"></a>
3.2.1 Commutation Relations
</h4><ol>
<li>
<p><strong>Definition</strong>
</p>
$$
   [A,B] = AB - BA
   $$<p>
If $[A,B]=0$, the two physical quantities can have simultaneous definite values.</p>
</li>
<li>
<p><strong>Basic relation</strong>
</p>
$$
   [\hat{x}, \hat{p}_x] = i\hbar
   $$</li>
<li>
<p><strong>Three-dimensional form</strong>
</p>
$$
   [\hat{x}_i, \hat{p}_j] = i\hbar \delta_{ij}, \quad [\hat{x}_i, \hat{x}_j]=0, \quad [\hat{p}_i, \hat{p}_j]=0
   $$</li>
<li>
<p><strong>Physical meaning</strong><br>
Commutation relations determine whether two observables can be measured simultaneously with arbitrary precision.</p>
</li>
</ol>
<h4 id="322-uncertainty-principle">
<a class="header-anchor" href="#322-uncertainty-principle"></a>
3.2.2 Uncertainty Principle
</h4><ol>
<li>
<p><strong>Mathematical form</strong>
</p>
$$
   (\Delta A)^2 = \langle (A-\langle A \rangle)^2 \rangle,\qquad
   (\Delta B)^2 = \langle (B-\langle B \rangle)^2 \rangle
   $$<p>
which leads to
</p>
$$
   \Delta A \cdot \Delta B \geq \frac{1}{2}\left| \langle [A,B] \rangle \right|
   $$</li>
<li>
<p><strong>Position-momentum uncertainty</strong>
</p>
$$
   \Delta x \cdot \Delta p \geq \frac{\hbar}{2}
   $$</li>
<li>
<p><strong>Energy-time uncertainty</strong>
</p>
$$
   \Delta E \cdot \Delta t \gtrsim \hbar
   $$</li>
</ol>
<hr>
<h3 id="33-representation-theory">
<a class="header-anchor" href="#33-representation-theory"></a>
3.3 Representation Theory
</h3><h4 id="331-mathematical-basis">
<a class="header-anchor" href="#331-mathematical-basis"></a>
3.3.1 Mathematical Basis
</h4><ol>
<li>
<p><strong>Concept of representation</strong><br>
States and operators can be represented in different bases, such as the coordinate, momentum, and energy representations.</p>
</li>
<li>
<p><strong>Expansion of a state</strong>
</p>
$$
   |\psi\rangle = \sum_n c_n |\phi_n\rangle,\qquad c_n = \langle \phi_n | \psi \rangle
   $$</li>
<li>
<p><strong>Matrix elements</strong>
</p>
$$
   A_{mn} = \langle \phi_m | \hat{A} | \phi_n \rangle
   $$</li>
<li>
<p><strong>Completeness and orthogonality</strong>
</p>
$$
   \sum_n |\phi_n\rangle \langle \phi_n| = I,\qquad
   \langle \phi_m | \phi_n \rangle = \delta_{mn}
   $$</li>
</ol>
<h4 id="332-representations-of-states-and-observables">
<a class="header-anchor" href="#332-representations-of-states-and-observables"></a>
3.3.2 Representations of States and Observables
</h4><ol>
<li>
<p><strong>Coordinate representation</strong>
</p>
$$
   \psi(x) = \langle x|\psi\rangle
   $$<p>
</p>
$$
   \hat{x} \psi(x) = x \psi(x), \quad \hat{p}_x \psi(x) = -i\hbar \frac{\partial}{\partial x}\psi(x)
   $$</li>
<li>
<p><strong>Momentum representation</strong>
</p>
$$
   \phi(p) = \langle p|\psi\rangle
   $$<p>
</p>
$$
   \hat{p} \phi(p) = p \phi(p), \quad \hat{x} \phi(p) = i\hbar \frac{\partial}{\partial p}\phi(p)
   $$</li>
<li>
<p><strong>Energy representation</strong>
</p>
$$
   |\psi\rangle = \sum_n c_n |E_n\rangle, \quad c_n = \langle E_n|\psi\rangle
   $$</li>
<li>
<p><strong>Transformations between representations</strong>
</p>
$$
   \phi(p) = \frac{1}{\sqrt{2\pi\hbar}} \int_{-\infty}^{\infty} \psi(x) e^{-ipx/\hbar} dx
   $$<p>
</p>
$$
   \psi(x) = \frac{1}{\sqrt{2\pi\hbar}} \int_{-\infty}^{\infty} \phi(p) e^{ipx/\hbar} dp
   $$</li>
</ol>
<h3 id="34-orbital-angular-momentum">
<a class="header-anchor" href="#34-orbital-angular-momentum"></a>
3.4 Orbital Angular Momentum
</h3><h4 id="341-angular-momentum">
<a class="header-anchor" href="#341-angular-momentum"></a>
3.4.1 Angular Momentum
</h4><ol>
<li>
<p><strong>Definition</strong>
</p>
$$
   \vec{L} = \vec{r} \times \vec{p},\qquad
   \hat{\vec{L}} = \hat{\vec{r}} \times \hat{\vec{p}}
   $$</li>
<li>
<p><strong>Components</strong>
</p>
$$
   \hat{L}_x = y\hat{p}_z - z\hat{p}_y, \quad
   \hat{L}_y = z\hat{p}_x - x\hat{p}_z, \quad
   \hat{L}_z = x\hat{p}_y - y\hat{p}_x
   $$</li>
<li>
<p><strong>Commutation relations</strong>
</p>
$$
   [\hat{L}_x, \hat{L}_y] = i\hbar \hat{L}_z, \quad
   [\hat{L}_y, \hat{L}_z] = i\hbar \hat{L}_x, \quad
   [\hat{L}_z, \hat{L}_x] = i\hbar \hat{L}_y
   $$<p>
</p>
$$
   \hat{L}^2 = \hat{L}_x^2 + \hat{L}_y^2 + \hat{L}_z^2
   $$</li>
</ol>
<h4 id="342-conservation-of-angular-momentum">
<a class="header-anchor" href="#342-conservation-of-angular-momentum"></a>
3.4.2 Conservation of Angular Momentum
</h4><ol>
<li>
<p><strong>Condition for conservation</strong>
</p>
$$
   [\hat{H}, \hat{L}_i] = 0 \quad \Rightarrow \quad \hat{L}_i \ \text{is conserved}
   $$</li>
<li>
<p><strong>Spherically symmetric potential</strong>
</p>
$$
   [\hat{H}, \hat{L}^2] = 0, \quad [\hat{H}, \hat{L}_z] = 0
   $$</li>
</ol>
<h4 id="343-calculation-of-orbital-angular-momentum">
<a class="header-anchor" href="#343-calculation-of-orbital-angular-momentum"></a>
3.4.3 Calculation of Orbital Angular Momentum
</h4><ol>
<li>
<p><strong>Eigenvalue equations</strong>
</p>
$$
   \hat{L}^2 Y_{lm}(\theta,\varphi) = l(l+1)\hbar^2 Y_{lm}(\theta,\varphi)
   $$<p>
</p>
$$
   \hat{L}_z Y_{lm}(\theta,\varphi) = m\hbar Y_{lm}(\theta,\varphi)
   $$</li>
<li>
<p><strong>Eigenvalues</strong>
</p>
$$
   L = \sqrt{l(l+1)} \hbar,\qquad L_z = m\hbar
   $$</li>
<li>
<p><strong>Physical meaning</strong><br>
The quantum numbers $l$ and $m$ determine the magnitude of the orbital angular momentum and its $z$-component, respectively.</p>
</li>
</ol>
<h2 id="chapter-4-perturbation-theory-and-its-applications">
<a class="header-anchor" href="#chapter-4-perturbation-theory-and-its-applications"></a>
Chapter 4 Perturbation Theory and Its Applications
</h2><h3 id="41-time-independent-perturbation-theory">
<a class="header-anchor" href="#41-time-independent-perturbation-theory"></a>
4.1 Time-Independent Perturbation Theory
</h3><h4 id="411-nondegenerate-perturbation-theory">
<a class="header-anchor" href="#411-nondegenerate-perturbation-theory"></a>
4.1.1 Nondegenerate Perturbation Theory
</h4><ol>
<li>
<p><strong>Basic idea</strong>
</p>
$$
   \hat{H} = \hat{H}^{(0)} + \lambda \hat{H}'
   $$</li>
<li>
<p><strong>Energy corrections</strong>
</p>
$$
   E_n^{(1)} = \langle \psi_n^{(0)} | \hat{H}' | \psi_n^{(0)} \rangle
   $$<p>
</p>
$$
   E_n^{(2)} = \sum_{m \neq n} \frac{|\langle \psi_m^{(0)} | \hat{H}' | \psi_n^{(0)} \rangle|^2}{E_n^{(0)} - E_m^{(0)}}
   $$</li>
<li>
<p><strong>Wave-function correction</strong>
</p>
$$
   \psi_n^{(1)} = \sum_{m \neq n} \frac{\langle \psi_m^{(0)} | \hat{H}' | \psi_n^{(0)} \rangle}{E_n^{(0)} - E_m^{(0)}} \psi_m^{(0)}
   $$</li>
</ol>
<h4 id="412-degenerate-perturbation-theory">
<a class="header-anchor" href="#412-degenerate-perturbation-theory"></a>
4.1.2 Degenerate Perturbation Theory
</h4><ol>
<li>
<p><strong>Origin of the problem</strong><br>
If the zeroth-order energy corresponds to multiple orthogonal eigenstates, the state is degenerate, and the nondegenerate formulas fail.</p>
</li>
<li>
<p><strong>Method</strong>
</p>
$$
   H'_{ij} = \langle \psi_i^{(0)} | \hat{H}' | \psi_j^{(0)} \rangle
   $$<p>
Diagonalize this matrix inside the degenerate subspace.</p>
</li>
<li>
<p><strong>Result</strong><br>
The first-order energy corrections are the eigenvalues of $H'_{ij}$, and the corrected states are the corresponding linear combinations.</p>
</li>
</ol>
<hr>
<h3 id="42-time-dependent-perturbation-theory">
<a class="header-anchor" href="#42-time-dependent-perturbation-theory"></a>
4.2 Time-Dependent Perturbation Theory
</h3><ol>
<li>
<p><strong>Basic framework</strong>
</p>
$$
   \hat{H}(t) = \hat{H}^{(0)} + \hat{H}'(t)
   $$</li>
<li>
<p><strong>State expansion</strong>
</p>
$$
   |\psi(t)\rangle = \sum_n c_n(t) e^{-iE_n^{(0)}t/\hbar} |\psi_n^{(0)}\rangle
   $$</li>
<li>
<p><strong>Transition probability amplitude</strong>
</p>
$$
   c_f^{(1)}(t) = \frac{1}{i\hbar} \int_0^t \langle \psi_f^{(0)} | \hat{H}'(t') | \psi_i^{(0)} \rangle 
   e^{i\omega_{fi} t'} dt'
   $$<p>
where $\omega_{fi} = (E_f^{(0)} - E_i^{(0)})/\hbar$.</p>
</li>
<li>
<p><strong>Fermi&rsquo;s golden rule</strong>
</p>
$$
   W_{i \to f} = \frac{2\pi}{\hbar} \, |\langle f | \hat{H}' | i \rangle|^2 \, \rho(E_f)
   $$</li>
</ol>
<p><strong>Summary</strong></p>
<ul>
<li>Time-independent perturbation theory corrects energies and wave functions for static perturbations.</li>
<li>Time-dependent perturbation theory describes transitions between energy levels, such as radiation absorption and emission.</li>
</ul>
<h2 id="electron-spin">
<a class="header-anchor" href="#electron-spin"></a>
Electron Spin
</h2><h3 id="experimental-discovery-of-electron-spin">
<a class="header-anchor" href="#experimental-discovery-of-electron-spin"></a>
Experimental Discovery of Electron Spin
</h3><ol>
<li>
<p><strong>Stern-Gerlach experiment</strong><br>
Passing a beam of silver atoms through a nonuniform magnetic field produces two trajectories, revealing an intrinsic angular momentum beyond orbital angular momentum.</p>
</li>
<li>
<p><strong>Experimental conclusions</strong></p>
<ul>
<li>The spin quantum number is $s = 1/2$.</li>
<li>The two possible spin projections are $m_s = \pm 1/2$.</li>
<li>Spin contributes an additional magnetic moment:

$$
     \vec{\mu}_s = -g_s \frac{e}{2m_e} \vec{S}, \quad g_s \approx 2
     $$</li>
</ul>
</li>
</ol>
<h3 id="theory-of-electron-spin">
<a class="header-anchor" href="#theory-of-electron-spin"></a>
Theory of Electron Spin
</h3><ol>
<li>
<p><strong>Quantum description</strong></p>
<ul>
<li>Spin is intrinsic angular momentum and does not depend on spatial coordinates.</li>
<li>Its operators satisfy

$$
     [\hat{S}_i, \hat{S}_j] = i\hbar \epsilon_{ijk} \hat{S}_k
     $$</li>
</ul>
</li>
<li>
<p><strong>Physical meaning</strong></p>
<ul>
<li>Spin determines the magnetic behavior of electrons.</li>
<li>Quantized spin leads to Fermi-Dirac statistics and the Pauli exclusion principle.</li>
</ul>
</li>
</ol>
<hr>
<h3 id="spin-angular-momentum">
<a class="header-anchor" href="#spin-angular-momentum"></a>
Spin Angular Momentum
</h3><h4 id="spin-operators">
<a class="header-anchor" href="#spin-operators"></a>
Spin Operators
</h4><ol>
<li>
<p><strong>Spin components</strong>
</p>
$$
   \hat{S}_x, \hat{S}_y, \hat{S}_z
   $$<p>
satisfying
</p>
$$
   [\hat{S}_x, \hat{S}_y] = i\hbar \hat{S}_z, \quad \text{cyclic symmetry}
   $$</li>
<li>
<p><strong>Total spin operator</strong>
</p>
$$
   \hat{S}^2 = \hat{S}_x^2 + \hat{S}_y^2 + \hat{S}_z^2
   $$<p>
with
</p>
$$
   \hat{S}^2 |\chi_s\rangle = s(s+1)\hbar^2 |\chi_s\rangle
   $$</li>
</ol>
<h4 id="matrix-representation-of-eigenfunctions">
<a class="header-anchor" href="#matrix-representation-of-eigenfunctions"></a>
Matrix Representation of Eigenfunctions
</h4><ol>
<li>
<p><strong>Spin-$1/2$ particles</strong>
</p>
$$
   |\uparrow\rangle = \begin{pmatrix}1\\0\end{pmatrix}, \quad
   |\downarrow\rangle = \begin{pmatrix}0\\1\end{pmatrix}
   $$</li>
<li>
<p><strong>Pauli-matrix form of the spin operators</strong>
</p>
$$
   \hat{S}_x = \frac{\hbar}{2} \sigma_x, \quad
   \hat{S}_y = \frac{\hbar}{2} \sigma_y, \quad
   \hat{S}_z = \frac{\hbar}{2} \sigma_z
   $$<p>
where
</p>
$$
   \sigma_x = \begin{pmatrix}0 & 1\\ 1 & 0\end{pmatrix},\quad
   \sigma_y = \begin{pmatrix}0 & -i\\ i & 0\end{pmatrix},\quad
   \sigma_z = \begin{pmatrix}1 & 0\\ 0 & -1\end{pmatrix}
   $$</li>
</ol>
<h4 id="theory-of-angular-momentum-coupling">
<a class="header-anchor" href="#theory-of-angular-momentum-coupling"></a>
Theory of Angular Momentum Coupling
</h4><ol>
<li>
<p><strong>Spin-orbit coupling</strong>
</p>
$$
   \hat{H}_{\text{SO}} = \xi(r)\, \vec{L} \cdot \vec{S}
   $$<p>
which produces fine-structure splitting.</p>
</li>
<li>
<p><strong>Total angular momentum</strong>
</p>
$$
   \vec{J} = \vec{L} + \vec{S}, \quad
   \hat{J}^2 = (\hat{L}+\hat{S})^2
   $$<p>
with eigenstates $|j, m_j\rangle$ satisfying
</p>
$$
   \hat{J}^2 |j, m_j\rangle = j(j+1)\hbar^2 |j, m_j\rangle, \quad
   \hat{J}_z |j, m_j\rangle = m_j \hbar |j, m_j\rangle
   $$</li>
<li>
<p><strong>Coupling result</strong></p>
<ul>
<li>$j = l \pm s$, $m_j = -j, -j+1, ..., j$.</li>
<li>Spin-orbit coupling is an important source of the fine structure of atomic spectra.</li>
</ul>
</li>
</ol>
<h2 id="principle-of-indistinguishability">
<a class="header-anchor" href="#principle-of-indistinguishability"></a>
Principle of Indistinguishability
</h2><h3 id="systems-of-identical-particles">
<a class="header-anchor" href="#systems-of-identical-particles"></a>
Systems of Identical Particles
</h3><h4 id="concepts-and-principles">
<a class="header-anchor" href="#concepts-and-principles"></a>
Concepts and Principles
</h4><ol>
<li>
<p><strong>Definition of identical particles</strong><br>
If two particles are completely identical in physical properties such as mass, charge, and spin, and cannot be distinguished by any experiment, they are called identical particles.</p>
</li>
<li>
<p><strong>Principle of indistinguishability</strong><br>
The physical laws are invariant under exchange of identical particles. Exchanging the positions and spins of any two identical particles leaves the Hamiltonian and observables unchanged.</p>
</li>
</ol>
<h4 id="hamiltonian-of-a-system-of-identical-particles">
<a class="header-anchor" href="#hamiltonian-of-a-system-of-identical-particles"></a>
Hamiltonian of a System of Identical Particles
</h4><ol>
<li>
<p><strong>Form</strong>
</p>
$$
   \hat{H} = \sum_{i=1}^N \hat{T}_i + \sum_{i<j} V(\vec{r}_i - \vec{r}_j)
   $$</li>
<li>
<p><strong>Symmetry</strong>
</p>
$$
   [\hat{H}, \hat{P}_{ij}] = 0
   $$<p>
where $\hat{P}_{ij}$ is the exchange operator of particles $i$ and $j$.</p>
</li>
</ol>
<h4 id="wave-functions-of-identical-particle-systems">
<a class="header-anchor" href="#wave-functions-of-identical-particle-systems"></a>
Wave Functions of Identical-Particle Systems
</h4><ol>
<li>
<p><strong>Symmetry requirement</strong>
</p>
$$
   \hat{P}_{ij} \Psi(\dots, \vec{r}_i, \vec{r}_j, \dots) =
   \pm \Psi(\dots, \vec{r}_i, \vec{r}_j, \dots)
   $$<ul>
<li><strong>+</strong> for bosons, whose wave functions are symmetric</li>
<li><strong>-</strong> for fermions, whose wave functions are antisymmetric</li>
</ul>
</li>
<li>
<p><strong>Construction of many-particle wave functions</strong></p>
<ul>
<li>Bosons: symmetrized sum</li>
<li>Fermions: antisymmetrized determinant (Slater determinant)

$$
     \Psi(\vec{r}_1, \dots, \vec{r}_N) = \frac{1}{\sqrt{N!}}
     \begin{vmatrix}
     \psi_1(\vec{r}_1) & \cdots & \psi_1(\vec{r}_N) \\
     \vdots & \ddots & \vdots \\
     \psi_N(\vec{r}_1) & \cdots & \psi_N(\vec{r}_N)
     \end{vmatrix}
     $$</li>
</ul>
</li>
</ol>
<hr>
<h3 id="pauli-exclusion-principle">
<a class="header-anchor" href="#pauli-exclusion-principle"></a>
Pauli Exclusion Principle
</h3><ol>
<li>
<p><strong>Content of the principle</strong><br>
For identical fermions with half-integer spin, no two particles may occupy the same quantum state:
</p>
$$
   \Psi(\text{same quantum state}) = 0
   $$</li>
<li>
<p><strong>Physical meaning</strong><br>
It explains the arrangement of electrons in atomic orbitals and underlies atomic structure, chemical properties, and Fermi-gas behavior.</p>
</li>
<li>
<p><strong>Examples</strong></p>
<ul>
<li>In atoms, each orbital can hold at most two electrons with opposite spins.</li>
<li>In metals, electrons form a Fermi level that determines electrical and thermal properties.</li>
</ul>
</li>
</ol>

        
        <hr><p>Published on 2025-09-05 at <a href='https://www.guzhengsvt.cn/'>孤筝の温暖小家</a>, last modified on 2025-09-05</p><p>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</p>]]></description><category>Physics</category></item><item><title>Postgrad Exam Diary 001</title><link>https://www.guzhengsvt.cn/en/post/diary/diary-001-of-postgraduate-entrance-examination/</link><pubDate>Mon, 01 Sep 2025 22:44:15 +0800</pubDate><author>lvbowen040427@163.com (孤筝)</author><guid>https://www.guzhengsvt.cn/en/post/diary/diary-001-of-postgraduate-entrance-examination/</guid><description>
<![CDATA[<h1>Postgrad Exam Diary 001</h1><p>Author: 孤筝(lvbowen040427@163.com)</p>
        
          <h2 id="preface">
<a class="header-anchor" href="#preface"></a>
Preface
</h2><p>For various reasons, I have no choice now but to prepare for the postgraduate entrance exam.<br>
This diary is both a review of each day&rsquo;s study and a place where I can talk into the void a little. I first thought of naming it Day 1, but then I realized I would not have time to write every day, nor would I necessarily have something to write every day. There will always be days of slackness and days too busy for words. So I kept it as 001.</p>
<p>To be honest, I never truly believed I could start now and get in within three months. Speaking without much ambition, someone like me, who does not plan to marry, does not plan to buy a house, and supposedly has low material desire, can probably afford to keep trying for several years. This year is more of a trial run. I do not feel much pressure myself, but my parents are very anxious because my attempt at direct PhD admission failed.</p>
<p>Today was only my third time going to the university library. The first time was when I had just entered XDU and came to look around, and the second was for a meeting.<br>
Ever since that first visit to the so-called rat-slaying library, I have felt it was not a place that suited me for studying. The atmosphere is too serious and oppressive. I sit stiffly in the chair, worrying that I might make a sound and disturb others, and I keep wondering whether the people around me are watching to see if I am actually studying. It feels as if even glancing at my phone is a crime. I know that is only in my head and in fact nobody cares, but a place full of strangers that is this quiet really makes a socially anxious person tense up. It feels nothing like self-study sessions in high school.<br>
Thankfully the library has neither Big Brother&rsquo;s eyes nor Miss Yang recording videos with her phone. If only 0721&rsquo;s 凌地宁宁 were here.</p>
<p>I started with Math I. This year I plan to follow Wu Zhongxiang and jump straight into the intensive course. I watched two chapters in one day. Maybe because it has been too long since I last used my brain properly for study, I get sleepy as soon as I start learning. Fortunately, the first two chapters on functions and limits were not difficult, and only today did I realize how much my old Mathematical Analysis course had helped me. Back then I thought that course, so theoretical and science-oriented, was useless for my engineering major. I fell behind, then wanted to study it even less, because it was simply too hard. In the end the teacher helped me through the makeup exam and gave me a passing score in the sixties. But Mathematical Analysis did not only give me proofs of basic theorems. It was not just a toy for mathematicians. It was also training and enlightenment for the mind. Shame on me, truly.</p>
<p>I have never been the type to take notes. Anything with internal logic I usually keep only in my head. But memory fades with time. I am no longer living the kind of life where I review everything every day like in high school, so I should write down some knowledge now and then for later review.</p>
<h2 id="review">
<a class="header-anchor" href="#review"></a>
Review
</h2><h3 id="functions">
<a class="header-anchor" href="#functions"></a>
Functions
</h3><ul>
<li>
<p>Basic elements of a function: domain, mapping rule</p>
</li>
<li>
<p>Properties of functions: monotonicity, parity, periodicity, boundedness</p>
</li>
<li>
<p>Odd functions
</p>
$$
ln{\frac{1-x}{1+x}},ln(x+\sqrt[2]{1+x^2}),\frac{e^x-1}{e^x+1},f(x)-f(-x)
$$</li>
<li>
<p>Even functions
</p>
$$
f(x)+f(-x)
$$</li>
<li>
<p>If $f(x)$ is odd, then $\int ^x_0 f(x)dx+C$ is even</p>
</li>
<li>
<p>If $f(x)$ is even, then $\int ^x_0 f(x)dx+C$ is odd only when $C=0$</p>
</li>
<li>
<p>The derivative of a differentiable periodic function is periodic</p>
</li>
<li>
<p>If the derivative is periodic, the original function is not necessarily periodic</p>
</li>
<li>
<p>If the derivative is periodic and its integral over one period is $0$, then the original function is periodic, and this is a necessary and sufficient condition</p>
</li>
</ul>
<h3 id="limits">
<a class="header-anchor" href="#limits"></a>
Limits
</h3><ul>
<li>Local boundedness: if a limit exists in a deleted neighborhood, then the function is locally bounded; local boundedness alone does not imply the limit exists</li>
<li>Sign preservation</li>
<li>Order preservation</li>
</ul>
<p>Criteria for the existence of a sequence limit</p>
<ul>
<li>Squeeze theorem</li>
<li>Monotone bounded theorem</li>
</ul>
<p>Relation between divergence to infinity and unbounded variables:</p>
<ul>
<li>A sequence diverges to infinity if its terms eventually become arbitrarily large in absolute value

$$
\forall M \gt 0 ,\exist N \gt 0,当 n \gt N时,恒有\left\vert x_n \right\vert \gt M
$$</li>
<li>An unbounded variable only requires that for any given number, there exists some term whose absolute value exceeds it

$$
\forall M \gt 0 ,\exist N \gt 0,使得\left\vert x_N \right\vert \gt M
$$</li>
</ul>
<h2 id="postscript">
<a class="header-anchor" href="#postscript"></a>
Postscript
</h2><p>I do not understand, I do not understand, how high and far the stars are.<br>
When will I finally be able to stand among them?
<img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/%E7%A7%91%E7%BD%97%E5%BB%96%E5%A4%AB%E5%8D%81%E5%AD%97.jpeg" alt=""></p>

<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
  <iframe 
    src="//player.bilibili.com/player.html?isOutside=true&aid=114883244982356&bvid=BV1SPgbzzE3e&cid=31159160676&p=1"
    style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" 
    frameborder="0" 
    allowfullscreen="true">
  </iframe>
</div>



        
        <hr><p>Published on 2025-09-01 at <a href='https://www.guzhengsvt.cn/'>孤筝の温暖小家</a>, last modified on 2025-09-01</p><p>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</p>]]></description><category>Diary</category></item><item><title>QSL Card Gallery</title><link>https://www.guzhengsvt.cn/en/post/othernotes/qsl-card-exhibition/</link><pubDate>Thu, 21 Aug 2025 18:44:15 +0800</pubDate><author>lvbowen040427@163.com (孤筝)</author><guid>https://www.guzhengsvt.cn/en/post/othernotes/qsl-card-exhibition/</guid><description>
<![CDATA[<h1>QSL Card Gallery</h1><p>Author: 孤筝(lvbowen040427@163.com)</p>
        
          <h2 id="1-noa-1">
<a class="header-anchor" href="#1-noa-1"></a>
1. Noa-1
</h2><p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/QSL-%E6%A0%87-1.jpeg" alt="Noa-1"></p>
<p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/QSL-%E6%A0%87-2.jpeg" alt="Noa-2.jpeg"></p>
<h3 id="design-notes">
<a class="header-anchor" href="#design-notes"></a>
Design Notes
</h3><p>This one is based on 生盐诺亚 from <em><strong>Blue Archive</strong></em>, one of my favorite characters.</p>
<ul>
<li>The front uses a screenshot from Noa&rsquo;s memorial lobby. She is writing by hand on the floor-to-ceiling window a line from <em>Le Spleen de Paris</em>, specifically &ldquo;The Stranger,&rdquo; by the nineteenth-century French modernist poet Charles Pierre Baudelaire.</li>
</ul>
<blockquote>
<p>Qui aimes-tu le mieux, homme énigmatique, dis?<br>
Enigmatic man, tell me, whom do you love best?</p>
</blockquote>
<p>After that line, I added the ITU zone, CQ zone, and Maidenhead grid. I tried to use a handwriting-style font and stretch it with perspective so the text would look like it had really been written on the glass.</p>
<ul>
<li>On the back, besides the standard QSO information fields, I added a QR code linking to my blog. The background image is a screenshot from an official BA Noa video.</li>
<li><strong>Warning:</strong> I accidentally wrote <em>UCT</em> instead of <em>UTC</em> in the time-zone field. I did not notice it until the next card was already printed. If I ever print a second batch, I will fix it.</li>
</ul>
<h3 id="print-batch">
<a class="header-anchor" href="#print-batch"></a>
Print Batch
</h3><ul>
<li>Batch 1: 200 cards on 300g coated business-card stock, with rounded corners, printed by 久美印业 on Taobao.
<ul>
<li>The cards are not stiff enough, and the back side is hard to write on.</li>
<li>Still plenty left.</li>
</ul>
</li>
</ul>
<h2 id="2-dfh">
<a class="header-anchor" href="#2-dfh"></a>
2. DFH
</h2><p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/%E4%B8%9C%E6%96%B9%E7%BA%A2%E7%9A%84%E5%BF%83%E8%84%8F-1.png" alt="DFH-1"></p>
<p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/%E4%B8%9C%E6%96%B9%E7%BA%A2%E7%9A%84%E5%BF%83%E8%84%8F-2-%E6%9B%B4%E6%AD%A3.png" alt="DFH-2"></p>
<h3 id="design-notes-1">
<a class="header-anchor" href="#design-notes-1"></a>
Design Notes
</h3><p>The whole design draws from the space-history lyric adaptation song <a href="https://www.bilibili.com/video/BV129mGY3Efe/">《东方红的心脏》</a> by the BiliBili creator <strong>炙弹冰</strong>, itself based on <strong><a href="https://music.163.com/#/song?id=1907751320">シリウスの心臓(天狼星的心脏)</a></strong> by <a href="https://music.163.com/#/artist?id=51020133">ヰ世界情緒</a>.</p>
<ul>
<li>The girl on the right side of the front is the illustration used for 《东方红的心脏》, a personified version of the Dong Fang Hong satellite.</li>
<li>On the left side of the front are two overlapping satellites. The solid one on the left is a screenshot of a 3D model of Dong Fang Hong 1. The colorful one on the right was generated from that image using the <a href="https://lab.magiconch.com/one-last-image/">One Last Image Louvre Generator</a>, producing a gradient look reminiscent of the <em><strong>One Last Kiss</strong></em> cover.</li>
<li>The red and blue elliptical rings around the satellite are written in Morse code. The red one says &ldquo;Long live the People&rsquo;s Republic of China,&rdquo; and the blue one says &ldquo;Long live the great unity of the people of the world,&rdquo; following the wording in the 1955 <em>Standard Telegraph Codebook</em>.</li>
<li>The date on the solid satellite marks the launch of Dong Fang Hong 1 on April 24, 1970, and the day it stopped broadcasting &ldquo;The East Is Red&rdquo; on May 14. That was the satellite&rsquo;s brief life, but also the beginning of China&rsquo;s rise in space.</li>
<li>The date on the colored satellite refers to the British bombardment of Macau on June 21, 1840, which opened the First Opium War, and extends to the founding of the People&rsquo;s Republic of China on October 1, 1949, when the Chinese people finally stood up. It carries not only the humiliation of China&rsquo;s modern history, but also the broader anti-imperialist struggles of many Third World countries seeking independence.</li>
<li>The satellite and the girl are separated by two sine curves symbolizing radio waves.</li>
<li>Compared with <a href="/en/post/othernotes/qsl-card-exhibition/#1-noa-1">Noa-1</a>, this design adds an NFC mark on the back. I plan to add NFC tags to future cards so they can store card data, QSO data, or even trigger music and video playback automatically.</li>
<li>The line below the email on the back, &ldquo;How is one to live through a life wrapped in haze? Cast off hesitation, for the morning sun is both you and me,&rdquo; is a lyric from 《东方红的心脏》 that I love very much.</li>
<li>In the lower-right corner on the back, I added a short numbered score of <em>The East Is Red</em> to echo the Dong Fang Hong 1 theme of the card.</li>
</ul>
<p>I also designed a PCB version of this card. It includes an NFC chip and antenna coil, and I placed a red LED at the chest of the figure on the front. When a phone scans it at close range, the LED lights up, which fits the &ldquo;Heart of Dong Fang Hong&rdquo; theme perfectly.<br>
Because the cost is high, I plan to give the PCB version only to the first station I work in each call area, or to the first station contacted through a given operating mode.</p>
<p>The inscription on the Monument to the People&rsquo;s Heroes reads:</p>
<blockquote>
<p>Eternal glory to the people&rsquo;s heroes who laid down their lives in the People&rsquo;s Liberation War and the people&rsquo;s revolution over the past three years!<br>
Eternal glory to the people&rsquo;s heroes who laid down their lives in the People&rsquo;s Liberation War and the people&rsquo;s revolution over the past thirty years!<br>
Going back further to 1840, eternal glory to the people&rsquo;s heroes who laid down their lives in every struggle against internal and external enemies, for national independence and for the freedom and happiness of the people!</p>
</blockquote>
<p>Even today, the Dong Fang Hong satellite is still in orbit, quietly witnessing seas turn into mulberry fields.</p>
<h3 id="print-batch-1">
<a class="header-anchor" href="#print-batch-1"></a>
Print Batch
</h3><p><strong>Paper version:</strong></p>
<ul>
<li>Batch 1: 150 cards on 350g pearlescent paper, rounded corners, printed via 未来既是未来 on Xianyu
<ul>
<li>Plenty left</li>
</ul>
</li>
</ul>
<p><strong>PCB version:</strong></p>
<ul>
<li>Batch 1: 50 cards with colored silkscreen from JLCPCB, NT3H2111W0FHKH XQF, rounded corners
<ul>
<li>Plenty left</li>
</ul>
</li>
</ul>

        
        <hr><p>Published on 2025-08-21 at <a href='https://www.guzhengsvt.cn/'>孤筝の温暖小家</a>, last modified on 2025-08-21</p><p>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</p>]]></description><category>OtherNotes</category></item><item><title>A New Telling</title><link>https://www.guzhengsvt.cn/en/post/poetry/%E6%95%85%E4%BA%8B%E6%96%B0%E7%BC%96/</link><pubDate>Tue, 20 May 2025 12:18:48 +0800</pubDate><author>lvbowen040427@163.com (孤筝)</author><guid>https://www.guzhengsvt.cn/en/post/poetry/%E6%95%85%E4%BA%8B%E6%96%B0%E7%BC%96/</guid><description>
<![CDATA[<h1>A New Telling</h1><p>Author: 孤筝(lvbowen040427@163.com)</p>
        
          <h2 id="a-new-telling">
<a class="header-anchor" href="#a-new-telling"></a>
A New Telling
</h2><p><strong>I scrolled my feed back to seventeen,<br>
to decode old captions and the heart between.<br>
Yet line by line I flushed with shame,<br>
too young, too wild, too sure of flame.<br>
I fancied depth, I borrowed sighs,<br>
all melodrama in borrowed guise.<br>
So now I steal old forms anew,<br>
to patch a poem and show it you.</strong></p>
<p><strong>Let us say Xu Xian rode to Chang&rsquo;an,<br>
while White Snake dwelt in Huainan.<br>
By grace of fate they met by Broken Bridge,<br>
yet stayed like moon in water, bloom in mist.<br>
The scholar was but rootless down,<br>
with empty sleeves, how could he climb?<br>
He only praised the realm in passing,<br>
still stubborn-hearted, raw with time.</strong></p>
<p><strong>Anime, games, and galgame dreams,<br>
consorts crowd the slopes of Lishan.<br>
Advance, and there are lush and wanton tunes;<br>
retreat, and pure love still holds command.<br>
Since ancient days love seldom rounds to wholeness;<br>
only drifting grace keeps floating on.<br>
Why roam famed rivers and mountains at all,<br>
when even one true confidant is hard won?</strong></p>
<p><strong>At times I hear a woodland bird,<br>
and chase the moonlight through my lone shadow.<br>
Shang and Shen still meet again someday;<br>
in this world, no Peach Blossom Pool is easy to find.<br>
Long devotion is like the moon in water,<br>
while worldly dust forever startles waves.<br>
I ask only for a single ladleful,<br>
to drink the chill of moonlight from the cup.</strong></p>
<p><strong>Spring wind warms Yumen Pass;<br>
oranges grow in northern Shaanxi and in Huainan.<br>
Though worldly ties be spent upon the pagoda,<br>
Qinhuai is still only several ranges away.<br>
Spell against spell, tribulation after tribulation,<br>
even if Jinshan floods, a sail remains.<br>
I would tip heaven and earth and overturn the Huai,<br>
wash all of Chang&rsquo;an with sifted yellow sand.</strong></p>
<p><strong>New text and old affairs divide in two,<br>
right and wrong alike turn dreamlike.<br>
So let the waters of Qinhuai tonight<br>
carry my tangled thoughts back toward Huainan.</strong></p>
<p><em>Translated in a GPT-5.4 Codex style.</em></p>
<p><em><strong>Gu Zheng<br>
2025.5.20<br>
in Xi&rsquo;an</strong></em></p>

        
        <hr><p>Published on 2025-05-20 at <a href='https://www.guzhengsvt.cn/'>孤筝の温暖小家</a>, last modified on 2025-05-20</p><p>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</p>]]></description><category>Poetry</category></item><item><title>Optimization Theory and Methods</title><link>https://www.guzhengsvt.cn/en/post/math/%E6%9C%80%E4%BC%98%E5%8C%96%E7%90%86%E8%AE%BA%E4%B8%8E%E6%96%B9%E6%B3%95/</link><pubDate>Sat, 10 May 2025 18:48:10 +0800</pubDate><author>lvbowen040427@163.com (孤筝)</author><guid>https://www.guzhengsvt.cn/en/post/math/%E6%9C%80%E4%BC%98%E5%8C%96%E7%90%86%E8%AE%BA%E4%B8%8E%E6%96%B9%E6%B3%95/</guid><description>
<![CDATA[<h1>Optimization Theory and Methods</h1><p>Author: 孤筝(lvbowen040427@163.com)</p>
        
          <h2 id="optimization-problems">
<a class="header-anchor" href="#optimization-problems"></a>
Optimization Problems
</h2><h3 id="mathematical-model">
<a class="header-anchor" href="#mathematical-model"></a>
Mathematical Model
</h3>$$
\min f(\vec{x}),\vec{x}\in \vec{R^{n}}
$$$$
\text{s.t.}{
\begin{cases}
c_i(x)=0,& i \in E = {1,2,\cdots,l}\\
c_i(\vec{x})\ge 0,& i \in I = {l+1,\cdots,l+m}\\
\end{cases}}
$$<p>
where</p>
<ul>
<li>$\vec{x}=(x_1,x_2,\cdots,x_n)^T$ is called the decision variable vector</li>
<li>$f(\vec{x})$ is the objective function</li>
<li>s.t. means subject to, that is, the constraints</li>
</ul>
<h3 id="classification">
<a class="header-anchor" href="#classification"></a>
Classification
</h3><ol>
<li>By time
<ol>
<li>Static problems</li>
<li>Dynamic problems</li>
</ol>
</li>
<li>By constraints
<ol>
<li>Constrained problems</li>
<li>Unconstrained problems</li>
</ol>
</li>
<li>By whether the objective and constraints are linear
<ol>
<li>Linear programming</li>
<li>Nonlinear programming</li>
</ol>
</li>
<li>By whether the objective and constraints are convex
<ol>
<li>Convex optimization problems</li>
<li>Non-convex optimization problems</li>
</ol>
</li>
</ol>
<h3 id="quadratic-form-matrix">
<a class="header-anchor" href="#quadratic-form-matrix"></a>
Quadratic Form Matrix
</h3><p>Quadratic form:
</p>
$$
\begin{align}
f
&=x_1^2-3x_3^2-4x_1x_2+x_2x_3\\
&=(x_1,x_2,x_3)
\begin{bmatrix}
1 & -2 & 0\\
-2 & 0 & \frac{1}{2}\\
0 & \frac{1}{2} & -3\\
\end{bmatrix}
\begin{bmatrix}
x_1\\
x_2\\
x_3\\
\end{bmatrix}\\
&= \vec{X^T} A \vec{X}\\
\end{align}
$$<p>Quadratic form matrix:
</p>
$$
\begin{bmatrix}
1 & -2 & 0\\
-2 & 0 & \frac{1}{2}\\
0 & \frac{1}{2} & -3\\
\end{bmatrix}
$$<h3 id="hessian-matrix">
<a class="header-anchor" href="#hessian-matrix"></a>
Hessian Matrix
</h3><p>Take a two-variable quadratic function as an example:
</p>
$$
\nabla^2 f(x_1,x_2)=
\begin{bmatrix}
\frac{\partial^2 f}{\partial x_1^2} & \frac{\partial^2 f}{\partial x_1 \partial x_2}\\
\frac{\partial^2 f}{\partial x_2 \partial x_1} & \frac{\partial^2 f}{\partial x_2^2}\\
\end{bmatrix}
$$<h3 id="feasible-solutions">
<a class="header-anchor" href="#feasible-solutions"></a>
Feasible Solutions
</h3><ul>
<li>Feasible solution: a solution satisfying all constraints.</li>
<li>Feasible set (admissible set, feasible region): the set of all feasible solutions.</li>
<li>Optimization problem: find the point in the feasible set at which the objective function attains its maximum or minimum.</li>
<li>Stationary point: if $\nabla f(x_0)=0$, then $x_0$ is called a stationary point.</li>
<li>Saddle point: if $x_0$ is a stationary point but not an extremum point, then it is called a saddle point.</li>
</ul>
<h3 id="convex-sets">
<a class="header-anchor" href="#convex-sets"></a>
Convex Sets
</h3><h4 id="definition">
<a class="header-anchor" href="#definition"></a>
Definition
</h4><p>In the plane, if the line segment joining any two points inside a figure still lies entirely inside the figure, then the figure is called a convex set.</p>
<h4 id="properties">
<a class="header-anchor" href="#properties"></a>
Properties
</h4><ol>
<li>The intersection of convex sets is convex.</li>
<li>A scaled convex set is still convex.</li>
<li>The sum set of convex sets, not the union, is convex.
<ul>
<li>If $D_1,D_2$ are convex sets, then $D_1+D_2=\{z|z=x+y,x \in D_1,y \in D_2\}$ is convex.</li>
</ul>
</li>
<li>A linear combination of convex sets is convex.</li>
</ol>
<h4 id="common-convex-sets">
<a class="header-anchor" href="#common-convex-sets"></a>
Common Convex Sets
</h4><ol>
<li>The empty set</li>
<li>The whole Euclidean space $\vec{R^n}$</li>
<li>A hyperplane $H=\{x \in \vec{R^n} | a_1x_1+a_2x_2+\cdots +a_nx_n=b\}$</li>
<li>A half-space $H^+=\{x \in \vec{R^n} | a_1x_1+a_2x_2+\cdots +a_nx_n \ge b\}$</li>
</ol>
<h4 id="convex-combination">
<a class="header-anchor" href="#convex-combination"></a>
Convex Combination
</h4><p>Let $x_i \in \vec{R^n},i=1,2,\cdots ,k$, and let $\lambda_i \ge 0,\sum^k_{i=1}\lambda_i=1$. Then $x=\sum^k_{i=1}\lambda_ix_i$ is called a convex combination of $x_1,x_2,\cdots , x_k$.<br>
Any finite convex combination of points in a convex set still belongs to that convex set.</p>
<h4 id="extreme-points">
<a class="header-anchor" href="#extreme-points"></a>
Extreme Points
</h4><p>Let $D$ be a convex set and $x \in D$. If there do not exist two distinct points $y,z \in D$ and a real number $\alpha \in (0,1)$ such that $x=\alpha y+(1-\alpha)z$, then $x$ is called an extreme point of $D$.</p>
<p>In plain words: for a pentagon, the extreme points are its vertices; for a semicircle, the extreme points are the two endpoints of its diameter together with the top point on the arc.</p>
<h3 id="convex-functions">
<a class="header-anchor" href="#convex-functions"></a>
Convex Functions
</h3><h4 id="definition-1">
<a class="header-anchor" href="#definition-1"></a>
Definition
</h4><p>Let $f(x)$ be defined on a convex set. If for any two points $x_1,x_2$ in the convex set,
</p>
$$
f(\alpha x_1+(1-\alpha)x_2) \le \alpha f(x_1)+(1-\alpha)f(x_2)
$$<p>
then $f$ is called a convex function.<br>
If the inequality is strict, $\lt$, then it is called a strictly convex function.</p>
<h4 id="criteria">
<a class="header-anchor" href="#criteria"></a>
Criteria
</h4><ol>
<li>If the Hessian matrix of a multivariable function is positive semidefinite, then the function is convex.</li>
<li>If the Hessian matrix is positive definite, then the function is strictly convex.</li>
<li>A multivariable linear function is convex on $\vec{R^n}$.</li>
</ol>
<h3 id="convex-optimization-problems">
<a class="header-anchor" href="#convex-optimization-problems"></a>
Convex Optimization Problems
</h3><h4 id="definition-2">
<a class="header-anchor" href="#definition-2"></a>
Definition
</h4><p>An optimization problem in which the objective function and all constraint functions are convex functions.</p>
<ul>
<li>The feasible set of a convex optimization problem is convex.</li>
<li>Any local optimum is also a global optimum.</li>
<li>If the objective function is strictly convex, then the local optimum exists and is unique.</li>
</ul>
<h2 id="linear-programming">
<a class="header-anchor" href="#linear-programming"></a>
Linear Programming
</h2><h3 id="forms">
<a class="header-anchor" href="#forms"></a>
Forms
</h3><h4 id="nonstandard-form">
<a class="header-anchor" href="#nonstandard-form"></a>
Nonstandard Form
</h4><ul>
<li>Objective function: $\max z=\sum^{n}_{j=1}c_jx_j=CX$</li>
<li>Coefficient matrix:

$$
A=
\begin{bmatrix}
a_{11} & \cdots & a_{1n}\\
\vdots & \ddots & \vdots\\
a_{m1} & \cdots & a_{mn}\\
\end{bmatrix}
=(P_1,P_2,\cdots,P_n)
$$</li>
<li>Resource vector: $b=\begin{bmatrix} b_1\\ \vdots \\ b_m\\ \end{bmatrix}$</li>
<li>Decision variable vector: $X=(x_1,x_2,\cdots , x_n)^T$</li>
<li>Constraints:

$$
\begin{cases}
\sum^{n}_{j=1}a_{ij}x_j=b_i,&i=1,2,\cdots,m\\
x_j \ge 0,& j=1,2,\cdots,n\\
\end{cases}
$$

$$
\begin{cases}
AX=b\\
X \ge \vec{0}
\end{cases}
$$</li>
</ul>
<h4 id="standard-form">
<a class="header-anchor" href="#standard-form"></a>
Standard Form
</h4><ol>
<li>Convert a maximization problem into minimization</li>
<li>Slack variables: for $\le$ constraints, introduce slack variables to turn inequalities into equalities</li>
<li>Surplus variables: for $\ge$ constraints, introduce surplus variables to turn inequalities into equalities</li>
<li>Free variables: variables that may take arbitrary real values in practical problems, written as $x_i=x'-x''$</li>
</ol>
$$
\begin{cases}
\min f(x_1,x_2,\cdots , x_n)\\
\text{s.t.} 
\begin{cases}
h_j(x_1,x_2,\cdots,x_n)=0&(j=1,2,\cdots)\\
x_j \ge 0\\
\end{cases}
\end{cases}
$$<h3 id="basis-matrix">
<a class="header-anchor" href="#basis-matrix"></a>
Basis Matrix
</h3><ul>
<li>Basis (basis matrix): a largest nonsingular submatrix of the coefficient matrix.
<ul>
<li>If the coefficient matrix $A$ is an $m \times n$ matrix with $rank(A)=m$, then any nonsingular $m \times m$ submatrix may serve as a basis matrix.</li>
</ul>
</li>
<li>Basic variables: the unknowns corresponding to the column vectors in the basis.</li>
<li>Nonbasic variables: the unknowns that are not basic variables.</li>
<li>Basic solution: the solution obtained by setting all nonbasic variables to zero.</li>
<li>Nondegenerate basic solution: a basic solution in which the number of nonzero components equals the number of constraint equations. Otherwise it is a degenerate basic solution.</li>
<li>Basic feasible solution: a basic solution satisfying the nonnegativity conditions in $\text{s.t.}$.</li>
<li>Optimal basic feasible solution: among all basic feasible solutions, the one that gives the optimal objective value.</li>
</ul>
<h3 id="properties-of-linear-programming-solutions">
<a class="header-anchor" href="#properties-of-linear-programming-solutions"></a>
Properties of Linear Programming Solutions
</h3><ol>
<li>The feasible set of a linear programming problem is convex.</li>
<li>If an optimal solution exists, it must be attained at a vertex of the feasible set.</li>
</ol>
<h3 id="simplex-method">
<a class="header-anchor" href="#simplex-method"></a>
Simplex Method
</h3><h4 id="reduced-costs">
<a class="header-anchor" href="#reduced-costs"></a>
Reduced Costs
</h4><p>Each unknown corresponds to a reduced cost:
</p>
$$
\sigma_j=C^T_J \vec{P_j}-c_j=\sum^{m}_{i=1}c_ia_{ij}-c_j
$$<ul>
<li>$C^T$ is the coefficient row of the objective function</li>
<li>$C^T_J$ is the row of coefficients of the basic variables in the objective function</li>
<li>$P_j$ denotes the $j$th column of matrix $A$</li>
<li>$c_i$ denotes the coefficient of the $i$th <strong>basic variable</strong> in the objective function</li>
<li>$c_j$ denotes the coefficient of the $j$th <strong>variable</strong> in the objective function and is unrelated to $c_i$</li>
</ul>
<p><strong>When all reduced costs are less than or equal to zero, the current basic feasible solution is optimal.</strong></p>
<p>In general, the reduced costs of basic variables are zero.</p>
<h4 id="basis-transformation">
<a class="header-anchor" href="#basis-transformation"></a>
Basis Transformation
</h4><h5 id="choosing-the-basis-matrix">
<a class="header-anchor" href="#choosing-the-basis-matrix"></a>
Choosing the Basis Matrix
</h5><p>Prefer the identity matrix as the initial basis matrix. Compute the initial basic feasible solution and the reduced costs.</p>
<h5 id="constructing-the-initial-simplex-tableau">
<a class="header-anchor" href="#constructing-the-initial-simplex-tableau"></a>
Constructing the Initial Simplex Tableau
</h5><table>
  <thead>
      <tr>
          <th></th>
          <th>$P_1$</th>
          <th>$P_2$</th>
          <th>$\cdots$</th>
          <th>$P_n$</th>
          <th>$\vec{b}$</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Coefficient matrix</td>
          <td>$a_{11}$</td>
          <td>$a_{12}$</td>
          <td>$\cdots$</td>
          <td>$a_{1n}$</td>
          <td>$b_1$</td>
      </tr>
      <tr>
          <td></td>
          <td>$a_{21}$</td>
          <td>$a_{22}$</td>
          <td>$\cdots$</td>
          <td>$a_{2n}$</td>
          <td>$b_2$</td>
      </tr>
      <tr>
          <td></td>
          <td>$\vdots$</td>
          <td>$\vdots$</td>
          <td>$\ddots$</td>
          <td>$\vdots$</td>
          <td>$\vdots$</td>
      </tr>
      <tr>
          <td></td>
          <td>$a_{m1}$</td>
          <td>$a_{m2}$</td>
          <td>$\cdots$</td>
          <td>$a_{mn}$</td>
          <td>$b_m$</td>
      </tr>
      <tr>
          <td>Reduced costs</td>
          <td>$\sigma_1$</td>
          <td>$\sigma_2$</td>
          <td>$\cdots$</td>
          <td>$\sigma_n$</td>
          <td>Optimal value</td>
      </tr>
  </tbody>
</table>
<h5 id="selecting-an-entering-column">
<a class="header-anchor" href="#selecting-an-entering-column"></a>
Selecting an Entering Column
</h5><p>If a reduced cost is greater than zero, then the corresponding column has improving potential. Choose this column as the entering column $P_j$, and the corresponding variable $x_j$ is the entering variable.</p>
<h5 id="selecting-the-pivot-element">
<a class="header-anchor" href="#selecting-the-pivot-element"></a>
Selecting the Pivot Element
</h5><p>Among the positive entries $a_{ij}$ in the entering column, divide the corresponding entry of $b$ by each such element and choose the smallest ratio. The corresponding element $a_{ij}$ is the pivot.<br>
<em><strong>If a reduced cost is greater than zero but all entries in that column are negative, then the linear program has no optimal solution.</strong></em></p>
<h5 id="elementary-row-operations">
<a class="header-anchor" href="#elementary-row-operations"></a>
Elementary Row Operations
</h5><p>Transform the pivot into 1 and all other entries in that column into 0.<br>
<strong>Geometric meaning: moving to another vertex of the feasible region.</strong></p>
<h5 id="leaving-column">
<a class="header-anchor" href="#leaving-column"></a>
Leaving Column
</h5><p>Select the new basis matrix according to the updated coefficient matrix. Compared with the old basis, the replaced column is the leaving column, and its corresponding variable is the leaving variable.<br>
Then recompute the reduced costs and form the new simplex tableau.</p>
<h5 id="a-new-basis-transformation">
<a class="header-anchor" href="#a-new-basis-transformation"></a>
A New Basis Transformation
</h5><p>If the reduced-cost row changes and new positive reduced costs appear, choose the corresponding column as the new entering column, select a pivot, and perform elementary row operations again.</p>
<h5 id="result">
<a class="header-anchor" href="#result"></a>
Result
</h5><p>When all reduced costs are less than or equal to zero, the entries of $\vec{b}$ are the values of the basic variables, while the nonbasic variables are set to 0. Together these form the optimal solution, and substituting them into the objective function gives the minimum value.</p>
<h4 id="conditions-for-applying-the-simplex-method">
<a class="header-anchor" href="#conditions-for-applying-the-simplex-method"></a>
Conditions for Applying the Simplex Method
</h4><ol>
<li>All elements in the nonhomogeneous term are nonnegative.</li>
<li>A feasible solution exists.</li>
<li>The sum of products of slack variables and nonbasic variables is zero.</li>
<li>The problem is a linear programming problem on a convex feasible region.</li>
<li>The feasible solution set is finite.</li>
</ol>
<h3 id="artificial-variable-method">
<a class="header-anchor" href="#artificial-variable-method"></a>
Artificial Variable Method
</h3><p>When the coefficient matrix does not contain an identity matrix, one usually introduces artificial variables to construct one artificially.</p>
<p>Suppose the constraints of the linear programming problem are $\sum^{n}_{j=1}a_{ij}=b_i(i=1,2,\cdots ,m)$. Add artificial variables $x_{n+1},x_{n+2},\cdots,x_{n+m}$ to each constraint and use them as the basic variables, so that they form an identity matrix and all other variables are zero. In this way we obtain an initial feasible solution $x^{(0)}=(0,0,\cdots,0,b_1,b_2,\cdots,b_m)^T$.<br>
Starting from this point, carry out basis transformations to obtain an optimal solution without nonzero artificial variables.</p>
<p>If all reduced costs are negative but nonzero artificial variables still remain, then the original problem has no feasible solution.</p>
<h3 id="big-m-method">
<a class="header-anchor" href="#big-m-method"></a>
Big-M Method
</h3><p>For a minimization problem, after introducing artificial variables into the constraints, assign the coefficient $M$ to the artificial variables in the objective function, where $M \in \vec{R^+}$.<br>
To obtain the minimum objective value, one keeps carrying out basis transformations until the artificial variables become zero. For a maximization problem, $M \in \vec{R^-}$.</p>
<h3 id="degenerate-cases">
<a class="header-anchor" href="#degenerate-cases"></a>
Degenerate Cases
</h3><p>If the simplex method falls into cycling while the problem does have an optimal solution, the following methods may be used to avoid cycling.</p>
<h4 id="perturbation-method">
<a class="header-anchor" href="#perturbation-method"></a>
Perturbation Method
</h4><h4 id="revised-simplex-method">
<a class="header-anchor" href="#revised-simplex-method"></a>
Revised Simplex Method
</h4><h2 id="duality-theory-of-linear-programming">
<a class="header-anchor" href="#duality-theory-of-linear-programming"></a>
Duality Theory of Linear Programming
</h2><h3 id="forms-of-the-dual-problem">
<a class="header-anchor" href="#forms-of-the-dual-problem"></a>
Forms of the Dual Problem
</h3><h4 id="symmetric-form">
<a class="header-anchor" href="#symmetric-form"></a>
Symmetric Form
</h4><p>Primal problem
</p>
$$
\begin{cases}
\min f=\vec{c^T}\vec{x}\\
\text{s.t.}
\begin{cases}
\vec{A}\vec{x} \ge \vec{b}\\
\vec{x} \ge \vec{0}
\end{cases}
\end{cases}
$$<p>Dual problem
</p>
$$
\begin{cases}
\max w=\vec{b^T}\vec{y}\\
\text{s.t.}
\begin{cases}
\vec{A^T}\vec{y} \le \vec{c}\\
\vec{y} \ge \vec{0}\\
\end{cases}
\end{cases}
$$<p>Correspondence:</p>
<ul>
<li>(1) The number of constraints in the primal problem equals the number of variables in its dual.</li>
<li>(2) The coefficients of the primal objective function become the right-hand-side constants of the dual constraints.</li>
<li>(3) If the primal objective is minimization, then the dual objective is maximization.</li>
<li>(4) If the primal constraints are of type “$\ge$”, then the dual constraints are of type “$\le$”.</li>
</ul>
<h4 id="asymmetric-form">
<a class="header-anchor" href="#asymmetric-form"></a>
Asymmetric Form
</h4><p>Primal problem
</p>
$$
\begin{cases}
\min f=\vec{c^T}\vec{x}\\
\text{s.t.}
\begin{cases}
\vec{A}\vec{x} = \vec{b}\\
\vec{x} \ge \vec{0}
\end{cases}
\end{cases}
$$<p>Dual problem
</p>
$$
\begin{cases}
\max w=\vec{b^T}\vec{y}\\
\text{s.t.}
\begin{cases}
\vec{A^T}\vec{y} \le \vec{c}\\
\vec{y} \text{ is unrestricted}
\end{cases}
\end{cases}
$$<h4 id="general-case">
<a class="header-anchor" href="#general-case"></a>
General Case
</h4><p>If the primal problem contains a mixture of $\le,\ge,=$ constraints, first introduce slack and surplus variables so that all constraints become equalities, and then construct the dual using the asymmetric form.</p>
<p><img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/%E5%8E%9F%E9%97%AE%E9%A2%98%E4%B8%8E%E5%AF%B9%E5%81%B6%E9%97%AE%E9%A2%98%E5%AF%B9%E5%BA%94%E5%85%B3%E7%B3%BB%E8%A1%A81.png" alt="原问题与对偶问题对应关系表1.png">
<img src="https://cdn.jsdelivr.net/gh/GuZhengSVT/Hugo-media//photo/%E5%8E%9F%E9%97%AE%E9%A2%98%E4%B8%8E%E5%AF%B9%E5%81%B6%E9%97%AE%E9%A2%98%E5%AF%B9%E5%BA%94%E5%85%B3%E7%B3%BB%E8%A1%A82.png" alt="原问题与对偶问题对应关系表2.png"></p>
<h3 id="dual-simplex-method">
<a class="header-anchor" href="#dual-simplex-method"></a>
Dual Simplex Method
</h3><ul>
<li>Simplex method: first ensure $\vec{b} \ge 0$, then iterate based on reduced costs $\le 0$.</li>
<li>Dual simplex method: first ensure reduced costs $\le 0$, then iterate based on $\vec{b} \ge 0$.</li>
</ul>
<h4 id="ensuring-reduced-costs">
<a class="header-anchor" href="#ensuring-reduced-costs"></a>
Ensuring Reduced Costs $\le 0$
</h4><h4 id="choosing-the-leaving-variable">
<a class="header-anchor" href="#choosing-the-leaving-variable"></a>
Choosing the Leaving Variable
</h4><p>If there exists a negative $b_i \lt 0$, then the row containing the smallest $\min b_i$ is chosen as the leaving row, and the corresponding variable is the leaving variable.</p>
<h4 id="choosing-the-entering-variable">
<a class="header-anchor" href="#choosing-the-entering-variable"></a>
Choosing the Entering Variable
</h4><p>Divide each reduced cost by the negative coefficient in the leaving row, that is, $a_{ij} \lt 0$. The column corresponding to the smallest resulting value is chosen as the entering column, and the corresponding variable is the entering variable.</p>
<h4 id="row-operations">
<a class="header-anchor" href="#row-operations"></a>
Row Operations
</h4><p>Use elementary row operations to transform the entering column into one that matches the basis matrix, that is, an identity column. At this point $\vec{b}$ changes as well.<br>
Then recompute the reduced costs and ensure that they remain less than or equal to zero.</p>
<h4 id="a-new-basis-transformation-1">
<a class="header-anchor" href="#a-new-basis-transformation-1"></a>
A New Basis Transformation
</h4><p>If there is still a negative value $b_i \lt 0$, choose the smallest $\min b_i$ and perform another basis transformation.</p>
<h4 id="result-1">
<a class="header-anchor" href="#result-1"></a>
Result
</h4><p>When all $b_i \ge 0$, the vector $\vec{b}$ gives the optimal values of the basic variables, while the nonbasic variables are 0.<br>
Substitute them into the objective function to obtain the optimal value, whether maximum or minimum.</p>
<h2 id="sensitivity-analysis">
<a class="header-anchor" href="#sensitivity-analysis"></a>
Sensitivity Analysis
</h2>
        
        <hr><p>Published on 2025-05-10 at <a href='https://www.guzhengsvt.cn/'>孤筝の温暖小家</a>, last modified on 2025-05-10</p><p>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</p>]]></description><category>Math</category></item><item><title>Typecho Comments Import to Waline</title><link>https://www.guzhengsvt.cn/en/post/othernotes/typecho%E8%AF%84%E8%AE%BA%E5%AF%BC%E5%85%A5waline/</link><pubDate>Sat, 19 Apr 2025 16:56:24 +0800</pubDate><author>lvbowen040427@163.com (孤筝)</author><guid>https://www.guzhengsvt.cn/en/post/othernotes/typecho%E8%AF%84%E8%AE%BA%E5%AF%BC%E5%85%A5waline/</guid><description>
<![CDATA[<h1>Typecho Comments Import to Waline</h1><p>Author: 孤筝(lvbowen040427@163.com)</p>
        
          <p>A couple of days ago, I migrated my blog posts from Typecho to Hugo. Just setting up the Front Matter parameters and reconfiguring image links took considerable effort.<br>
The value of a blog lies first in its articles, followed closely by its comments. Comments are proof that the blog has made an impact in both the digital and real worlds, carrying the interactions between people. More personally, comments from all corners of the globe are precious memories and a part of what makes &ldquo;me&rdquo;.<br>
Thus, it&rsquo;s essential to copy the original comments to the corresponding articles on the new site.</p>
<h2 id="configuring-waline">
<a class="header-anchor" href="#configuring-waline"></a>
Configuring Waline
</h2><p>Unlike dynamic blogs like WordPress or Typecho, static blogs can only rely on external comment systems. There are many options, each with its pros and cons. After referring to <a href="https://cloud.tencent.com/developer/article/2196035">this article</a> and checking the official websites of various comment systems, I ultimately chose <a href="https://waline.js.org">Waline</a>.<br>
Waline&rsquo;s <a href="https://waline.js.org/guide/get-started/">Chinese documentation</a> is detailed and comprehensive. After setting up the <a href="https://leancloud.app">LeanCloud</a> database and <a href="https://vercel.com/">Vercel</a> server, you can access the comment management dashboard at <code>https://&lt;your-server-domain&gt;/ui/</code>. Register as an administrator for the first time, where you can manage comments and users.</p>
<h2 id="exporting-typecho-comments">
<a class="header-anchor" href="#exporting-typecho-comments"></a>
Exporting Typecho Comments
</h2><p>Typecho is quite old, with a smaller user base compared to more active communities like Hexo or WordPress. There&rsquo;s also very little documentation available online.<br>
The only solution I found was a plugin called <a href="https://github.com/lizheming/typecho-export-valine">Export2Valine</a> (also mentioned in Waline&rsquo;s documentation) by <a href="https://imnerd.org">Yi Hong Yuan Luo</a>, which exports Typecho comments to Valine.<br>
However, it hasn&rsquo;t been updated in three years, and testing showed it only imports the first comment. Looking at the exported <code>jsonl</code> file, it&rsquo;s clear that all comment data was fully exported.</p>
<p>First, install the plugin in Typecho (make sure to rename the plugin folder to &ldquo;Export2Valine&rdquo;!).</p>
<p>Referencing <a href="https://www.imwxz.com/posts/74f52ab0.html">this article</a> about migrating from Typecho to Hexo, the plugin is outdated and requires some modifications.<br>
Locate <code>Action.php</code> in the plugin folder and modify lines 42 onwards as follows (to track parent comments):</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-php" data-lang="php"><span class="line"><span class="cl"><span class="nv">$arr</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;objectId&#34;</span> <span class="o">=&gt;</span> <span class="nv">$comment</span><span class="p">[</span><span class="s2">&#34;coid&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;QQAvatar&#34;</span> <span class="o">=&gt;</span> <span class="s2">&#34;&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;comment&#34;</span> <span class="o">=&gt;</span> <span class="nv">$comment</span><span class="p">[</span><span class="s2">&#34;text&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;insertedAt&#34;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;__type&#34;</span> <span class="o">=&gt;</span> <span class="s2">&#34;Date&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;iso&#34;</span> <span class="o">=&gt;</span> <span class="nv">$time</span>
</span></span><span class="line"><span class="cl">  <span class="p">),</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;createdAt&#34;</span> <span class="o">=&gt;</span> <span class="nv">$time</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;updatedAt&#34;</span> <span class="o">=&gt;</span> <span class="nv">$time</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;ip&#34;</span> <span class="o">=&gt;</span> <span class="nv">$comment</span><span class="p">[</span><span class="s2">&#34;ip&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;link&#34;</span> <span class="o">=&gt;</span> <span class="nv">$comment</span><span class="p">[</span><span class="s2">&#34;url&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;mail&#34;</span> <span class="o">=&gt;</span> <span class="nv">$comment</span><span class="p">[</span><span class="s2">&#34;mail&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;nick&#34;</span> <span class="o">=&gt;</span> <span class="nv">$comment</span><span class="p">[</span><span class="s2">&#34;author&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;ua&#34;</span> <span class="o">=&gt;</span> <span class="nv">$comment</span><span class="p">[</span><span class="s2">&#34;agent&#34;</span><span class="p">],</span>
</span></span><span class="line"><span class="cl">  <span class="s2">&#34;url&#34;</span> <span class="o">=&gt;</span> <span class="s2">&#34;/</span><span class="si">{</span><span class="nv">$slug</span><span class="si">}</span><span class="s2">.html&#34;</span>
</span></span><span class="line"><span class="cl"><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">if</span><span class="p">(</span><span class="nv">$comment</span><span class="p">[</span><span class="s2">&#34;parent&#34;</span><span class="p">])</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="nv">$arr</span><span class="p">[</span><span class="s2">&#34;pid&#34;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$comment</span><span class="p">[</span><span class="s2">&#34;parent&#34;</span><span class="p">];</span>
</span></span><span class="line"><span class="cl">  <span class="nv">$arr</span><span class="p">[</span><span class="s2">&#34;rid&#34;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">getRootId</span><span class="p">(</span><span class="nv">$comment</span><span class="p">[</span><span class="s2">&#34;coid&#34;</span><span class="p">]);</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><p>No other changes are needed.<br>
Next, go to Typecho&rsquo;s admin panel → Console → Export Comments. Open the downloaded <code>jsonl</code> file and delete the header line:<br>
<code>#filetype:JSON-streaming {&quot;type&quot;:&quot;Class&quot;,&quot;class&quot;:&quot;Comment&quot;}\n\n</code>.<br>
Save the file, close it, and change the file extension to <code>.json</code>.</p>
<h2 id="fixing-the-json-format">
<a class="header-anchor" href="#fixing-the-json-format"></a>
Fixing the JSON Format
</h2><p>The exported <code>jsonl</code> file contains escaped Chinese characters and is a single line, making it hard to read.<br>
To convert it into a more readable, editable, and importable <code>json</code> format, use your editor&rsquo;s <strong>Find and Replace</strong> feature to replace <code>}\n{</code> with:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="err">},</span>
</span></span><span class="line"><span class="cl"><span class="p">{</span>
</span></span></code></pre></div><p>In Xcode, you can insert line breaks by clicking the small magnifying glass icon on the left.</p>
<p>Now, each line represents one comment object.</p>
<p>Similarly, to separate the fields within each comment object, replace <code>&quot;,&quot;</code> with:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="s2">&#34;,
</span></span></span><span class="line"><span class="cl"><span class="s2">    &#34;</span>
</span></span></code></pre></div><p>Now, each comment object contains multiple data fields, structured like this:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span><span class="nt">&#34;objectId&#34;</span><span class="p">:</span><span class="s2">&#34;3&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;QQAvatar&#34;</span><span class="p">:</span><span class="s2">&#34;&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;comment&#34;</span><span class="p">:</span><span class="s2">&#34;\u6d4b\u8bd5\u4e00\u4e0b&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;insertedAt&#34;</span><span class="p">:{</span><span class="nt">&#34;__type&#34;</span><span class="p">:</span><span class="s2">&#34;Date&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;iso&#34;</span><span class="p">:</span><span class="s2">&#34;2023-06-27T09:37:07.000Z&#34;</span><span class="p">},</span><span class="nt">&#34;createdAt&#34;</span><span class="p">:</span><span class="s2">&#34;2023-06-27T09:37:07.000Z&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;updatedAt&#34;</span><span class="p">:</span><span class="s2">&#34;2023-06-27T09:37:07.000Z&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;ip&#34;</span><span class="p">:</span><span class="s2">&#34;223.104.150.16&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;link&#34;</span><span class="p">:</span><span class="kc">null</span><span class="p">,</span><span class="nt">&#34;mail&#34;</span><span class="p">:</span><span class="s2">&#34;2868301418@qq.com&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;nick&#34;</span><span class="p">:</span><span class="s2">&#34;2868301418&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;ua&#34;</span><span class="p">:</span><span class="s2">&#34;Mozilla\/5.0 (Linux; Android 13; V2171A Build\/TP1A.220624.014; wv) AppleWebKit\/537.36 (KHTML, like Gecko) Version\/4.0 Chrome\/109.0.5414.86 MQQBrowser\/6.2 TBS\/046605 Mobile Safari\/537.36 V1_AND_SQ_8.9.63_4190_HDBM_T QQ\/8.9.63.11380 NetType\/4G WebP\/0.3.0 Ap&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;url&#34;</span><span class="p">:</span><span class="s2">&#34;\/\u4ea4\u53cb\u6807\u51c6-\u548c\u5e73\u5171\u5904\u4e94\u9879\u539f\u5219.html&#34;</span><span class="p">}</span><span class="err">,</span>
</span></span><span class="line"><span class="cl">  <span class="p">{</span><span class="nt">&#34;objectId&#34;</span><span class="p">:</span><span class="s2">&#34;4&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;QQAvatar&#34;</span><span class="p">:</span><span class="s2">&#34;&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;comment&#34;</span><span class="p">:</span><span class="s2">&#34;\u600e\u4e48ip\u4e0d\u5bf9&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;insertedAt&#34;</span><span class="p">:{</span><span class="nt">&#34;__type&#34;</span><span class="p">:</span><span class="s2">&#34;Date&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;iso&#34;</span><span class="p">:</span><span class="s2">&#34;2023-06-27T09:38:15.000Z&#34;</span><span class="p">},</span><span class="nt">&#34;createdAt&#34;</span><span class="p">:</span><span class="s2">&#34;2023-06-27T09:38:15.000Z&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;updatedAt&#34;</span><span class="p">:</span><span class="s2">&#34;2023-06-27T09:38:15.000Z&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;ip&#34;</span><span class="p">:</span><span class="s2">&#34;223.104.150.16&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;link&#34;</span><span class="p">:</span><span class="kc">null</span><span class="p">,</span><span class="nt">&#34;mail&#34;</span><span class="p">:</span><span class="s2">&#34;2868301418@qq.com&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;nick&#34;</span><span class="p">:</span><span class="s2">&#34;2868301418&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;ua&#34;</span><span class="p">:</span><span class="s2">&#34;Mozilla\/5.0 (Linux; Android 13; V2171A Build\/TP1A.220624.014; wv) AppleWebKit\/537.36 (KHTML, like Gecko) Version\/4.0 Chrome\/109.0.5414.86 MQQBrowser\/6.2 TBS\/046605 Mobile Safari\/537.36 V1_AND_SQ_8.9.63_4190_HDBM_T QQ\/8.9.63.11380 NetType\/4G WebP\/0.3.0 Ap&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;url&#34;</span><span class="p">:</span><span class="s2">&#34;\/\u4ea4\u53cb\u6807\u51c6-\u548c\u5e73\u5171\u5904\u4e94\u9879\u539f\u5219.html&#34;</span><span class="p">}</span><span class="err">,</span>
</span></span></code></pre></div><h3 id="common-field-descriptions">
<a class="header-anchor" href="#common-field-descriptions"></a>
Common Field Descriptions
</h3><ol>
<li><strong>objectId</strong>: Unique identifier for the comment (e.g., &ldquo;4&rdquo; or &ldquo;5&rdquo;)</li>
<li><strong>QQAvatar</strong>: QQ avatar link (currently empty)</li>
<li><strong>comment</strong>: Comment content (contains Unicode escape sequences, e.g., <code>\u600e\u4e48</code> means &ldquo;how&rdquo;)</li>
<li><strong>insertedAt/createdAt/updatedAt</strong>: Timestamp (ISO 8601 format)</li>
<li><strong>ip</strong>: Commenter&rsquo;s IP address</li>
<li><strong>link</strong>: Link provided by the commenter (may be <code>null</code>)</li>
<li><strong>mail</strong>: Commenter&rsquo;s email address</li>
<li><strong>nick</strong>: Commenter&rsquo;s nickname</li>
<li><strong>ua</strong>: User agent (browser/device info)</li>
<li><strong>url</strong>: Relative path of the commented post</li>
</ol>
<h3 id="special-fields">
<a class="header-anchor" href="#special-fields"></a>
Special Fields
</h3><ol start="11">
<li><strong>pid</strong>: Parent comment ID</li>
<li><strong>rid</strong>: Root comment ID</li>
</ol>
<p>If <code>&quot;link&quot;</code> is <code>null</code>, there&rsquo;s no line break between <code>&quot;link&quot;</code> and <code>&quot;mail&quot;</code>. JSON is insensitive to line breaks, so this can be ignored.<br>
Now, wrap the entire content in <code>[ ]</code> at the beginning and end of the file, then save it.</p>
<h2 id="modifying-comment-attributes">
<a class="header-anchor" href="#modifying-comment-attributes"></a>
Modifying Comment Attributes
</h2><p>The file can now be imported into LeanCloud, but some adjustments are still needed.</p>
<p><code>Export2Valine</code> sets the URL for comment associations as <code>\/slug</code>, e.g., <code>&quot;url&quot;: &quot;\/Summary-of-the-First-Semester-of-Junior-Year.html&quot;</code>, where <code>\/</code> is an escaped <code>/</code>.</p>
<p>To link comments to the new blog&rsquo;s posts, manually update the <code>url</code> to match the new blog&rsquo;s post links.</p>
<p>For example, my Hugo-generated site has folders like <code>zh-cn</code>, <code>zh-tw</code>, <code>en</code>, and <code>ja</code> (due to multi-language support). Chinese posts are under <code>/zh-cn/post/category/</code>.<br>
In my local blog source files, posts are organized into folders by category, e.g., <code>/content/post/Thoughts/最近写的诗.md</code> generates a relative URL like <code>zh-cn/post/thoughts/最近写的诗</code>.</p>
<p>If your new blog&rsquo;s posts are in the root directory with unchanged names, no URL modifications are needed.<br>
If they&rsquo;re all under <code>/post/</code>, use Find and Replace to change:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="s2">&#34;url&#34;</span><span class="err">:&#34;\/</span>
</span></span></code></pre></div><p>to:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="s2">&#34;url&#34;</span><span class="err">:&#34;\/post\/</span>
</span></span></code></pre></div><p>For my case, I temporarily replaced it with:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="s2">&#34;url&#34;</span><span class="err">:&#34;\/zh-cn\/post\/</span>
</span></span></code></pre></div><p>Similarly, comments on standalone pages like &ldquo;Friends&rdquo; or &ldquo;Thoughts&rdquo; should be updated to their new relative URLs.<br>
For example, the Friends page:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="s2">&#34;url&#34;</span><span class="err">:&#34;\/links.html</span>
</span></span></code></pre></div><p>should be replaced with:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="s2">&#34;url&#34;</span><span class="err">:&#34;\/zh-cn\/friend\/</span>
</span></span></code></pre></div><p>First, apply bulk replacements for <code>post</code> and standalone pages where possible. Otherwise, it&rsquo;ll be tedious to modify them after import.</p>
<p>When using Find and Replace, try to target the largest common segments to avoid accidental changes.<br>
<em><strong>Remember to escape <code>\/</code>!!!</strong></em></p>
<h2 id="importing-to-leancloud">
<a class="header-anchor" href="#importing-to-leancloud"></a>
Importing to LeanCloud
</h2><p>In LeanCloud&rsquo;s console → Data Storage → Import &amp; Export, select the modified JSON file, set <code>Class</code> to <code>Comment</code>, and import.</p>
<p><em><strong>Note</strong></em>: If you&rsquo;ve previously tested Waline comments or attempted to import <code>Comment</code>, Waline may have already created the <code>Comment</code> class. Subsequent imports will fail silently (LeanCloud may claim success, but no new data appears).</p>
<p>To fix this, go to the console → Structured Data, delete the <code>Comment</code> class, and try importing again. The LeanCloud page may not refresh immediately—use <code>Ctrl+F5</code> to force a cache refresh.</p>
<p>After a successful import, manually adjust the <code>url</code> for each comment.<br>
For example, my posts need to be categorized under <code>&quot;url&quot;:&quot;\/zh-cn\/post\/category\/</code>. Use LeanCloud&rsquo;s <strong>batch operations</strong> and <strong>filtering</strong> features to streamline this process.</p>
<h2 id="afterword">
<a class="header-anchor" href="#afterword"></a>
Afterword
</h2><p>Organizing comments didn&rsquo;t take too long—120 comments, mostly my own musings on the &ldquo;Thoughts&rdquo; page, allowed for bulk URL fixes. The handful of reader comments were scattered across just a few posts, making them easy to update via filtering. Whether that&rsquo;s a good or bad thing, I’m not sure (laughs).</p>
<p>Whether they&rsquo;re my soliloquies or others&rsquo; remarks, each comment holds unique significance. Revisiting them periodically brings new reflections.<br>
As I said at the beginning, they&rsquo;re traces of my growth, proof of my existence, and part of &ldquo;me&rdquo;.</p>
<p>And you, dear reader, are the one who gives me value.</p>
<p>If you have time, please leave a comment—it’ll genuinely make my day (as long as it’s kind, of course).</p>
        
        <hr><p>Published on 2025-04-19 at <a href='https://www.guzhengsvt.cn/'>孤筝の温暖小家</a>, last modified on 2025-04-19</p><p>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</p>]]></description><category>OtherNotes</category></item><item><title>Common Hugo Blog Resources</title><link>https://www.guzhengsvt.cn/en/post/othernotes/hugo%E5%8D%9A%E5%AE%A2%E5%B8%B8%E7%94%A8%E8%B5%84%E6%96%99/</link><pubDate>Tue, 15 Apr 2025 16:42:35 +0800</pubDate><author>lvbowen040427@163.com (孤筝)</author><guid>https://www.guzhengsvt.cn/en/post/othernotes/hugo%E5%8D%9A%E5%AE%A2%E5%B8%B8%E7%94%A8%E8%B5%84%E6%96%99/</guid><description>
<![CDATA[<h1>Common Hugo Blog Resources</h1><p>Author: 孤筝(lvbowen040427@163.com)</p>
        
          <h2 id="hugo-common-commands">
<a class="header-anchor" href="#hugo-common-commands"></a>
Hugo Common Commands
</h2><table>
  <thead>
      <tr>
          <th>Command</th>
          <th>Function</th>
          <th>Description</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>hugo version</code></td>
          <td>Check version</td>
          <td>Displays the currently installed Hugo version</td>
      </tr>
      <tr>
          <td><code>hugo new site &lt;project_name&gt;</code></td>
          <td>Create new site</td>
          <td>Generates Hugo&rsquo;s directory structure</td>
      </tr>
      <tr>
          <td><code>hugo new post/&lt;filename.md&gt;</code></td>
          <td>Create new post</td>
          <td>Generates an article under <code>content/post/</code> with default Front Matter</td>
      </tr>
      <tr>
          <td><code>hugo server</code></td>
          <td>Start local server</td>
          <td>Launches local preview at <code>http://localhost:1313</code> by default</td>
      </tr>
      <tr>
          <td><code>hugo server -D</code></td>
          <td>Start with drafts</td>
          <td><code>-D</code> parameter shows articles marked <code>draft: true</code></td>
      </tr>
      <tr>
          <td><code>hugo</code></td>
          <td>Build website</td>
          <td>Generates static files from Markdown content to <code>public/</code> directory</td>
      </tr>
      <tr>
          <td><code>hugo -D &lt;output_dir&gt;</code></td>
          <td>Build including drafts</td>
          <td>Full site build (including drafts) for pre-publishing</td>
      </tr>
      <tr>
          <td><code>hugo --minify</code></td>
          <td>Minify build files</td>
          <td>Compresses HTML/CSS/JS during build to reduce size</td>
      </tr>
      <tr>
          <td><code>hugo config</code></td>
          <td>View configuration</td>
          <td>Displays current site configuration</td>
      </tr>
      <tr>
          <td><code>hugo list drafts</code></td>
          <td>List drafts</td>
          <td>Shows all articles marked <code>draft: true</code></td>
      </tr>
      <tr>
          <td><code>hugo list future</code></td>
          <td>List future posts</td>
          <td>Articles with <code>date</code> set after current time</td>
      </tr>
      <tr>
          <td><code>hugo list expired</code></td>
          <td>List expired posts</td>
          <td>Articles where <code>expiryDate</code> has passed</td>
      </tr>
      <tr>
          <td><code>hugo --gc</code></td>
          <td>Garbage collection</td>
          <td>Cleans outdated resources like thumbnail caches</td>
      </tr>
  </tbody>
</table>
<h2 id="reimu-theme-icon_font">
<a class="header-anchor" href="#reimu-theme-icon_font"></a>
reimu Theme icon_font
</h2><table>
  <thead>
      <tr>
          <th>Icon Class</th>
          <th>Hex Code</th>
          <th>Chinese Meaning</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>.tag-wrap</code> / <code>.article-tag-list-link</code></td>
          <td><code>\e622</code></td>
          <td>Tag</td>
      </tr>
      <tr>
          <td><code>.category-wrap</code> / <code>.article-category-link</code></td>
          <td><code>\e604</code></td>
          <td>Category</td>
      </tr>
      <tr>
          <td><code>.article-date-link</code></td>
          <td><code>\e606</code></td>
          <td>Date</td>
      </tr>
      <tr>
          <td><code>.article-comment-link</code></td>
          <td><code>\e608</code></td>
          <td>Comment</td>
      </tr>
      <tr>
          <td><code>.icon-copyright</code></td>
          <td><code>\e60a</code></td>
          <td>Copyright</td>
      </tr>
      <tr>
          <td><code>.icon-brush</code></td>
          <td><code>\e618</code></td>
          <td>Brush / Beautify</td>
      </tr>
      <tr>
          <td><code>.icon-coffee</code></td>
          <td><code>\e607</code></td>
          <td>Coffee</td>
      </tr>
      <tr>
          <td><code>.icon-eye</code></td>
          <td><code>\e60f</code></td>
          <td>View / Browse</td>
      </tr>
      <tr>
          <td><code>.icon-user</code></td>
          <td><code>\e628</code></td>
          <td>User</td>
      </tr>
      <tr>
          <td><code>#main-nav-toggle</code></td>
          <td><code>\e62f</code></td>
          <td>Navigation menu toggle</td>
      </tr>
      <tr>
          <td><code>#nav-rss-link</code></td>
          <td><code>\e61f</code></td>
          <td>RSS subscription</td>
      </tr>
      <tr>
          <td><code>#nav-search-btn</code> / <code>.reimu-search-input-icon</code></td>
          <td><code>\e631</code></td>
          <td>Search button</td>
      </tr>
      <tr>
          <td><code>#nav-sun-btn</code></td>
          <td><code>\e621</code></td>
          <td>Sun icon (light theme)</td>
      </tr>
      <tr>
          <td><code>#nav-moon-btn</code></td>
          <td><code>\e617</code></td>
          <td>Moon icon (dark theme)</td>
      </tr>
      <tr>
          <td><code>#nav-circle-half-stroke-btn</code></td>
          <td><code>\e641</code></td>
          <td>Half-circle (theme toggle)</td>
      </tr>
      <tr>
          <td><code>.icon-copy</code></td>
          <td><code>\e60c</code></td>
          <td>Copy</td>
      </tr>
      <tr>
          <td><code>.icon-chevron-down</code></td>
          <td><code>\e609</code></td>
          <td>Down arrow</td>
      </tr>
      <tr>
          <td><code>.icon-check</code></td>
          <td><code>\e636</code></td>
          <td>Checkmark / Confirm</td>
      </tr>
      <tr>
          <td><code>.icon-times</code></td>
          <td><code>\e637</code></td>
          <td>Cross / Close</td>
      </tr>
      <tr>
          <td><code>.icon-calendar</code></td>
          <td><code>\e605</code></td>
          <td>Calendar</td>
      </tr>
      <tr>
          <td><code>.icon-pencil</code></td>
          <td><code>\e61b</code></td>
          <td>Pencil / Edit</td>
      </tr>
      <tr>
          <td><code>.icon-clock</code></td>
          <td><code>\e613</code></td>
          <td>Clock</td>
      </tr>
      <tr>
          <td><code>.post-sticky</code></td>
          <td><code>\e627</code></td>
          <td>Pinned</td>
      </tr>
      <tr>
          <td><code>.reimu-popup .popup-btn-close</code></td>
          <td><code>\e626</code></td>
          <td>Popup close</td>
      </tr>
      <tr>
          <td><code>.ais-pagination--item__previous</code></td>
          <td><code>\e601</code></td>
          <td>Previous page</td>
      </tr>
      <tr>
          <td><code>.ais-pagination--item__next</code></td>
          <td><code>\e630</code></td>
          <td>Next page</td>
      </tr>
      <tr>
          <td><code>.icon-github</code></td>
          <td><code>\e619</code></td>
          <td>GitHub icon</td>
      </tr>
      <tr>
          <td><code>.icon-google</code></td>
          <td><code>\e611</code></td>
          <td>Google icon</td>
      </tr>
      <tr>
          <td><code>.icon-facebook</code></td>
          <td><code>\e60e</code></td>
          <td>Facebook icon</td>
      </tr>
      <tr>
          <td><code>.icon-twitter</code></td>
          <td><code>\e62a</code></td>
          <td>Twitter icon</td>
      </tr>
      <tr>
          <td><code>.icon-instagram</code></td>
          <td><code>\e615</code></td>
          <td>Instagram icon</td>
      </tr>
      <tr>
          <td><code>.icon-linkedin</code></td>
          <td><code>\e614</code></td>
          <td>LinkedIn icon</td>
      </tr>
      <tr>
          <td><code>.icon-pinterest</code></td>
          <td><code>\e61a</code></td>
          <td>Pinterest icon</td>
      </tr>
      <tr>
          <td><code>.icon-youtube</code></td>
          <td><code>\e62d</code></td>
          <td>YouTube icon</td>
      </tr>
      <tr>
          <td><code>.icon-vimeo</code></td>
          <td><code>\e629</code></td>
          <td>Vimeo icon</td>
      </tr>
      <tr>
          <td><code>.icon-flickr</code></td>
          <td><code>\e612</code></td>
          <td>Flickr icon</td>
      </tr>
      <tr>
          <td><code>.icon-dribbble</code></td>
          <td><code>\e610</code></td>
          <td>Dribbble icon</td>
      </tr>
      <tr>
          <td><code>.icon-behance</code></td>
          <td><code>\e602</code></td>
          <td>Behance icon</td>
      </tr>
      <tr>
          <td><code>.icon-bilibili</code></td>
          <td><code>\e603</code></td>
          <td>Bilibili icon</td>
      </tr>
      <tr>
          <td><code>.icon-weibo</code></td>
          <td><code>\e62c</code></td>
          <td>Weibo icon</td>
      </tr>
      <tr>
          <td><code>.icon-zhihu</code></td>
          <td><code>\e62e</code></td>
          <td>Zhihu icon</td>
      </tr>
      <tr>
          <td><code>.icon-reddit</code></td>
          <td><code>\e61c</code></td>
          <td>Reddit icon</td>
      </tr>
      <tr>
          <td><code>.icon-tumblr</code></td>
          <td><code>\e625</code></td>
          <td>Tumblr icon</td>
      </tr>
      <tr>
          <td><code>.icon-medium</code></td>
          <td><code>\e616</code></td>
          <td>Medium icon</td>
      </tr>
      <tr>
          <td><code>.icon-deviantart</code></td>
          <td><code>\e60b</code></td>
          <td>DeviantArt icon</td>
      </tr>
      <tr>
          <td><code>.icon-stackoverflow</code></td>
          <td><code>\e620</code></td>
          <td>StackOverflow icon</td>
      </tr>
      <tr>
          <td><code>.icon-keybase</code></td>
          <td><code>\e61e</code></td>
          <td>Keybase icon</td>
      </tr>
      <tr>
          <td><code>.icon-telegram</code></td>
          <td><code>\e623</code></td>
          <td>Telegram icon</td>
      </tr>
      <tr>
          <td><code>.icon-discord</code></td>
          <td><code>\e60d</code></td>
          <td>Discord icon</td>
      </tr>
      <tr>
          <td><code>.icon-steam</code></td>
          <td><code>\e624</code></td>
          <td>Steam icon</td>
      </tr>
      <tr>
          <td><code>.icon-email</code></td>
          <td><code>\e63c</code></td>
          <td>Email</td>
      </tr>
      <tr>
          <td><code>.sidebar-toc-btn</code></td>
          <td><code>\e633</code></td>
          <td>Table of Contents button</td>
      </tr>
      <tr>
          <td><code>.sidebar-common-btn</code></td>
          <td><code>\e632</code></td>
          <td>Sidebar common button</td>
      </tr>
      <tr>
          <td><code>.sidebar-top .arrow-up</code></td>
          <td><code>\e634</code></td>
          <td>Up arrow</td>
      </tr>
      <tr>
          <td><code>.icon-link</code></td>
          <td><code>\e639</code></td>
          <td>Link</td>
      </tr>
      <tr>
          <td><code>.icon-globe</code></td>
          <td><code>\e638</code></td>
          <td>Globe / Multilingual</td>
      </tr>
      <tr>
          <td><code>.icon-creative-commons</code></td>
          <td><code>\e63a</code></td>
          <td>Creative Commons license</td>
      </tr>
      <tr>
          <td><code>.icon-taichi</code></td>
          <td><code>\e62b</code></td>
          <td>Taichi (dark mode)</td>
      </tr>
      <tr>
          <td><code>.icon-weixin</code></td>
          <td><code>\e640</code></td>
          <td>WeChat icon</td>
      </tr>
      <tr>
          <td><code>.icon-qq</code></td>
          <td><code>\e63e</code></td>
          <td>QQ icon</td>
      </tr>
      <tr>
          <td><code>.icon-image</code></td>
          <td><code>\e63f</code></td>
          <td>Image icon</td>
      </tr>
  </tbody>
</table>

        
        <hr><p>Published on 2025-04-15 at <a href='https://www.guzhengsvt.cn/'>孤筝の温暖小家</a>, last modified on 2025-04-15</p><p>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</p>]]></description><category>OtherNotes</category></item><item><title>Hello World</title><link>https://www.guzhengsvt.cn/en/post/thoughts/hello-world/</link><pubDate>Sun, 13 Apr 2025 11:00:00 +0800</pubDate><author>lvbowen040427@163.com (孤筝)</author><guid>https://www.guzhengsvt.cn/en/post/thoughts/hello-world/</guid><description>
<![CDATA[<h1>Hello World</h1><p>Author: 孤筝(lvbowen040427@163.com)</p>
        
          <h2 id="20250413">
<a class="header-anchor" href="#20250413"></a>
2025.04.13
</h2><p>After two days of tinkering, I finally set up my Hugo blog using the <a href="https://github.com/D-Sketon/hexo-theme-reimu">reimu</a> theme.</p>
<p>Unsatisfied with the response speed of my previous <a href="https://guzhengsvt.top/">Typecho blog</a>, I decided to migrate my blog again. (Although Typecho is already quite lightweight, the poor cloud server and bandwidth severely limited access and article loading speeds.)</p>
<p>After abandoning dynamic solutions, the static options available were essentially Hexo, Hugo, Jekyll, etc. I chose Hugo simply because of its slogan: <em><strong>The world’s fastest framework for building websites</strong></em>.</p>
<p>I’ll gradually move the content from my old blog over here during this time. I looked up some Typecho-to-Hugo conversion methods, but most were outdated and unusable (Typecho and PHP are too old, which is another reason for my switch). I’ll have to resort to the tedious method of manually exporting articles, editing them, and importing them into Hugo.</p>
<p>I also need to figure out how to replicate comments and &ldquo;shuoshuo&rdquo; (microblogging). Hugo requires an external commenting system.</p>
<p>Then, to speed up image loading, I’ll need to set up an image hosting service and replace the image links in previous articles.</p>
<p>To avoid irreversible impacts on the old blog, Hugo is currently hosted on GitHub Pages. However, GitHub is unstable in China, so once I’ve fully migrated the content and completed the setup, I’ll copy it to my cloud virtual host.</p>
<p>Why is there so much to do? Damn.</p>
<h2 id="test">
<a class="header-anchor" href="#test"></a>
Test
</h2><p>Testing the new blog.</p>
<p>markdown</p>
<h2 id="level-2-heading">
<a class="header-anchor" href="#level-2-heading"></a>
Level 2 Heading
</h2><h3 id="level-3-heading">
<a class="header-anchor" href="#level-3-heading"></a>
Level 3 Heading
</h3><h4 id="level-4-heading">
<a class="header-anchor" href="#level-4-heading"></a>
Level 4 Heading
</h4><h5 id="level-5-heading">
<a class="header-anchor" href="#level-5-heading"></a>
Level 5 Heading
</h5><h6 id="level-6-heading">
<a class="header-anchor" href="#level-6-heading"></a>
Level 6 Heading
</h6><ol>
<li>Item</li>
<li>Item</li>
</ol>
<ul>
<li>Item</li>
</ul>
<p><del>Strikethrough</del></p>
<p><strong>Bold</strong></p>
<p><em>Italic</em></p>
<p>KaTex test</p>
<p>$\frac{1}{2}$</p>
$$
\frac{520}{1314}
$$<p>code test</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="s2">&#34;hello world&#34;</span><span class="p">)</span>
</span></span></code></pre></div><p>icon: <!-- raw HTML omitted --><!-- raw HTML omitted --> A cup of coffee</p>

        
        <hr><p>Published on 2025-04-13 at <a href='https://www.guzhengsvt.cn/'>孤筝の温暖小家</a>, last modified on 2025-04-13</p><p>All articles on this blog are licensed under the BY-NC-SA license agreement unless otherwise stated. Please indicate the source when reprinting!</p>]]></description><category>Thoughts</category></item></channel></rss>