repo
stringlengths 26
115
| file
stringlengths 54
212
| language
stringclasses 2
values | license
stringclasses 16
values | content
stringlengths 19
1.07M
|
---|---|---|---|---|
https://github.com/isaacholt100/isaacholt100.github.io | https://raw.githubusercontent.com/isaacholt100/isaacholt100.github.io/master/cv/isaac-holt-cv.typ | typst | #set text(font: "New Computer Modern")
#show link: underline
#show link: set text(fill: blue)
#set page(
margin: (x: 0.9cm, y: 1cm),
)
#set text(
size: 10pt,
)
#set par(justify: true)
#let hr() = {v(-8pt); line(length: 100%); v(-2pt)}
#let dates(from, to) = text(rgb(128, 128, 128), [#h(1fr) #from -- #to])
#show heading: it => if it.level == 2 [
#it.body
#hr()
] else [
#it
]
// = <NAME>
// #link("tel:+447393098225")[+44 7393 098225] |
// #link("mailto:<EMAIL>")[<EMAIL>] |
// #link("https://www.linkedin.com/in/isaacholt100/")[linkedin.com/in/isaacholt100] |
// #link("https://github.com/isaacholt100")[GitHub] |
// #link("https://isaacholt.vercel.app")[Personal Website]
// == Summary
// Highly capable mathematician, with a final year average grade of 97% at undergraduate (the highest in my year), who excels at tackling difficult and technical problems. Strong skills in a variety of programming languages and owner of a popular Rust library with over 500,000 downloads. Experience in mathematical research, soon-to-be co-author of a paper on tropical geometry. Focussed and driven, with a passion for setting challenging goals and achieving them.
// == Education
// *University of Cambridge*, MASt in Pure Mathematics #dates("10/2024", "06/2025") \
// *Durham University*, BSc Mathematics #dates("09/2021", "06/2024") \
// - Classification: First Class Honours.
// - Grade: 95% (joint-highest in my cohort).
// - Awards: The Mathematical Sciences Best 3H Student Prize
// *Colchester Royal Grammar School* #dates("09/2019", "06/2021") \
// - A Levels: Mathematics (A\*), Further Mathematics (A\*), Physics (A\*), Latin (A\*).
// - Awards: Year 13 Prize for Further Mathematics.
// == Research Experience
// *Research Project in Tropical Geometry* #dates("06/2023", "07/2023") \
// Department of Mathematical Sciences, Durham University \
// - Area of research was how the tropical modification of certain polynomial systems can be used to determine the generic root count of those systems.
// - The results of our work are expected to be published in a paper by the end of this year.
// - Invited by supervisor to attend a #link("https://www.oscar-system.org/meetings/2023-09/")[working group] for the OSCAR computer algebra system in Germany, to write code related to the project.
// == Work Experience
// *Web and Communications Internship* #dates("07/2023", "08/2023") \
// Grey College, Durham University \
// - Created a #link("https://www.greyscr.co.uk")[new website] for Grey College Senior Common Room, using React, Next.js, Bootstrap, and KV storage.
// - Built an admin dashboard with an email client for sending markdown emails and templated emails.
// - Developed a password-less email authentication system.
// *Student Digital Leader* #h(1fr) #dates("09/2022", "06/2023") \
// Durham University \
// - Part of a pool of students who worked on various technical projects for the university.
// - For the first few weeks, I worked in online support with the university's digital services for new students.
// - I then worked as a UAT (User Acceptance Testing) Analyst within this role, using Azure DevOps and Jira to pass/fail test cases and report bugs for a new event-booking website that the university is launching.
// *Software Tester* #h(1fr) #dates("01/2021", "03/2021") \
// Blutick \
// - Tested Blutick's marking software for online GCSE maths exams, reported bugs I found when using the website.
// - Given the responsibility of editing the online questions and mark schemes myself using Latex.
// - Developed TypeScript program to generate all solutions for questions where many combinations of answers were allowed.
// == Projects
// *bnum* #h(1fr) #dates("05/2021", "Present") \
// Mathematical #link("https://crates.io/crates/bnum")[Rust library] with over 500,000 downloads that uniquely provides fixed size signed and unsigned integer types, designed to extend functionality of Rust's primitive integer types to arbitrary bit sizes. Used by a blockchain-related package.
// == Extracurriculars
// Piano (ABRSM Grade 8 Distinction) |
// Durham University Chess Society |
// Durham University Spaceflight Society |
// Durham University Mathematical Problem Solving Society |
// Grey College Table Tennis A Team |
// Grey College Badminton B Team |
// Durham University Chess Society |
// Durham University Quant Fund |
// Co-leader of Physics and Maths Society at Sixth Form
// == Skills
// Mathematics | Rust | JavaScript | Python | Latex | Programming | Research
// #set text(font: "New Computer Modern")
// #pagebreak()
#show link: underline
#show link: set text(fill: blue)
#set page(
margin: (x: 0.9cm, y: 1cm),
)
#set text(
size: 11pt,
)
#set par(justify: true)
#let hr() = {v(-8pt); line(length: 100%); v(-2pt)}
#let dates(from, to) = text(rgb(128, 128, 128), [#h(1fr) #from -- #to])
#let date(d) = text(rgb(128, 128, 128), [#h(1fr) #d])
#show heading: it => if it.level == 2 [
#it.body
#hr()
] else [
#it
]
= <NAME>
#link("tel:+447393098225")[+447393098225] |
#link("mailto:<EMAIL>")[<EMAIL>] |
#link("https://www.linkedin.com/in/isaacholt100/")[linkedin.com/in/isaacholt100]
== Summary
- Highly capable mathematician, with the joint-highest grade in my undergraduate cohort.
- Involved in two summer research projects.
- Co-author of a chapter in a book published in Springer's _Algorithms and Computation in Mathematics_ series.
- Developer of a popular big integer library.
== Education
*University of Cambridge*, MASt in Pure Mathematics #date("Current") \
*Durham University*, BSc Mathematics #dates("09/2021", "06/2024") \
- Grade: First Class Honours
- Marks: 90% (first year), 92% (second year), 97% (third year)
- Awards: The Mathematical Sciences Best 3H Student Prize
*Colchester Royal Grammar School* #dates("09/2019", "06/2021") \
- A-levels: Mathematics (A\*, 99%), Further Mathematics (A\*, 97%), Physics (A\*, 91%), Latin (A\*, 90%)
- Awards: Year 13 Prize for Further Mathematics
== Research Experience
*Summer Research Project* - Durham University #dates("06/2023", "07/2023") \
- Researched and wrote a paper on using tropical geometry to determine the generic root count of a certain class of polynomial systems.
// - Area of research was in tropical geometry; specifically, how the modification and tropicalisation of horizontally parametrised polynomial systems can be used to determine the generic root count of those systems.
- First four weeks were mostly spent learning about the area and reading relevant books and materials.
- Last four weeks were devoted to formulating and proving a new result, where I produced a generalised proof of a theorem from a recent paper on the number of equilibria of coupled nonlinear oscillators.
- Paper has been published on #link("https://arxiv.org/abs/2311.18018")[arXiv] and as a chapter in the book _The OSCAR Computer Algebra System_.
- Invited by my supervisor to attend a #link("https://www.oscar-system.org/meetings/2023-09/")[working group] for OSCAR at Paderborn University, Germany, to write a #link("https://github.com/isaacholt100/generic_root_count")[program] in Julia for the paper.
*Mitacs Globalink Research Internship* - University of British Columbia #dates("06/2024", "09/2024")
- Worked on two projects: one on improving the accuracy of reconstruction of intersecting multi-surfaces (arising from atomic potential energy surfaces) given value-sorted sample data, the other relating to the benefits and drawbacks of encoding symmetries (such as rotation invariance) of a physical system into a model of that system versus "learning" these symmetries via data augmentation.
- Expecting to be a co-author of a paper on both projects.
== Work Experience
*Web and Communications Internship* - Grey College, Durham University #dates("07/2023", "08/2023") \
- Developed the #link("https://www.greyscr.<EMAIL>")[new website] for Grey College's Senior Common Room.
*Student Digital Leader* - Durham University #dates("09/2022", "06/2023") \
- Worked as a User Acceptance Testing Analyst, using Azure DevOps to pass/fail test cases and report bugs for a new university-funded event-booking website.
*Software Tester* - Blutick #dates("01/2021", "03/2021") \
- Tested and contributed to Blutick's (now owned by AQA) marking software for online GCSE maths exams.
== Publications
#place(hide(bibliography("./publications.bib")))
#cite(<holt2023generic>, form: "full", style: "apa") \
#cite(<hr2023chapter>, form: "full", style: "apa")
== Conferences
*Tomorrow's Mathematicians Today 2024* - IMA & University of Greenwich (Online) #date("03/2024")
- #link("https://sites.google.com/view/imatmt2024/")[Undergraduate mathematics conference] at which I presented a brief introduction to tropical geometry and an overview of my summer project on it.
== Projects
*bnum* #dates("05/2021", "Present") \
- Mathematical #link("https://crates.io/crates/bnum")[Rust library] for operating on arbitrarily-sized integers, with over 750,000 downloads.
- A dependency for four other libraries, including a popular smart contract package.
- The only library (to my knowledge) to extend functionality of Rust's primitive integer types to arbitrary, fixed size signed and unsigned integers.
- Development involved researching arithmetical algorithms, e.g. integer division, exponentiation by squaring.
== Selected Extracurriculars
- Simon Marais Mathematics Competition (2022, 2023)
- Imperial-Cambridge Mathematics Competition (2022, 2023)
- British Mathematical Olympiad Round 1 (2020)
- ABRSM Grade 8 Piano (Distinction) |
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/recursion-04.typ | typst | Other | // Error: 15-21 maximum function call depth exceeded
#let rec(n) = rec(n) + 1
#rec(1)
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz/0.2.0/src/lib/decorations/brace.typ | typst | Apache License 2.0 | #import "/src/vector.typ"
#import "/src/matrix.typ"
#import "/src/util.typ"
#import "/src/draw.typ": *
#import "/src/coordinate.typ"
#import "/src/styles.typ"
// Rotates the vector 'ab' around 'a' and scales it to 'len', returns the absolute point 'c'.
#let _rotate-around(a, b, angle: 90deg, len: auto) = {
let rel = vector.sub(b, a)
let rotated = util.apply-transform(matrix.transform-rotate-z(angle), rel)
let scaled = if len == auto {
rotated
} else {
vector.scale(vector.norm(rotated), len)
}
return vector.add(a, scaled)
}
#let brace-default-style = (
amplitude: .5,
pointiness: 15deg,
outer-pointiness: 0deg,
content-offset: .3,
debug-text-size: 6pt,
)
/// Draw a curly brace between two points.
///
/// #example(```
/// cetz.decorations.brace((0,1),(2,1))
///
/// cetz.decorations.brace((0,0),(2,0),
/// pointiness: 45deg, outer-pointiness: 45deg)
/// cetz.decorations.brace((0,-1),(2,-1),
/// pointiness: 90deg, outer-pointiness: 90deg)
/// ```)
///
/// *Style Root:* `brace`. \
/// *Style Keys:*
/// #show-parameter-block("amplitude", ("number"), [
/// Sets the height of the brace, from its baseline to its middle tip.], default: .5)
/// #show-parameter-block("pointiness", ("ratio", "angle"), [
/// How pointy the spike should be. #0deg or `0%` for maximum pointiness, #90deg or `100%` for minimum.], default: 15deg)
/// #show-parameter-block("outer-pointiness", ("ratio", "angle"), [
/// How pointy the outer edges should be. #0deg or `0` for maximum pointiness (allowing for a smooth transition to a straight line), #90deg or `1` for minimum. Setting this to #auto will use the value set for `pointiness`.], default: 15deg)
/// #show-parameter-block("content-offset", ("number","length"), [
/// Offset of the `"content"` anchor from the spike of the brace.], default: .3)
///
/// *Anchors:*
/// / start: Where the brace starts, same as the `start` parameter.
/// / end: Where the brace end, same as the `end` parameter.
/// / spike: Point of the spike, halfway between `start` and `end` and shifted
/// by `amplitude` towards the pointing direction.
/// / content: Point to place content/text at, in front of the spike.
/// / center: Center of the enclosing rectangle.
///
/// - start (coordinate): Start point
/// - end (coordinate): End point
/// - flip (bool): Flip the brace around
/// - name (string, none): Element name used for querying anchors
/// - ..style (style): Style key-value pairs
#let brace(
start,
end,
flip: false,
debug: false,
name: none,
..style,
) = {
// Validate coordinates
let t = (start, end).map(coordinate.resolve-system)
group(name: name, ctx => {
// Get styles and validate types and values
let style = styles.resolve(ctx.style, merge: style.named(),
root: "brace", base: brace-default-style)
let amplitude = style.amplitude
assert(
type(amplitude) in (int, float),
message: "amplitude must be a number, got " + repr(amplitude),
)
let pointiness = style.pointiness
assert(
(type(pointiness) in (int, float)
and pointiness >= 0 and pointiness <= 1)
or (type(pointiness) == ratio
and pointiness >= 0% and pointiness <= 100%)
or (type(pointiness) == angle
and pointiness >= 0deg and pointiness <= 90deg),
message: "pointiness must be a factor between 0 and 1 or an angle between 0deg and 90deg, got " + repr(pointiness),
)
let pointiness = if type(pointiness) == angle { pointiness } else { pointiness * 90deg }
let outer-pointiness = style.outer-pointiness
assert(
outer-pointiness == auto
or (type(outer-pointiness) in (int, float)
and outer-pointiness >= 0 and outer-pointiness <= 1)
or (type(outer-pointiness) == ratio)
and outer-pointiness >= 0% and outer-pointiness <= 100%
or (type(outer-pointiness) == angle
and outer-pointiness >= 0deg and outer-pointiness <= 90deg),
message: "outer-pointiness must be a factor between 0 and 1 or an angle between 0deg and 90deg or auto, got " + repr(outer-pointiness),
)
let outer-pointiness = if outer-pointiness == auto {
pointiness
} else if type(outer-pointiness) == angle {
outer-pointiness
} else {
outer-pointiness * 90deg
}
let content-offset = style.content-offset
assert(
type(content-offset) in (int, float),
message: "content-offset must be a number, got " + repr(content-offset),
)
// we flip the brace by inverting the amplitude and pointiness values
if flip {
amplitude *= -1
pointiness *= -1
outer-pointiness *= -1
}
// 'abcd' is a rectangle with the base line 'ab' and the height 'amplitude'
let a = start
let b = end
let c = (_rotate-around.with(len: amplitude, angle: -90deg), b, a)
let d = (_rotate-around.with(len: amplitude, angle: +90deg), a, b)
if debug {
line(a, b, stroke: red)
line(b, c, stroke: blue)
line(c, d, stroke: olive)
line(d, a, stroke: yellow)
}
// 'ef' is the perpendicular line in the center of that rectangle, with length 'amplitude'
let e = (a, 50%, b)
let f = (c, 50%, d)
if debug {
line(e, f, stroke: eastern)
}
// 'g' and 'h' are the control points for the middle spike
let g = (_rotate-around.with(angle: -pointiness), f, e)
let h = (_rotate-around.with(angle: +pointiness), f, e)
if debug {
line(f, g, stroke: purple)
line(f, h, stroke: orange)
}
// 'i' and 'j' are the control points for the outer ends
let i = (_rotate-around.with(angle: -outer-pointiness), a, d)
let j = (_rotate-around.with(angle: +outer-pointiness), b, c)
if debug {
line(a, i, stroke: purple)
line(b, j, stroke: orange)
}
// 'k' is the point where the content should be placed. It is offset from the spike (point 'f')
// by 'content-offset' in the direction the spike is pointing
let k = ((a, b) => {
let rel = vector.sub(b, a)
let scaled = vector.scale(vector.norm(rel), vector.len(rel) + content-offset)
return vector.add(a, scaled)
}, e, f)
let points = (a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h, i: i, j: j, k: k)
// combine the two bezier curves using 'merge-path' and apply styling
merge-path({
bezier(a, f, i, g)
bezier(f, b, h, j)
}, ..style)
// define some named anchors
anchor("spike", f)
anchor("content", k)
anchor("start", a)
anchor("end", b)
anchor("center", (e, 50%, f))
// define anchors for all points
for (name, point) in points {
anchor(name, point)
}
// label all points in debug mode
if debug {
for (name, point) in points {
content(point, box(fill: luma(240), inset: .5pt, text(style.debug-text-size, raw(name))))
}
}
})
// move to end point so the current position after this is the end position
move-to(end)
}
#let flat-brace-default-style = (
amplitude: .3,
aspect: 50%,
curves: (1, .5, .6, .15),
outer-curves: auto,
content-offset: .3,
debug-text-size: 6pt,
)
/// Draw a flat curly brace between two points.
///
/// #example(```
/// cetz.decorations.flat-brace((0,1),(2,1))
///
/// cetz.decorations.flat-brace((0,0),(2,0),
/// curves: .2,
/// aspect: 25%)
/// cetz.decorations.flat-brace((0,-1),(2,-1),
/// outer-curves: 0,
/// aspect: 75%)
/// ```)
///
/// This mimics the braces from TikZ's `decorations.pathreplacing` library#footnote[https://github.com/pgf-tikz/pgf/blob/6e5fd71581ab04351a89553a259b57988bc28140/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex#L136-L185].
/// In contrast to @@brace(), these braces use straight line segments, resulting
/// in better looks for long braces with a small amplitude.
///
/// *Style Root:* `flat-brace` \
/// *Style Keys:*
/// #show-parameter-block("amplitude", ("number"), [
/// Determines how much the brace rises above the base line.], default: .3)
/// #show-parameter-block("aspect", ("ratio"), [
/// Determines the fraction of the total length where the spike will be placed.], default: 50%)
/// #show-parameter-block("curves", ("number"), [
/// Curviness factor of the brace, a factor of 0 means no curves.], default: auto)
/// #show-parameter-block("outer-curves", ("auto", "number"), [
/// Curviness factor of the outer curves of the brace. A factor of 0 means no curves.], default: auto)
///
/// *Anchors:*
/// / start: Where the brace starts, same as the `start` parameter.
/// / end: Where the brace end, same as the `end` parameter.
/// / spike: Point of the spike's top.
/// / content: Point to place content/text at, in front of the spike.
/// / center: Center of the enclosing rectangle.
///
/// - start (coordinate): Start point
/// - end (coordinate): End point
/// - flip (bool): Flip the brace around
/// - name (string, none): Element name for querying anchors
/// - ..style (style): Style key-value pairs
#let flat-brace(
start,
end,
flip: false,
debug: false,
name: none,
..style,
) = {
// Validate coordinates
let t = (start, end).map(coordinate.resolve-system)
group(name: name, ctx => {
// Get styles and validate their types and values
let style = styles.resolve(ctx.style, merge: style.named(),
root: "flat-brace", base: flat-brace-default-style)
let amplitude = style.amplitude
assert(
type(amplitude) in (int, float),
message: "amplitude must be a number, got " + repr(amplitude),
)
// we achieve flipping by inverting the amplitude
if flip { amplitude *= -1 }
let aspect = style.aspect
assert(
(type(aspect) == ratio
and aspect >= 0% and aspect <= 100%)
or (type(aspect) in (int, float)
and aspect >= 0 and aspect <= 1),
message: "aspect must be a ratio between 0% and 100%, got " + repr(aspect),
)
if type(aspect) == ratio { aspect /= 100% }
let inner-curves = style.curves
assert(
type(inner-curves) in (int, float)
or type(inner-curves) == array
and inner-curves.all(v => type(v) in (int, float, type(auto))),
message: "curves must be a number, or an array of numbers or auto, got " + repr(inner-curves),
)
if type(inner-curves) in (int, float) { inner-curves = (inner-curves,) }
while inner-curves.len() < flat-brace-default-style.curves.len() {
inner-curves.push(auto)
}
inner-curves = inner-curves.enumerate().map(((idx, v)) => if v == auto {
flat-brace-default-style.curves.at(idx)
} else { v })
let outer-curves = style.outer-curves
assert(
type(outer-curves) in (int, float, type(auto))
or type(outer-curves) == array
and outer-curves.all(v => type(v) in (int, float, type(auto))),
message: "outer-curves must be auto, a number, or an array of numbers or auto, got " + repr(outer-curves),
)
if outer-curves == auto {
outer-curves = inner-curves
} else {
if type(outer-curves) in (int, float) { outer-curves = (outer-curves,) }
while outer-curves.len() < inner-curves.len() { outer-curves.push(auto) }
outer-curves = outer-curves.enumerate()
.map(((idx, v)) => if v == auto { inner-curves.at(idx) } else { v })
}
let content-offset = style.content-offset
assert(
type(content-offset) in (int, float),
message: "content-offset must be a number, got " + repr(content-offset),
)
// all the following code assumes the brace to start at (0, 0), growing to the right,
// pointing upwards, so we set the origin and rotate the entire group accordingly
let (_, start, end) = coordinate.resolve(ctx, start, end)
set-origin(start)
rotate(vector.angle2(start, end) * -1)
let length = vector.dist(start, end)
let middle = aspect * length
let horizon = amplitude / 2
let normal-outer = calc.abs(amplitude * outer-curves.at(0))
let normal-inner = calc.abs(amplitude * inner-curves.at(0))
let length-left = middle
let length-right = length - middle
// width of left-outer, left-inner, right-inner, right-outer curve segments
let lo = if 2 * normal-outer > length-left { length-left / 2 } else { normal-outer }
let li = if 2 * normal-inner > length-left { length-left / 2 } else { normal-inner }
let ri = if 2 * normal-inner > length-right { length-right / 2 } else { normal-inner }
let ro = if 2 * normal-outer > length-right { length-right / 2 } else { normal-outer }
// 'a' and 'b' are start and end
let a = ( 0, 0)
let b = (length, 0)
// 'c' is the spike's top
let c = (middle, amplitude)
// 'de' is the left line, 'fg' is the right line
let d = ( lo, horizon)
let e = (middle - li, horizon)
let f = (middle + ri, horizon)
let g = (length - ro, horizon)
// 'h' is where to place content, above the spike
let h = (middle, amplitude + content-offset)
// list of all named points to show in debug mode
let points = (a: a, b: b, c: c, d: d, e: e, f: f, g: g, h: h)
// bezier control points: in 'dlc' 'd' stands for the point 'd' where the control point is used,
// 'l' stands for left of spike, 'c' stands for control point
let dlc = ( (1 - outer-curves.at(1)) * lo, horizon)
let elc = (middle - (1 - inner-curves.at(1)) * li, horizon)
let frc = (middle + (1 - inner-curves.at(1)) * ri, horizon)
let grc = (length - (1 - outer-curves.at(1)) * ro, horizon)
let alc = ( outer-curves.at(3) * lo, outer-curves.at(2) / 2 * amplitude)
let clc = (middle - inner-curves.at(3) * li, (1 - inner-curves.at(2) / 2) * amplitude)
let crc = (middle + inner-curves.at(3) * ri, (1 - inner-curves.at(2) / 2) * amplitude)
let brc = (length - outer-curves.at(3) * ro, outer-curves.at(2) / 2 * amplitude)
merge-path({
bezier(a, d, alc, dlc)
bezier(e, c, elc, clc)
bezier(c, f, crc, frc)
bezier(g, b, grc, brc)
})
// define some named anchors
anchor("spike", c)
anchor("content", h)
anchor("start", a)
anchor("end", b)
anchor("center", (d, 50%, g))
// define anchors for all points
for (name, point) in points {
anchor(name, point)
}
if debug {
// show bezier control points using colored lines
line(stroke: purple, a, alc)
line(stroke: blue, d, dlc)
line(stroke: olive, e, elc)
line(stroke: red, c, clc)
line(stroke: red, c, crc)
line(stroke: olive, f, frc)
line(stroke: blue, g, grc)
line(stroke: purple, b, brc)
// show all named points
for (name, point) in points {
content(point, box(fill: luma(240), inset: .5pt, text(style.debug-text-size, raw(name))))
}
}
})
// move to end point so the current position after this is the end position
move-to(end)
}
|
https://github.com/rabotaem-incorporated/algebra-conspect-1course | https://raw.githubusercontent.com/rabotaem-incorporated/algebra-conspect-1course/master/sections/03-polynomials/03-div-with-remainder.typ | typst | Other | #import "../../utils/core.typ": *
== Деление с остатком
#th(name: [о делении с остатком для многочленов])[
$R$ --- область целостности.
Пусть $f, g in R[x], space g eq.not 0$ и старший коэффициент $g$ обратим.
Тогда $exists! space q, r in R[x]$:
+ $f = g q + r$
+ $deg r < deg g$
]
#proof[
Пусть $deg g = d, space g = b_d X^d + ...$
+ "Существование" #[
Индукция по $deg f: space deg f < d ==>$ подходит $q = 0, r = f$
Пусть $deg f = n >= d$
$f_1 = f - g dot a_n dot b_d^(-1) dot X^(n - d)$, где $b_d$ --- старший коэффициент $g$ (на первый взгляд здесь написано что-то неочевидное, но на деле это простое деление многочленов столбиком, то есть мы просто делаем так, чтобы старший коэффициент $f$ исчез)
$g dot a_n dot b_d^(-1) dot X^(n-d) = (b_d X^d + ...) dot a_n dot b_d^(-1) dot X^(n-d) = a_n X^n + ... ==> deg f_1 < n$
По индукционному предположению $exists q_1, r_1 in R[x]$ такие, что:
+ $f_1 = g q_1 + r_1$
+ $deg r_1 < d$
$f = g dot a_n dot b_d^(-1) dot X^(n - d) + f_1 = g underbrace((a_n dot b_d^(-1) dot X^(n - d) + q_1), q) + underbrace(r_1, r)$
]
+ "Единственность" #[
Предположим $f = g dot q_1 + r_1 = g dot q_2 + r_2, space deg r_1 < d, space deg r_2 < d$
$g(q_1 - q_2) = r_2 - r_1$
Предположим $q_1 eq.not q_2 ==> deg g dot (q_1 - q_2) limits(=)^(#[$R$ --- ОЦ]) underbrace(deg g, d) + underbrace(deg q_1 - q_2, >= 0) >= d ==> deg(r_2 - r_1) >= d$, но $deg(r_2 - r_1) < d$, противоречие.
]
]
#notice[
Условие $R$ --- область целостности не существенно.
(я без понятия что написано дальше, но пускай будет)
$g = b_d X^d + ..., space b_d in R^*$
$b_d dot a = 0 ==> b_d^(-1)(b_d a) = 0 ==> a = 0$ (что это значит?)
]
|
https://github.com/kdog3682/2024-typst | https://raw.githubusercontent.com/kdog3682/2024-typst/main/src/util.typ | typst | #import "styles.typ"
#import "regexes.typ"
#let style-text(x, key) = {
let style = styles.at(key)
return text(..style, resolve-content(x))
}
#let sum(..args) = {
let c = 1
for n in args.pos() {
c += n
}
return c
}
#let multiply(..args) = {
let c = 1
for n in args.pos() {
c *= n
}
return c
}
#let is-str-number(x) = {
return test(x, "^\d+$")
}
#let test(s, r) = {
return exists(s.match(regex(r)))
}
#let exists(x) = {
return x != none
}
#let replace(s, r, rep) = {
return s.replace(regex(r), rep)
}
#let templater(s, ref) = {
let callback(x) = {
let key = x.captures.first()
let k = if is-array(ref) { int(key) } else { key }
return str(ref.at(k))
}
return replace(s, "\$(\w+)", callback)
}
#let split(s, r) = {
return s.split(regex(r)).map(trim).filter(exists)
}
#let dash-split(s) = {
return split(s, regexes.dashed-line)
}
#let content-templater(s, ref) = {
let items = split(s, "\$(\w+)")
let store = ()
let get(item, ref) = {
return ref.at(item)
}
for (i, item) in items.enumerate() {
if is-even(i) {
if exists(item) {
store.push(i)
}
} else {
store.push(get(item, ref))
}
}
return store
}
#let cr-flex-row(..args) = {
let items = args.pos()
let opts = args.named()
let style = merge(styles.flex-row-layout, opts)
table(..style, columns: items.len(), ..items)
}
#let cr-dialogue-item(speaker, content) = {
let a = bold(speaker)
let b = box(styles.dialogue-right, align(left, content))
cr-flex-row(a, b)
}
#let cr-hash-tags(tags) = {
let tag(key) = {
let content = align(text(..styles.hash-tag-text, key))
rect(..styles.hash-tag-rect, content)
}
let content = tags.map(tag)
stack(dir: ltr, spacing: styles.hash-tag-spacing, ..content)
}
#let nth(s, sup: bool) = {
let ordinal-str = resolve-str(s)
let ordinal-suffix = if ordinal-str.ends-with(regex("1[0-9]")) {
"th"
} else if ordinal-str.last() == "1" {
"st"
} else if ordinal-str.last() == "2" {
"nd"
} else if ordinal-str.last() == "3" {
"rd"
} else {
"th"
}
if sup == true {
return ordinal-str + super(ordinal-suffix)
} else {
return ordinal-str + ordinal-suffix
}
}
#set page(..styles.auto-page)
#let do-abc(title, data) = {
// important to not place the item yet
// because we may want to wrap it later
// everything in the ref should not immediately place
let t = [*#title*]
let items = data.map(contentify)
// doing this will place the items ... and i am not sure it is a good idea
t
items
// this will place it
}
#let recursive-renderer(state) = {
let functions = (
abc: do-abc
)
let main(state) = {
// this is a piece of content
// everything that main returns should be content
if state.mode == "eval" {
// state.value should always be a string
return eval(state.value, mode: "markup")
}
if state.mode == "function" {
// state.value can be nearly anything
return functions.at(state.fn-key, state.value)
}
}
let runner(state) = {
if has(state, 'children') {
let children = state.children.map(runner)
if has(state, 'style') {
return state.wrap(..children)
}
if has(state, 'wrap') {
return state.wrap(..children)
}
} else {
let child = main(state)
return child
}
return main-item
}
return runner(state)
}
#let render-dialogue(dialogue) = {
for item in dialogue {
}
}
#let render-frontmatter(conf) = {
display-title(conf)
}
#let display-title(s) = {
text(
size: 16pt,
weight: "bold",
s)
line(length: 100%, do)
}
#{
#let numbered-wrapper(content, itemnumber, style: 'default') = {
itemnumber
content
}
#let render-dialogue-question(lines) = {
let text-style = (:)
let visual-key = lines.first().at('visual')
if visual-key {
return stack(
dir: ltr,
spacing: 2pt
)
}
// so this line has a comment
// so the next line automatically gets highlighting on enter
//
visual = global-visuals.at(visual-key)
par(leading: 0.75)
for line in lines {
text(..text-style, line.text)
linebreak()
}
}
#let spacer(..args) = {
let x = args.pos().first()
return v(eval(str(x) + "pt"))
}
// rendering via ... need to get the styles
//
#let render-choices-deprecated(choices) = {
let store = ()
let runner(index, choice) = {
let s = resolve-text(choice)
let a = text(weight: "bold", index)
let b = text(s)
store.push(a)
store.push(b)
}
choices.enumerate().map(runner)
let attrs = (columns: 2, column-gutter: 5pt, stroke: none)
return table(..attrs ..store)
}
let enum-mcq-choices = (
number-align: left,
numbering: "A)",
tight: false,
)
#let render-choices(choices) = {
return enum(styles.enum-mcq-choices, ..choices)
}
#let render-mcq(o) = {
let question = render-dialogue-question(o.question)
let enum-choice = render-choices(o.choices)
return block(
question,
choice-block
)
}
#let eval-as-markup(s, scope: (:)) = {
return eval(s, mode: "markup", scope)
}
#let square(size, fill) = {
size = resolve-pt(size)
rect(width: size, height: size, fill: resolve-color(fill))
}
|
|
https://github.com/LeoColomb/dotdocs | https://raw.githubusercontent.com/LeoColomb/dotdocs/main/packages/leocolomb/lettre-fr/1.0.0/src/lib.typ | typst | MIT License | // This function gets your whole document as its `body`
// and formats it as a simple letter.
#let template(
// The letter's sender, which is display at the top of the page.
sender: none,
sender_address: none,
// The letter's recipient, which is displayed close to the top.
recipient: none,
recipient_address: none,
// The location, displayed to the right.
location: none,
// The date, displayed to the right.
date: datetime.today(),
// The subject line.
subject: none,
// The reference line.
reference: none,
opening: none,
closing: none,
// The letter's content.
body
) = {
// Configure page and text properties.
set page(
paper: "a4",
margin: (x: 2cm, y: 3.81cm),
)
set text(
font: "PT Sans",
lang: "fr",
)
columns(2, gutter: 1cm)[
// Display sender.
#strong(sender)\
#sender_address
#colbreak()
// Display recipient.
#v(2cm)
#strong(recipient)\
#recipient_address
]
v(2em)
// Display date. If there's no date add some hidden
// text to keep the same spacing.
if date != none {
pad(
left: 9cm,
emph()[
#location, #date.display("[weekday] [day padding:none] [month repr:long] [year]")
],
)
}
v(2em)
// Add the reference/subject line, if any.
if reference != none {
pad(right: 10%, strong(reference))
}
if subject != none {
pad(right: 10%, strong(subject))
}
v(3em)
h(1cm)
opening
v(1em)
// Add body and name.
par()[#body]
v(1em)
closing
v(2em)
pad(left: 9cm, sender)
}
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/calc-31.typ | typst | Other | // Test the `gcd` function.
#test(calc.gcd(112, 77), 7)
#test(calc.gcd(12, 96), 12)
#test(calc.gcd(13, 9), 1)
#test(calc.gcd(13, -9), 1)
#test(calc.gcd(272557, 272557), 272557)
#test(calc.gcd(0, 0), 0)
#test(calc.gcd(7, 0), 7)
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/linebreak_06.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Test forcing an empty trailing line.
Trailing break \ \
|
https://github.com/kdog3682/typkit | https://raw.githubusercontent.com/kdog3682/typkit/main/0.1.0/src/lines.typ | typst | #import "strokes.typ"
#let soft = line(length: 100%, stroke: strokes.soft)
#let solid = line(length: 100%, stroke: strokes.solid)
#let thin = line(length: 100%, stroke: strokes.solid)
|
|
https://github.com/Lucas-Wye/tech-note | https://raw.githubusercontent.com/Lucas-Wye/tech-note/main/src/ic.typ | typst | = IC
== 体系结构
- 数据冒险:当指令在流水线中重叠执行时,后面的指令需要用到前面的指令的执行结果,而前面的指令尚未写回导致的冲突,称为数据冒险(也称为数据相关性)。
- 结构冒险:当一条指令需要的硬件部件还在为之前的指令工作,而无法为这条指令提供服务,那就导致了结构冒险。(这里结构是指硬件当中的某个部件、也称为资源冲突)。
- 控制冒险:如果现在想要执行哪条指令,是由之前指令的运行结果决定,而现在那条之前指令的结果还没产生,就导致了控制冒险(实际上就是riscv 的跳转指令引起的,跳转指令要经过2个周期后才会出现跳转结果)。
== 电容,电感和电阻
- 电容通高频阻低频、电感通低频阻高频
== 布尔代数
=== 二进制转换
- 除k取余法(第一个余数为低位)
- 乘k取整法(第一个整数为高位)
=== 原码,反码,补码
- 正数的原码,反码和补码都一样
- 负数的反码除符号位都取反,补码为反码+1
=== 十进制编码
- 8421码:正常二进制数值
- 余3码:从3开始计数
- 余3循环码:从3开始计数,每次改变一位
#table(
columns: 5,
[], [00], [01], [11], [10],
[00], [0000], [0001], [0011], [*0010*],
[01], [*0100*], [*0101*], [*0111*], [*0110*],
[11], [*1100*], [*1101*], [*1111*], [*1110*],
[10], [1000], [1001], [1011], [*1010*],
)
- 格雷码:从0开始计数,每次改变一位
=== 逻辑运算
- Y = (AB)' = A' + B'
- Y = A xor B = AB' + A'B
- A + BC = (A+B)(A+C)
- 最小项:m1 = 001 = A'B'C, m3 = ABC'
- 卡诺图化简:画圈; 若包含无关项,可当作1处理
== 基本电路
=== 单bit加法器
- 半加器:S = A xor B, CO = AB
- 全加器:S = A xor B xor CI, CO = (A xor B)CI + AB
=== 竞争冒险
- 竞争:在组合逻辑电路中,当某一个变量经过两条以上路径到达输出端时,由于每条路径上的延迟时间的不同,到达终点的时间有先后,这一现象称为竞争。(输入级)
- 冒险:由于竞争使电路的输出端出现了稳态下没有的干扰脉冲(毛刺)的现象称为冒险。(输出级)
- 可通过判断输出端表达式会不会出现一个变量的原状态和非状态来判断。
- 消除竞争冒险:
-- 接入滤波电容
-- 引入选通脉冲
-- 修改逻辑设计,增加冗余项
=== 锁存器与触发器
==== SR锁存器
- 由两个或非门或者与非门反馈连接的电路。 Q=R'Q, Q'=S'Q'
- 输入S和R,输出Q和Q‘
- 也可由两个与非门组成。
- 其输出不仅与输入有关,也与Q’有关,需要根据当前状态来判断
=== D锁存器
- SR锁存器的R改成D‘,S改成D
=== 触发器
==== SR触发器
- $Q^(n+1)$ = $S$ + $R' Q^n$ (约束条件:SR=0)
==== JK触发器
- $Q^(n+1)$ = $J Q^n '$ + $K' Q^n$
- 保持,复位,置位,切换四种状态
==== D触发器
- 将两个D锁存器级联,两个锁存器使能信号相反
==== T触发器
- $Q^(n+1)$ = $T Q^n '$ + $T' Q^n$
=== 建立时间和保持时间
- 建立时间:数据需要在时钟到达前保持稳定的最短时间
- 保持时间:数据在时钟到达后需要保持稳定的最短时间
- 建立时间+ 保持时间=时钟周期
== IC协议
=== AXI总线
- 5个传输通道:读地址、读数据、写地址、写数据、写响应
- 最多256个数据传输的突发事务,AXI4-Lite只允许每个事务并行一个数据传输
- full, lite, stream三种传输方式
- lite不支持突发传输
- stream是非存储映射,数据传输时不需要地址;定义传输流数据的单一通道,可以无限制长度突发传输
==== 突发传输
===== 类型
FIXED: 地址固定(FIFO)
INCR: 地址递增(Memory)
WRAP:地址递增,回环(Cache line)
===== 突发读传输
信号
- 读地址相关信号:ARVALID, ARADDR, ARLEN(突发传输次数), ...
- 读数据相关信号:RDATA, RREADY, RVALID, ...
传输过程
- 当ARVILID和ARREADY都为高,地址被传递给从接口。
- 当RVALID和RREADY都为高,数据被传递给从接口。
- RLAST为高,表示最后一个数据。
- 当从接口接收了第一个地址后,master接口可以发送另一个突发地址。使得当第一个突发读结束后,紧跟着第二个突发读。
===== 突发写传输
- 写地址相关信号:AWADDR, AWVALID, AWREADY, ...
- 写数据相关信号:WDATA, WLAST, WVALID, WREADY, ...
- 写响应相关信号:BRESP, BVALID, BREADY, ...
当从机接受了所有的数据后,它会向主机发送一个写响应以表明事务已经完成。
事务顺序:
无序,每个事务用ID标记,相同ID的交易按顺序,不同的无序。
通道握手机制:
只有VALID和READY同时有效时,才会发生传输
==== outstanding传输
- 不需要等待前一笔传输完成就可以发送下一笔的操作。即,有缓存存在。
- burst传输可以提高单笔传输的效率,而outstanding传输可以提高多笔传输的效率。
===== outstanding相关计算
- master最大缓存能力 = outstanding \* (burst length + 1) \* 带宽
- 访问延时 = master最大缓存能力 / 有效带宽(最大传输带宽)
==== 乱序传输
不同ID之间的数据不必按顺序传输。
==== 交织传输
在乱序的基础上支持不同ID间数据的乱序。
可以是一次传输中先后出现不同ID的数据。
==== 非对齐传输
一个笔数据非对齐,后面的仍然保持对齐。
=== APB总线
- 最大支持32bit的数据位宽
- 有两个独立的数据通道:读通道和写通道,但不会被同时使用
- 相关信号:PCLK, PRESETn, PADDR, PSELx, PWDATA, PRDATA, PREADY, PSTRB, PENABLE, PSLVERR, ...
- 状态:IDLE, SETUP, ENABLE, DATA VALID, FINISH
- 读:PSEL, PENABLE, PREADY
- 写:PWRITE, PSEL, PENABLE, PREADY
- APB的地址和读写控制信号在下一次数据传输前,不会发生改变
=== I2C总线
- 串行、半双工、多主机总线
- 近距离、低速
- 两根双向信号线:数据线SDA和时钟线SCL(用于通信双方时钟的同步)
- 每个连接到I2C总线上的期间都有一个唯一的7bit地址
- I2C总线上可挂接的设备数量受总线的最大电容400pF限制
- 串行的8bit双向数据传输速率:标准模式 100 Kbit/s, 快速模式 400 Kbit/s,高速模式3.4 Mbit/s
==== 通信过程
1. 主机发送起始信号启用总线
2. 主机发送一个字节数据指明从机地址和后续字节的传送方向
3. 被寻址的从机发送应答信号回应主机
4. 发送器发送一个字节数据
5. 接收器发送应答信号回应发送器
6. 循环步骤4、5
7. 通信完成后主机发送停止信号释放总线
- 第4步和第5步用的是发送器和接收器,不是主机和从机,这是由第一个字节的最后一位决定主给从发,还是从给主发。
- 数据发送过程中不允许改变发送方向
- 第一个字节的前7位是从机地址
- 起始信号:SCL为高电平时,SDA由高变低
- 停止信号:SCL为高电平时,SDA由低变高
- I2C总线每次传送一个字节时,先传送最高位,再传送低位,发送器发送完一个字节数据后接收器必须发送1 bit的应答位回应发送器。
- SCL为低电平期间发送器向数据线上发送一位数据,此时数据线上的信号可变化;SCL为高电平期间接收器从数据线上读取一位数据,此时数据线上的信号需要保持稳定。
==== 时钟同步
I2C总线上SCL之间存在线与,只有多个主机同时发送高电平时,SCL才是高电平,否则为低电平。
==== 仲裁
- 只发生在SCL为高电平时
总线仲裁:只有当所有主机在SDA上都写高电平时,SDA的数据才是1,否则为0
- 一个主机每发送一位数据,在SCL为高电平时,就检查SDA的电平是否和发送的数据一致,如果不一致,这个主机就输掉了仲裁。输了的主机在检测到自己输了之后就不再产生时钟脉冲信号,并且要在总线空闲时才能重新传输。
=== SPI协议
- 一个主机,多个从机,全双工(具有单独的发送和接收线路)
- SCLK, MOSI, MOSO, NSS(片选信号)
- 优点:高速传输速率,简单的软件配置,灵活的数据传输
- 缺点:没有从机应答信号,需要更多的引脚
- 多个从机时,可以给主机配置多个NSS信号
==== 传输过程
- 主机将NSS拉低,开始接收数据
- 接受端检测到时钟边沿信号后,立即读取数据线上的信号
- 主机发送到从机时:主机产生相应的时钟信号,然后将数据逐位从MOSI信号线上发送到从机
- 主机接收从机数据;从机从MISO信号发送数据给主机
==== 时钟极性和相位
- 时钟极性CKP:CKP=0,时钟IDLE为低电平;CKP=1,时钟IDLE为高电平
- 时钟相位CKE:CKE=0,时钟SCK的第一个跳变沿采样;CKE=1,时钟SCK的第二个跳变沿采样
=== UART协议
- 异步、串行、全双工
- RX, TX
==== 传输过程
- 总线空闲时为高电平
- 起始位:发送方发送一个低电平信号VOL
- 数据位:可以是5到9位等组成一个字符,通常是8位。先发送最低位,再发送高位。
- 奇偶校验位:1的个数和0的个数,有不同校验方式
- 停止位:1或2位的VOH,表示传输的结束,并且可以提供纠正时钟的机会,停止位越多,数据传输越稳定、越慢
== UART, I2C, SPI对比
#table(
align: center,
columns: (auto, auto, auto, auto, auto, auto),
[协议], [复杂度], [传输速度], [设备数量], [复式], [主从数量],
[UART], [简单的], [最慢], [最多 2 台设备], [全双工], [单对单],
[I2C], [轻松链接多个设备], [比 UART 更快], [最多 127 个, 但变得复杂], [半双工], [多个从机和主机],
[SPI], [随着设备的增加而复杂], [最快的], [很多,但变得复杂], [全双工], [1个主机,多个从机],
)
|
|
https://github.com/DanielOaks/tme | https://raw.githubusercontent.com/DanielOaks/tme/main/solo-character-sheet.typ | typst | #import "elements.typ": sheet, characterSheetTop, extraCharacterBox,
#let title = "Talking Magic Equines 1e Solo Character Sheet"
#sheet(
title: title,
paper: "a4",
[
#characterSheetTop()
// separator
#v(11pt)
#align(
center,
line(
length: 6cm,
stroke: (
thickness: 7pt,
paint: luma(87%),
cap: "round",
),
)
)
#v(7pt)
// extra character snippets
#grid(
columns: 3,
gutter: .65cm,
column-gutter: .65cm,
extraCharacterBox(),
extraCharacterBox(),
extraCharacterBox(),
extraCharacterBox(),
extraCharacterBox(),
extraCharacterBox(),
)
]
)
|
|
https://github.com/v411e/optimal-ovgu-thesis | https://raw.githubusercontent.com/v411e/optimal-ovgu-thesis/main/README.md | markdown | MIT License | This template was created for a master thesis at the faculty of computer science (FIN), but should work as well for other faculties.
## File structure
```
.
├── assets // Images, CSV-Files, etc.
│ └── figure // Image files
│ └── optimal-ovgu-thesis
├── chapter // Content
│ ├── 01-Einleitung.typ
│ ├── ...
│ └── 99-Appendix.typ
├── expose.typ // Exposé template
├── metadata.typ // Metadata and template config
├── thesis.bib // Bibliography (e.g. generated by Zotero + Better BibTex)
└── thesis.typ // Thesis template
```
## Logos on the title page
Faculty header logos are available as svg in `assets/figure/optimal-ovgu-thesis`. See [cd.ovgu.de](https://www.cd.ovgu.de/Fakult%C3%A4ten.html) for more information regarding the OvGU corporate design.
Header logos are set in `metadata.typ`:
```typ
// Example 1: Use UCC logo as organisation-logo and the FIN faculty header as header-logo
#let organisation-logo = image("assets/figure/optimal-ovgu-thesis/ucc.svg", width: 2cm)
#let header-logo = image("assets/figure/optimal-ovgu-thesis/fin-de.svg", width: 100%)
// Example 2: Do not use logos at all
#let organisation-logo = none
#let header-logo = none
```
## Fonts
This template requires these two fonts to be installed on your system:
- New Computer Modern
- New Computer Modern Sans
### NixOS
In your `configuration.nix`:
```nix
fonts.packages = with pkgs; [
liberation_ttf # here are your other fonts (liberation is just an example)
] ++ texlive.newcomputermodern.pkgs; # ← New Computer Modern font
```
## Development
In case you want to contribute, check out the repo into a [typst package directory](https://github.com/typst/packages?tab=readme-ov-file#local-packages)
### Example for Linux:
Local package path: `~/.local/share/typst/packages/local/optimal-ovgu-thesis/0.1.0`
```sh
mkdir -p ~/.local/share/typst/packages/local/optimal-ovgu-thesis
cd ~/.local/share/typst/packages/local/optimal-ovgu-thesis
git clone <EMAIL>:v411e/optimal-ovgu-thesis.git
mv optimal-ovgu-thesis 0.1.0
```
This will make the package available locally, so you can use `typst init "@local/optimal-ovgu-thesis:0.1.0"` to create a test-project from the template.
|
https://github.com/rabotaem-incorporated/probability-theory-notes | https://raw.githubusercontent.com/rabotaem-incorporated/probability-theory-notes/master/sections/03-characteristic-functions/01-characteristic-functions.typ | typst | #import "../../utils/core.typ": *
== Характеристические функции
#def[
_Комплекснозначная случайная величина_ --- это функция $xi: Omega --> CC$, где $Re xi$, $Im xi$ --- измеримые функции.
]
#def[
$E xi := E (Re xi) + i E (Im xi)$.
]
#props[
+ Математическое ожидание комплексно-линейно.
+ $abs(E xi) <= E abs(xi)$.
]
#proof[
Знаем из матана.
]
#def[
Если $xi$ --- вещественнозначная случайная величина, то $phi_xi (t) := E e^(i t xi)$ называется _характеристической функцией_ $xi$.
]
#props[
1. $phi_xi (0) = 1$ и $abs(phi_xi (t)) <= 1$ для всех $t in RR$.
2. $phi_(a xi + b) (t) = e^(i b t) phi_xi (a t)$.
3. $phi_xi (-t) = overline(phi_xi (t))$.
4. Если $xi, eta$ независимы, то $phi_(xi + eta) (t) = phi_(xi) (t) phi_(eta) (t)$.
5. Если $xi_1$, $xi_2$, ..., $xi_n$ независимы, то $phi_(xi_1 + xi_2 + ... + xi_n) (t) = phi_(xi_1) (t) phi_(xi_2) (t) ... phi_(xi_n) (t)$.
6. $phi_xi$ --- равномерно непрерывна.
]
#proof[
1. $abs(phi_xi (t)) = abs(E e^(i t xi)) <= E abs(e^(i t xi)) = E 1 = 1$.
2. $phi_(a xi + b) (t) = E e^(i t (a xi + b)) = e^(i t b) E e^(i t a xi) = e^(i t b) phi_xi (a t)$.
4. $phi_(xi + eta) (t) = E e^(i t (xi + eta)) = E e^(i t xi) e^(i t eta) = phi_xi (t) phi_eta (t)$.
6. $phi_xi (t + h) - phi_xi (t) = E e^(i (t + h) xi) - E e^(i t xi) = E (e^(i t xi) (e^(i h xi) - 1))$. Значит
$
abs(phi_xi (t + h) - phi_xi (t)) <= E abs(e^(i t xi) (e^(i h xi) - 1)) <= E abs(e^(i h xi) - 1) -->^?_(h -> 0) 0.
$
Чтобы доказать $?$, надо объяснить, почему мы можем переставлять интеграл (матожидание) с пределом (по $h$).
$
E abs(e^(i h xi) - 1) = integral_RR abs(e^(i h x) - 1) dif P_xi (x),
$
а у этой функции есть суммируемая мажоранта $2$. Значит
$
E abs(e^(i h xi) - 1) --> integral_RR underbrace(lim_(h -> 0) abs(e^(i h x) - 1), 0) dif P_xi (x) = 0.
$
]
#example[
Рассмотрим $xi sim Nn(a, sigma^2)$. Пусть $eta sim Nn(0, 1)$, тогда $xi sim sigma eta + a$. Считаем
$
phi_eta (t) =
E e^(i t eta) =
integral_RR e^(i t x) dif P_eta (x) =
1/sqrt(2 pi) integral_RR e^(i t x) e^(-x^2/2) dif x =
e^(-t^2/2)/sqrt(2pi) underbrace(integral_RR e^(-(x - i t)^2/2) dif x, =: I).
$
Надо проинтегрировать $integral_Gamma_R e^(-z^2/2) dif z = 0$, где $Gamma_R$ --- граница прямоугольника $[-R; R] times [0, -i t]$.
#TODO[картинка]
Тогда
$
0 = integral_Gamma_R e^(-z^2/2) dif z =
integral_(-R - i t)^(R - i t) e^(-z^2/2) dif z +
integral_(R - i t)^(R) e^(-z^2/2) dif z +
integral_(R)^(-R) e^(-z^2/2) dif z +
integral_(-R)^(-R - i t) e^(-z^2/2) dif z.
$
Первый интеграл стремится к $I$. Второй к $0$, так как
$
abs(integral_(R - i t)^R e^(-z^2/2) dif z) =
abs(i integral_(-t)^0 e^(-(R + i x)^2/2) dif x) <=
integral_(-t)^0 abs( e^(-(R + i x)^2/2) ) dif x =
integral_(-t)^0 e^(-R^2/2) e^(x^2/2) dif x <=
t e^(t^2/2) e^(-R^2/2) --> 0.
$
Третий --- это $-sqrt(2pi)$. Четвертый аналогично второму стремится к $0$. Значит $I = sqrt(2pi)$.
Значит $phi_eta (t) = e^(-t^2/2)$, и $phi_(sigma eta + a) (t) = e^(i a t) e^(-sigma^2 t^2 / 2)$.
]
#th[
Если $E abs(xi)^n < +oo$, то при $k = 1, 2, ..., n$,
$
phi^((k))_xi (t) = E((i xi)^k e^(i t xi)).
$
В частности, $phi_xi^((k)) (0) = i^k E xi^k$.
]
#proof[
Индукция по $k$. База очевидна. Переход $k ~~> k + 1$:
$
phi_xi^((k + 1)) (t) =
lim_(h -> 0) (phi_xi^((k)) (t + h) - phi_xi^((k)) (t)) / h =
lim_(h -> 0) (E (i xi)^k e^(i (t + h) xi) - E (i xi)^k e^(i t xi)) / h newline(=)
lim_(h -> 0) E((i xi)^k dot e^(i t xi) dot (e^(i h xi) - 1)/h) =
lim_(h -> 0) integral_Omega (i xi)^k dot e^(i t xi) dot (e^(i h xi) - 1)/h dif P newline(=^?)
integral_Omega (i xi)^k dot e^(i t xi) dot underbrace(lim_(h -> 0) (e^(i h xi) - 1)/h, i xi) dif P =
E ((i xi)^(k + 1) e^(i t xi)).
$
Почему можно менять местами интеграл с переделом в $?$. Потому что есть суммируемая мажоранта:
$
abs((i xi)^k e^(i t xi) (e^(i h xi) - 1)/h) =
abs(xi)^k abs((e^(i h xi) - 1)/h).
$
Если $abs(xi(omega) h) >= 1$, то $1/abs(h) <= abs(xi)$, и все произведение не больше $2 abs(xi)^(k + 1)$. Если $abs(xi(omega) h) < 1$, то
$
abs(xi)^k dot abs((e^(i h xi) - 1) / h) = abs(xi)^(k + 1) dot abs((e^(i h xi) - 1)/(xi h)) = abs(xi)^(k + 1) dot abs((1 + O(xi h) - 1)/(xi h)) <= C abs(xi)^(k + 1).
$
]
#follow[
$D xi = -phi''_xi (0) + (phi'_xi (0))^2$.
]
#proof[
$
cases(
E xi^2 = -phi''_xi (0),
E xi = i phi'_xi (0),
) ==> D xi = E xi^2 - (E xi)^2 = -phi''_xi (0) + (phi'_xi (0))^2.
$
]
#th[
Если существует конечная $phi_xi^((2n)) (0)$, то $E xi^(2n) < +oo$.
]
#proof[
В общем случае доказательства не будет, мы докажем для второй производной. Общее доказательство будет аналогичным, но формулы будут громоздкими.
$
E xi^2 = integral_RR x^2 dif P_xi (x).
$
Интеграл всегда существует, нам надо понять, что он конечен.
$
E xi^2 =
integral_RR x^2 dif P_xi (x) =
integral_RR lim_(h -> 0) (sin(x h)/h)^2 dif P_xi (x) <=^"Фату"
liminf_(h -> 0) integral_RR (sin(x h)/h)^2 dif P_xi (x) newline(=)
liminf_(h -> 0) -integral_RR (e^(2 i h x) + e^(-2i h x) - 2)/(4h^2) dif P_xi (x) =
liminf_(h -> 0) -1/(4h^2) integral_RR (e^(2 i h x) + e^(-2i h x) - 2) dif P_xi (x) newline(=)
liminf_(h -> 0) -1/(4h^2) (phi_xi (2h) + phi_xi (-2h) - 2).
$
Разложим $phi_xi (t)$ в ряд Тейлора:
$
phi_xi (t) = 1 + phi'_xi (0) t + phi''_xi (0) t^2/2 + o(t^2).
$
Значит
$
phi_xi (2h) + phi_xi (-2h) - 2 = phi''_xi (0) (2h)^2 + o(h^2).
$
Подставляем это в выкладки выше:
$
E xi^2 =
liminf_(h -> 0) -1/(4h^2) (phi_xi (2h) + phi_xi (-2h) - 2) =
liminf_(h -> 0) -1/(4h^2) (phi''_xi (0) (2h)^2 + o(h^2)) =
-phi''_xi (0).
$
]
#th(name: "<NAME>")[
Пусть $a < b$, $P(xi = a) = P(xi = b) = 0$. Тогда
$
P(a <= xi <= b) = lim_(T -> +oo) 1/(2pi) integral_(-T)^T (e^(-i a t) - e^(-i b t))/(i t) phi_xi (t) dif t.
$
]
#notice[
Интеграл $integral_(-oo)^(+oo)$ может быть расходящимся, зато $"v.p." integral_(-oo)^(+oo)$ должен сходиться. Поэтому мы пишем $lim_(T -> +oo)$.
]
#proof[
*Шаг 1: $a = -1$, $b = 1$*. Надо доказать
$
P(-1 <= xi <= 1) =^? lim_(T -> +oo) 1/(2pi) integral_(-T)^T (e^(i t) - e^(-i t))/(i t) phi_xi (t) dif t.
$
Преобразуем внутренний интеграл:
$
integral_(-T)^T (e^(i t) - e^(-i t))/(i t) phi_xi (t) dif t =
integral_(-T)^T (e^(i t) - e^(-i t))/(i t) integral_RR e^(i t x) dif P_xi (x) dif t =^"Фубини"
integral_RR underbrace(integral_(-T)^T (e^(i t) - e^(-i t))/(i t) e^(i t x) dif t, =: Phi_T (x)) dif P_xi (x).
$
Теорему Фубини можно применить, так как
$
abs((e^(i t) - e^(-i t))/(i t) e^(i t x)) = abs((e^(i t) - e^(-i t))/t) <= 2.
$
при $abs(t) >= 1$. При $abs(t) <= 1$ это непрерывная функция ограниченная на компакте $[-1, 1]$.
$
Phi_T (x) =
integral_(-T)^T (e^(i t) - e^(-i t))/(i t) e^(i t x) dif t =
integral_(-T)^T integral_(-1)^1 e^(i u t) dif u space e^(i t x) dif t =^"Фубини"_"+очев."
integral_(-1)^1 integral_(-T)^T e^(i u t) e^(i t x) dif t dif u newline(=)
integral_(-1)^1 lr(e^(i t (u + x))/(i (u + x)) |)_(t = -T)^(t = +T) dif u =
integral_(-1)^1 (2 sin (T (u + x)))/(u + x) dif u =^(y = T (u + x))
integral_(T (x - 1))^(T (x + 1)) (2 sin y)/y dif y.
$
При $x > 1$, $T(1 + x)$ и $T(x - 1) --> +oo$, а если $x < -1$, то $T(1 + x)$ и $T(x - 1) --> -oo$, значит $Phi_T (x) -->_(T-->+oo) 0$. При $-1 < x < 1$:
$
cases(
T(1 + x) --> +oo,
T(x - 1) --> -oo,
) ==> Phi_T (x) -->_(T -> +oo) integral_RR (2 sin y)/y dif y = 2 pi.
$
Значит $Phi_T (x) --> 2pi dot bb(1)_((-1, 1)) (x)$ при $x != plus.minus 1$. Тогда
$
lim_(T --> +oo) 1/(2pi) integral_(-T)^T (e^(i t) - e^(-i t))/(i t) phi_xi (t) dif t =
lim_(T -> +oo) 1/(2pi) integral_RR Phi_T (x) dif P_xi (x) newline(=^?)
1/(2pi) integral_RR lim_(T -> +oo) Phi_T (x) dif P_xi (x) =
1/cancel(2pi) integral_RR cancel(2 pi) bb(1)_[-1, 1] dif P_xi (x) =
P_xi ([-1, 1]) = P(-1 <= xi <= 1).
$
Нужна мажоранта, чтобы переставлять интеграл с пределом:
$
abs(Phi_T (x)) =
abs(integral_(T (x - 1))^(T (x + 1)) (2 sin y)/y dif y) <=
sup_(v < w) abs(integral_v^w (2 sin y)/y dif y) <=
2 sup_w abs(integral_0^w (2 sin y)/y dif y) <
+oo.
$
*Шаг 2: произвольные $a, b$*. Рассмотрим $eta$ такое, что
$xi = (b - a)/2 eta + (a + b)/2$. $[a, b]$ переходит в $[-1, 1]$. Тогда
$
phi_xi (t) = phi_eta ((b - a)/2 t) e^(i (a + b)/2 t).
$
Подставляем это в доказанное:
$
P(a <= xi <= b) = P(-1 <= eta < 1) = lim_(T -> +oo) 1/(2pi) integral_(-T)^T (e^(-i t) - e^(i t))/(i t) phi_eta dif t.
$
Надо доказать, что
$
lim_(t -> +oo) 1/(2pi) integral_(-T)^T (e^(-i t) - e^(i t))/(i t) phi_eta dif t =
lim_(t -> +oo) 1/(2pi) integral_(-T)^T (e^(-i a t) - e^(-i b t))/(i t) phi_xi dif t.
$
Подставляем $phi_xi$:
$
integral_(-T)^T (e^(-i a t) - e^(-i b t))/(i t) phi_xi dif t =
integral_(-T)^T (e^(-i a t) - e^(-i b t))/(i t) phi_eta ((b - a)/2 t) e^(i (a + b)/2 t) dif t newline(=)
integral_(-T)^T (e^(i (b - a)/2 t) - e^(- i (b - a)/2 t))/(i t) phi_eta ((b - a)/2 t) dif t = integral_(-(b-a)/2 T)^((b - a)/2 T) (e^(i tau) - e^(-i tau)) / (i tau) phi_eta (tau) dif tau.
$
]
#follow[
Если $phi_xi = phi_eta$, то $P_xi = P_eta$.
]
#proof[
Пусть $A:= {x in R: P(xi = x) > 0 "или" P(eta = x) > 0}$ --- не более чем счетное множество.
Если $a, b in.not A$, то $P_xi ([a,b]) = P_eta ([a,b])$. Тогда функции распределения совпадают в точках не из $A$, так как для $a_n arrow.br -oo$, $a in.not A$: $ F_xi (b) = lim_(a_n -> -oo) P_xi ([a_n, b]) = lim_(a_n -> -oo) P_eta ([a_n, b]) = F_eta (b). $
Если $b in A$, то рассмотрим $b_n arrow.br b$, $b_n in.not A$. Там
$
F_xi (b) <-- F_xi (b_n) = F_eta (b_n) --> F_eta (b).
$
Значит $F_xi = F_eta$ везде, и $P_xi = P_eta$.
]
#follow[
Если $integral_RR |phi_xi (t)| dif t < +oo$, то $xi$ абсолютно непрерывна и
$
rho_xi (x) = 1/(2pi) integral_RR e^(-i t x) phi_xi (t) dif t.
$
Эта штука называется _преобразованием Фурье_.
]
#proof[
$
integral_(-oo)^(+oo) (e^(-i a t) - e^(-i b t))/(i t) phi_xi (t) dif t
$
абсолютно сходится, как обсуждалось выше, а так как все точки --- точки непрерывности случайной величины, можно писать интеграл из теоремы об обращении даже не в смысле главного значения. Тогда
$
P(a <= xi <= b) =
1/(2pi) integral_RR (e^(-i a t) - e^(-i b t))/(i t) phi_xi (t) dif t =
1/(2pi) integral_RR integral_a^b e^(-i t u) phi_xi (t) dif u dif t newline(=^"Фубини")
integral_a^b underbrace(1/(2pi) integral_RR e^(-i t u) phi_xi (t) dif t, := p_xi (u)) dif u =
integral_a^b p_xi (u) dif u.
$
Значит $p_xi$ --- плотность меры $P_xi$.
]
#th[
Пусть $xi_k sim Nn(a_k, sigma_k^2)$ независимые, $c_1, c_2, ..., c_n$ --- константы, и не все равны $0$. Тогда
$
xi = a_0 + sum_(k = 1)^n c_k xi_k sim Nn(a, sigma^2),
$
где $a = a_0 + sum_(k = 1)^n c_k a_k$, а $sigma^2 = sum_(k = 1)^n c_k^2 sigma_k^2$.
]
#proof[
Характеристическая функция $xi$ равна
$
phi_xi (t) = e^(i a_0 t) dot phi_xi_1 (c_1 t) dot phi_xi_2 (c_2 t) dot ... dot phi_xi_n (c_n t),
$
и подставим
$
phi_xi_k (t) = e^(-sigma_k^2 t^2/2) e^(i a_k t).
$
Получаем
$
phi_xi (t) = underbrace(e^(i a_0 t) dot e^(i a_1 c_1 t) dot e^(i a_2 c_2 t) dot ... dot e^(i a_n c_n t), e^(i a t)) dot underbrace(e^(-sigma_1^2 c_1^2 t^2/2) dot e^(-sigma_2^2 c_2^2 t^2/2) dot ... dot e^(-sigma_n^2 c_n^2 t^2/2), e^(-sigma^2 t^2 / 2)) newline(=)
e^(i a t) dot e^(-sigma^2 t^2 / 2) = phi_eta (t).
$
Значит $eta sim Nn (a, sigma^2)$.
]
|
|
https://github.com/Lypsilonx/Game-of-Intrigue | https://raw.githubusercontent.com/Lypsilonx/Game-of-Intrigue/main/render.typ | typst | #import "data.typ": *
#let get_description(type, value, illegal, color, supertitle) = {
let is_role = supertitle == "Role"
show "[X]": it => if (value == none) {"VALUE_MISSING"} else {str(value)}
show "_s": it => if (value == 1) {""} else {"s"}
show "[C]": it => if (color == none) {"COLOR_MISSING"} else {color_to_string(color)}
show regex("Social( card(s?))"): it => {
set text(weight: "extrabold")
[#icon("Social")#it]
}
show regex("Favour(s?)( card(s?))?"): it => {
set text(weight: "extrabold")
[#icon("Favour")#it]
}
show regex("Hook(s?)( card(s?))?"): it => {
set text(weight: "extrabold")
[#icon("Hook")#it]
}
show regex("Threat(s?)( card(s?))?"): it => {
set text(weight: "extrabold")
[#icon("Threat")#it]
}
show regex("Secret(s?)( card(s?))?"): it => {
set text(weight: "extrabold")
[#icon("Secret")#it]
}
show regex("Standing(s?)( card(s?)?)?"): it => {
set text(weight: "extrabold")
[#icon("Standing")#it]
}
show regex("Pact(s?)( card(s?)?)?"): it => {
set text(weight: "extrabold")
[#icon("Pact")#it]
}
show regex("Asset(s?)( card(s?)?)?"): it => {
set text(weight: "extrabold")
[#icon("Asset")#it]
}
show regex("Influence(s?)( card(s?)?)?"): it => {
set text(weight: "extrabold")
[#icon("Influence")#it]
}
show regex("Testimony(s?)( card(s?)?)?"): it => {
set text(weight: "extrabold")
[#icon("Testimony")#it]
}
show regex("Rebrand(s?)( card(s?)?)?"): it => {
set text(weight: "extrabold")
[#icon("Rebrand")#it]
}
show regex("Role(s?)( card(s?)?)?"): it => {
set text(weight: "extrabold")
[#icon("Role")#it]
}
show regex("Color( Token)?"): it => {
set text(weight: "extrabold")
[#icon("Token")#it]
}
show regex("illegal((ly)|( card((_?)s?)))?"): it => {
set text(weight: "bold", fill: white)
" " + box(it, fill: red, outset: 0.2em) + " "
}
set text(font: "Inter Tight", weight: "regular")
set par(leading: 0.5em)
if (is_role) {
set align(top)
show regex("\[(Goal|Perk)\]"): it => text(weight: "extrabold", size: 1.5em)[
#v(0.5em)
#it.text.slice(1, -1)
#v(-0.5em)
]
if (type == "") {
" "
} else {
role_descriptions.at(type)
}
} else {
descriptions.at(type)
}
if illegal {
"\nillegal"
}
}
#let generate_cards(render_card, render_card_back) = {
// Cards
let cards = ()
let card_backs = ()
for color in colors {
for _ in range(standing_card_amount) {
cards.push(render_card("Standing", value: standing_card_value))
card_backs.push(render_card_back(value: standing_card_value))
}
}
for color in colors {
cards.push(render_card("Token", color: color))
card_backs.push(render_card_back())
cards.push(render_card("Pact", color: color))
card_backs.push(render_card_back())
for card_data in social_cards {
cards.push(render_card(card_data.type, value: card_data.value, color: color, illegal: if card_data.keys().contains("illegal") {card_data.illegal} else {false}, supertitle: "Social"))
card_backs.push(render_card_back(value: card_data.value, illegal: if card_data.keys().contains("illegal") {card_data.illegal} else {false}))
}
}
for value in range(asset_value_range.at(0), asset_value_range.at(1) + 1) {
for _ in range(calc.ceil(asset_copy_amount / 2)) {
cards.push(render_card("Asset", value: value))
card_backs.push(render_card_back(value: value))
}
}
for value in range(asset_value_range.at(0), asset_value_range.at(1) + 1) {
for _ in range(calc.floor(asset_copy_amount / 2)) {
cards.push(render_card("Asset", value: value, illegal: true))
card_backs.push(render_card_back(value: value, illegal: true))
}
}
for value in range(influence_value_range.at(0), influence_value_range.at(1) + 1) {
for _ in range(influence_copy_amount) {
cards.push(render_card("Influence", value: value))
card_backs.push(render_card_back(value: value))
}
}
for value in testimony_values {
for _ in range(testimony_copy_amount) {
cards.push(render_card("Testimony", value: value, supertitle: "Speech"))
card_backs.push(render_card_back(value: value))
}
}
for value in rebrand_values {
for _ in range(rebrand_copy_amount) {
cards.push(render_card("Rebrand", value: value, supertitle: "Speech"))
card_backs.push(render_card_back(value: value))
}
}
for _ in range(defence_copy_amount) {
cards.push(render_card("Defence", value: defence_value, supertitle: "Speech"))
card_backs.push(render_card_back(value: defence_value))
}
for role in role_descriptions.keys() {
cards.push(render_card(role, supertitle: "Role"))
card_backs.push(render_card_back(role: true))
}
for _ in range(4) {
cards.push(render_card("", supertitle: "Role"))
card_backs.push(render_card_back(role: true))
}
return (cards, card_backs)
}
#let render_table_cutout(element, cut_gutter, side_distance, color: none, stroke_color: black, left_side: true, rotation: 270deg) = {
let cells = (
box(
width: side_distance / 4,
height: card_width,
outset: if left_side {(left: cut_gutter)} else {(right: cut_gutter)},
stroke: (
top:(thickness: 0.1em, paint: stroke_color, dash: "dashed"),
bottom:(thickness: 0.1em, paint: stroke_color, dash: "dashed"),
),
fill: color
),
[
#place(center + horizon)[
#box(
fill: color,
width: card_height,
height: card_width,
outset: (
top: cut_gutter / 2,
bottom: cut_gutter / 2,
left: if left_side {cut_gutter} else {0mm},
right: if left_side {0mm} else {cut_gutter}
)
)
]
#place(center + horizon)[
#box(
width: card_height,
height: card_width,
stroke: (
top:(thickness: 0.1em, paint: stroke_color, dash: "dashed"),
bottom:(thickness: 0.1em, paint: stroke_color, dash: "dashed"),
left: if left_side {(thickness: 0.1em, paint: stroke_color, dash: "dashed")} else {none},
right: if left_side {none} else {(thickness: 0.1em, paint: stroke_color, dash: "dashed")}
)
)
]
#rotate(rotation,[#element], reflow: true)
]
)
if left_side {
cells
} else {
cells.rev()
}
}
#let render_single(render_card, render_card_back) = {
let (cards, card_backs) = generate_cards(render_card, render_card_back)
set page(
width: card_width,
height: card_height,
margin: 0%,
)
set align(center + horizon)
grid(columns: 1, ..cards.enumerate().map(it => {
(
it.at(1),
card_backs.at(it.at(0))
).flatten()
}
).flatten())
}
#let render_single_foldable(render_card, render_card_back) = {
let (cards, card_backs) = generate_cards(render_card, render_card_back)
set page(
width: card_width,
height: card_height * 2,
margin: 0%,
)
set align(center + horizon)
grid(columns: 1, ..cards.enumerate().map(it => {
(
rotate(180deg)[
#card_backs.at(it.at(0))
],
it.at(1)
)
}
).flatten())
}
#let render_foldable(render_card, render_card_back) = {
let (cards, card_backs) = generate_cards(render_card, render_card_back)
set page(
"a4",
margin: 0%,
)
set align(center + horizon)
let cut_gutter = 1em
let cut_gutter_2 = 1em
let side_distance = 50% - card_height
grid(rows: 4, columns: (side_distance, card_height, card_height, side_distance), row-gutter: cut_gutter_2, ..cards.enumerate().map(it => {
let role_card = (cards.len() - it.at(0)) <= role_descriptions.len() + 4
(
render_table_cutout(it.at(1), cut_gutter_2, side_distance, rotation: 90deg),
render_table_cutout(card_backs.at(it.at(0)), cut_gutter_2, side_distance, color: if role_card {none} else {black}, stroke_color: if role_card {black} else {white}, left_side: false)
).flatten()
}
).flatten())
}
#let render_double_sided(render_card, render_card_back) = {
let (cards, card_backs) = generate_cards(render_card, render_card_back)
set page(
"a4",
margin: 0%,
)
set align(center + horizon)
let cut_gutter = 1em
let cut_gutter_2 = 1em
let side_distance = 50% - card_height
grid(rows: 4, columns: (side_distance, card_height, card_height, side_distance), row-gutter: cut_gutter_2, ..cards.enumerate().chunks(8).map(chunk => {
for it in chunk {
let role_card = (cards.len() - it.at(0)) <= role_descriptions.len() + 4
render_table_cutout(it.at(1), cut_gutter_2, side_distance, left_side: calc.rem(it.at(0), 2) == 0)
}
for index in chunk.map(it => it.at(0)).chunks(2).map(it => it.rev()).flatten() {
let card_back = card_backs.at(index)
let role_card = (cards.len() - index) <= role_descriptions.len() + 4
render_table_cutout(card_back, cut_gutter_2, side_distance, color: if role_card {none} else {black}, stroke_color: if role_card {black} else {white}, left_side: calc.rem(index, 2) == 1 )
}
}
).flatten())
}
#let render(render_type, render_card, render_card_back) = {
if render_type == "single" {
render_single(render_card, render_card_back)
} else if render_type == "single_foldable" {
render_single_foldable(render_card, render_card_back)
} else if render_type == "foldable" {
render_foldable(render_card, render_card_back)
} else if render_type == "double_sided" {
render_double_sided(render_card, render_card_back)
}
} |
|
https://github.com/ivaquero/cetz-control | https://raw.githubusercontent.com/ivaquero/cetz-control/main/0.1.0/cetz-control.typ | typst | #import "@preview/fletcher:0.5.0": diagram, node, edge
// font style
// chinese text
#let ctext(label, font: "Songti SC") = text(label, size: .7em, font: font)
// node style
// rectangle node
#let rnode(sym, label) = node(sym, label, shape: rect)
// circle node
#let onode(sym, label) = node(sym, label, shape: circle, radius: 10pt)
// label node
#let label(sym, label) = node(sym, label, stroke: white)
// edge style
#let arredge(n1, n2, label, label-pos, corner, corner-radius) = edge(
n1,
n2,
marks: "-|>",
label: label,
label-pos: label-pos,
corner: corner,
corner-radius: 0pt,
)
|
|
https://github.com/Lucas-Wye/tech-note | https://raw.githubusercontent.com/Lucas-Wye/tech-note/main/src/LaTeX.typ | typst | = LaTeX
- LaTeX(音译“拉泰赫”)是一种基于ΤΕΧ的排版系统,由美国计算机学家莱斯利·兰伯特(<NAME>)在20世纪80年代初期开发。
利用这种格式,即使使用者没有排版和程序设计的知识也可以充分发挥由TeX所提供的强大功能,能在几天,甚至几小时内生成很多具有书籍质量的印刷品。
- 对于生成复杂表格和数学公式,这一点表现得尤为突出。因此它非常适用于生成高印刷质量的科技和数学类文档。这个系统同样适用于生成从简单的信件到完整书籍的所有其他种类的文档。
== Install
从#link("https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/Images/")[清华镜像源]下载对应操作系统的Texlive软件包
```sh
# 安装
sudo ./install-tl
# 设置环境变量
# LaTeX
export TEX_HOME=/usr/local/texlive/2019
export PATH=$PATH:$TEX_HOME/bin/x86_64-linux
export INFOPATH=$INFOPATH:$TEX_HOME/texmf-dist/doc/info
export MANPATH=$MANPATH:$TEX_HOME/texmf-dist/doc/man
```
== 安装 Windows 字体
```sh
# 创建 win 下字体专用文件夹
sudo mkdir /usr/share/fonts/winfonts
# 复制windows上的字体到/usr
sudo cp your_winfonts_dir /usr/share/fonts/winfonts
# 进入字体文件夹
cd /usr/share/fonts/winfonts
# 修改访问权限
sudo chmod 744 *
# 回到主目录
cd ~
# 更新字体信息
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -f -v
```
== 通过取消pdf压缩加快编译
=== XelaTeX
在导言区加上特殊语句,例子如下:
```latex
\special{dvipdfmx:config z 0}
\documentclass{article}
\begin{document}
hello world.
\end{document}
```
或者在latexmk编译脚本中修改:
```perl
$xdvipdfmx="xdvipdfmx -z0 -q -E -o %D %O %S";
```
z0即采用不压缩的方式生成pdf
=== pdfTeX
设置两个变量的值:
```latex
\pdfcompresslevel=0
\pdfobjcompresslevel=0
```
== More
#link("http://github.com/Lucas-Wye/Latex_template")[LaTeX模板] \
#link("http://latexstudio.net/")[LaTeX开源小屋] \
#link("https://tex.stackexchange.com/")[Stackexchange] \
#link("https://github.com/Lucas-Wye/Share/tree/master/LaTeX")[LaTeX Introduction]
\
#link("https://castel.dev/post/lecture-notes-1/")[How I’m able to take notes in mathematics lectures using LaTeX and Vim]
|
|
https://github.com/Bang0518/RSBD | https://raw.githubusercontent.com/Bang0518/RSBD/master/report.typ | typst | #import "template.typ": *
#show: project.with(
header_text: "2024 暑期大数据推荐系统课程",
title: "基于隐式反馈的 Top-10 推荐列表预测",
authors: (
(
name: "吴建军",
organization: [学号2024140899],
email: "<EMAIL>"
),
),
abstract: "本实验通过使用提供的训练集构建了推荐模型,并使用测试集中的数据对推荐系统进行了Top-10推荐列表的预测。完成了数据处理、模型构建、训练与验证的过程,并生成了每个用户的推荐结果。通过实验验证了推荐算法的效果和可行性,并对推荐系统的性能进行了评估。",
keywords: (
"推荐系统",
"Top-10推荐",
"隐式反馈",
),
)
= 实验概述 <introduction>
training.txt是用户-物品-隐式反馈的交互对,一共有四万多条交互信息。在代码中将其拆分为训练集和验证集。
test.txt是真实的测试集,只有用户ID,我们最终需要在该测试集上进行Top-N推荐任务。
result.txt是算法得到的结果,即对test.txt中的用户一一进行Top-10推荐。
== 实验设计 <setting>
本实验包括以下几个步骤,每个部分都有明确的功能,最终实现了一个基于矩阵分解的推荐系统。
+ 数据加载与预处理。这部分代码加载训练数据,进行负采样来生成负样本,并将正负样本结合后打乱顺序。
+ 数据集划分和稀疏度计算。计算了数据的稀疏度,并划分了训练集和验证集,计算了平均评分。
+ 初始化矩阵参数。初始化了用户和电影的特征矩阵及其增量矩阵。
+ 训练模型。实现了模型的训练过程,包括特征矩阵的更新、训练误差和验证误差的计算,并绘制了误差曲线。
+ Precision@10和Recall@10计算。这部分代码计算了Precision@10和Recall@10两个评价指标。
+ 推荐结果生成与保存。这部分代码对测试集用户生成推荐结果,并将结果保存为txt文件。
== 代码清单
本项目的代码目录如下:
```python
project/
│
├── data/
│ └── training.txt
│ └── test.txt
│ └── result.txt
│
├── images/
│ └── num_feats_6.png
│ └── num_feats_8.png
│ └── num_feats_10.png
│ └── baseline.png
│
├── baseline.py
└── main.py
```
data目录包含输入、输出数据文件。
images目录包含本报告中所有的图。
baseline.py文件为基准模型的实现代码,用于与主模型进行比较。
main.py文件为主程序文件,包含项目的核心逻辑。
== 实验环境 <environment>
本实验使用的环境如下:
- Ubuntu 22.04 LTS
- Python 3.11.9
= 实现细节 <details>
== 数据加载与预处理
加载训练数据并设定列名为"user_id", "item_id", "click",方便后续处理。将所有点击行为设为5,简化了评分机制,使模型更关注于交互关系。通过负采样生成负样本(即用户未点击的项目),并将正负样本结合,打乱顺序以增加数据的多样性。
这样做确保数据格式正确,同时通过引入负样本,提升模型的泛化能力,使其在预测未见数据时表现更好。
```Python
# 读取训练数据
train_data = pd.read_csv("data/training.txt", sep=" ", header=None, names=["user_id", "item_id", "click"])
train_data["click"] = 5
rating = train_data["click"]
movie = train_data["item_id"]
user = train_data["user_id"]
data_num = len(rating)
movie_num = movie.nunique() # 电影的数量
user_num = user.nunique() # 用户的数量
# 负采样
negative_sample = np.random.choice(user_num * movie_num, data_num, replace=True)
record_user = []
record_movie = []
record_rating = [1] * data_num
for i in negative_sample:
movie_i = i // user_num
user_i = i % user_num + 1
record_user.append(user_i)
record_movie.append(movie_i)
negative_data = pd.DataFrame({"user_id": record_user, "item_id": record_movie, "click": record_rating})
# 数据结合
data = pd.concat([train_data, negative_data])
rating = data["click"]
movie = data["item_id"]
user = data["user_id"]
data_num = len(rating)
movie_num = movie.nunique() # 使用.nunique()确保电影数量的准确性
user_num = user.nunique() # 使用.nunique()确保用户数量的准确性
data = data.sample(frac=1).reset_index(drop=True) # 打乱数据集
```
== 数据集划分和稀疏度计算
计算数据的稀疏度,通过用户和物品的数量以及评分数据的数量来确定数据的稀疏程度。这一步有助于理解数据的特点,选择合适的模型和优化方法。随后将数据划分为训练集和验证集,训练集用于训练模型,验证集用于评估模型在未见过的数据上的表现。
```Python
# 稀疏度
sparsity = data_num / (movie_num * user_num)
print(f"Sparsity: {sparsity:.6f}")
# 划分训练集和验证集
train_num = 80000
train_vec = data.iloc[:train_num]
probe_vec = data.iloc[train_num:84000]
mean_rating = train_vec["click"].mean()
pairs_tr = len(train_vec)
pairs_pr = len(probe_vec)
numbatches = 8
num_m = movie_num
num_p = user_num
```
== 初始化矩阵参数
初始化用户特征矩阵w1_P1和电影特征矩阵w1_M1,以及它们的增量矩阵w1_P1_inc和w1_M1_inc,这些矩阵用于动量优化。这些特征矩阵以随机小数初始化,确保模型在开始训练时有一个合理的初始状态。增量矩阵用于记录前几次更新的趋势,动量优化有助于加速训练过程,提高模型的收敛速度和稳定性,减少训练过程中的震荡。
```Python
# 初始化矩阵参数
w1_M1 = 0.1 * np.random.rand(num_m, num_feat) # 电影特征矩阵
w1_P1 = 0.1 * np.random.rand(num_p, num_feat) # 用户特征矩阵
w1_M1_inc = np.zeros((num_m, num_feat)) # 电影特征矩阵增量
w1_P1_inc = np.zeros((num_p, num_feat)) # 用户特征矩阵增量
```
== 训练模型
通过多次epoch和batch迭代更新特征矩阵。在每个batch中,提取当前批次的用户和物品ID,计算预测评分、误差平方和、梯度,并更新特征矩阵。分批次训练使得模型可以处理大规模数据,避免内存溢出。梯度更新和动量优化可以加速模型训练,提高模型的准确性和稳定性。每个epoch结束时计算训练误差和验证误差,有助于监控模型的训练过程,及时调整策略。
```Python
# 训练模型
for epoch in range(maxepoch):
for batch in range(numbatches):
# 计算当前批次的起始和结束索引
start = batch * N
end = start + N
if end > pairs_tr: # 防止越界
end = pairs_tr
# 提取当前批次的用户和物品ID,并将它们的索引减1以匹配矩阵
aa_p = train_vec.iloc[start:end]["user_id"].values - 1
aa_m = train_vec.iloc[start:end]["item_id"].values - 1
rating = train_vec.iloc[start:end]["click"].values.astype(float) # 确保rating为浮点数
rating -= mean_rating # 减去平均评分
# 计算预测评分
pred_out = np.sum(w1_M1[aa_m] * w1_P1[aa_p], axis=1)
f = np.sum((pred_out - rating) ** 2) # 计算误差平方和
# 计算梯度
IO = 2 * (pred_out - rating)
IO = np.tile(IO[:, None], num_feat) # 将IO扩展到特征数量的维度
Ix_m = IO * w1_P1[aa_p] # 对电影特征的梯度
Ix_p = IO * w1_M1[aa_m] # 对用户特征的梯度
# 初始化梯度增量矩阵
dw1_M1 = np.zeros((movie_num, num_feat))
dw1_P1 = np.zeros((user_num, num_feat))
# 累加每个样本的梯度
for ii in range(N):
dw1_M1[aa_m[ii]] += Ix_m[ii]
dw1_P1[aa_p[ii]] += Ix_p[ii]
# 更新特征矩阵
w1_M1_inc = momentum * w1_M1_inc + epsilon * dw1_M1 / N
w1_M1 -= w1_M1_inc
w1_P1_inc = momentum * w1_P1_inc + epsilon * dw1_P1 / N
w1_P1 -= w1_P1_inc
# 计算训练误差
pred_out = np.sum(w1_M1[aa_m] * w1_P1[aa_p], axis=1)
f_s = np.sum((pred_out - rating) ** 2)
err_train[epoch] = np.sqrt(f_s / N) # 计算训练集上的RMSE
# 在验证集上进行预测并计算误差
aa_p = probe_vec["user_id"].values - 1
aa_m = probe_vec["item_id"].values - 1
rating = probe_vec["click"].values
pred_out = np.sum(w1_M1[aa_m] * w1_P1[aa_p], axis=1) + mean_rating
pred_out = np.clip(pred_out, 1, 5) # 将预测评分限制在1到5之间
err_valid[epoch] = np.sqrt(np.sum((pred_out - rating) ** 2) / pairs_pr) # 计算验证集上的RMSE
# 打印每个epoch的训练和验证误差
print(f"Epoch {epoch + 1}/{maxepoch}, Train RMSE: {err_train[epoch]:.4f}, Test RMSE: {err_valid[epoch]:.4f}")
# 绘制Loss曲线
plt.plot(range(1, maxepoch + 1), err_train, label="Train Error", color="blue")
plt.plot(range(1, maxepoch + 1), err_valid, label="Validation Error", color="red")
plt.xlabel("Epoch")
plt.ylabel("Error")
plt.legend()
plt.show()
```
== 计算Precision@10和Recall@10
计算两个关键的推荐系统评估指标:Precision@10和Recall@10。Precision@10衡量推荐结果中前10个推荐项中相关项的比例,反映推荐结果的准确性。Recall@10衡量前10个推荐项中覆盖了所有相关项的比例,反映推荐结果的全面性。
```Python
# 定义常量
j = 10
# 计算Precision@10
precisions = []
for i in range(user_num):
user_i_rating_real = probe_vec[probe_vec["user_id"] == i + 1]
user_i_rating_real = user_i_rating_real.sort_values(by="click", ascending=False)
user_i_rating = (
np.dot(w1_P1[i, :], w1_M1[user_i_rating_real["item_id"].values - 1].T)
+ mean_rating
)
if len(user_i_rating_real) > j:
top_j_pred = np.argsort(-user_i_rating)[:j]
precision = np.sum(np.isin(top_j_pred, np.arange(j))) / j
precisions.append(precision)
else:
ti = np.sum(user_i_rating_real["click"] >= 4)
if ti != 0:
precision = np.sum(user_i_rating[:ti] >= 4) / ti
precisions.append(precision)
Pre = np.mean(precisions)
# 计算Recall@10
recalls = []
for i in range(user_num):
user_i_rating_real = probe_vec[probe_vec["user_id"] == i + 1]
user_i_rating_real = user_i_rating_real.sort_values(by="click", ascending=False)
user_i_rating = (
np.dot(w1_P1[i, :], w1_M1[user_i_rating_real["item_id"].values - 1].T)
+ mean_rating
)
if len(user_i_rating_real) > j:
user_i_rating[user_i_rating < 4] = 0
user_i_rating[user_i_rating >= 4] = 1
ti = np.sum(user_i_rating)
if ti != 0:
bigerthan4 = np.sum(user_i_rating_real["click"] >= 4)
tinri = np.sum(user_i_rating[:bigerthan4])
recall = tinri / ti
recalls.append(recall)
else:
ti = np.sum(user_i_rating_real["click"] >= 4)
if ti != 0:
recall = np.sum(user_i_rating[:ti] >= 4) / ti
recalls.append(recall)
Re = np.mean(recalls)
print(f"Recall@10: {Re:.4f}, Precision@10: {Pre:.4f}")
```
== 推荐结果生成与保存
读取测试集数据,对每个测试用户生成推荐结果。通过计算用户对每个物品的预测评分,筛选出评分最高的前10个物品作为推荐结果。将推荐结果与测试集用户结合,生成推荐结果的DataFrame,并保存为txt文件。
```Python
# 读取测试集数据
test = pd.read_csv("data/test.txt", header=None, sep=" ")
test.columns = ["user_id"] # 设置列名为'user_id'
# 定义常量
k = 10 # 推荐的数量
# 初始化变量
record = [] # 存储推荐结果的列表
# 对每个测试用户进行推荐
for i in test["user_id"]:
user_i_rating = np.dot(w1_P1[i - 1, :], w1_M1.T) + mean_rating
used = data[data["user_id"] == i]["item_id"].values - 1
user_i_rating[used] = 0 # 将已评分的电影的评分设为0
top_k_movies = np.argsort(user_i_rating)[-k:][::-1] + 1
record.append((i, top_k_movies)) # 将用户ID和推荐结果加入列表
# 将推荐结果转换为指定格式的字符串
result_lines = []
for user_id, movies in record:
movies_str = ",".join(map(str, movies))
result_lines.append(f"{user_id}: {movies_str}")
# 将结果保存到TXT文件
with open("data/result.txt", "w") as file:
for line in result_lines:
file.write(line + "\n")
```
= 结果分析 <example>
== 参数设定
本实验的所用的参数如下,学习率(epsilon=50)控制每次参数更新的步长,动量参数(momentum=0.7)加速收敛并减少震荡;初始epoch(epoch=1)和总训练次数(maxepoch=50)决定训练迭代的轮数;训练误差和验证误差数组(err_train和err_valid)分别用于记录每个epoch结束时的训练和验证误差,以监控模型表现;隐因子数量(num_feat=8)决定特征向量的维度,影响模型复杂度和推荐效果;每次训练三元组的数量(N=10000)设定了每个batch的大小,确保有效利用内存处理大规模数据。
```python
epsilon = 50 # Learning rate 学习率
momentum = 0.7 # Momentum parameter 动量优化参数
epoch = 1 # Initial epoch 初始化epoch
maxepoch = 50 # Total number of training epochs 总训练次数
err_train = np.zeros(maxepoch) # Training error 训练误差
err_valid = np.zeros(maxepoch) # Validation error 验证误差
err_random = np.zeros(maxepoch) # Random error 随机误差
num_feat = 8 # Number of latent factors 隐因子数量
N = 10000 # Number of training triplets per epoch 每次训练三元组的数量
```
== 训练集表现
分别设定num_feat的值为6,8,10来探究训练集上的表现,如@nf6、@nf8、@nf10。可以看到训练误差(Train Error)随着训练次数的增加,训练误差逐渐下降并趋于稳定,说明模型在训练数据上的拟合效果越来越好。但是随着隐因子数量的增加,验证误差(Validation Error)在初期也随训练次数的增加而下降,但在某个点之后开始趋于平稳甚至略有上升。这表明增加隐因子数量虽然可以提高训练数据上的拟合效果,但对验证数据的泛化能力提升有限,甚至可能导致过拟合。
#figure(image("images/num_feats_6.png"),
caption: [
num_feat = 6 的 Loss 曲线
],
)<nf6>
#figure(image("images/num_feats_8.png"),
caption: [
num_feat = 8 的 Loss 曲线
],
)<nf8>
#figure(image("images/num_feats_10.png"),
caption: [
num_feat = 10 的 Loss 曲线
],
)<nf10>
如@table1 所示,在五个随机种子下进行了不同测试以消除偶然性。隐因子数量为6时,模型在Pre@10和Re@10两个指标上的表现最好,表明此时模型的推荐效果较优。增加隐因子数量到8或10并未显著提升模型性能,反而有所下降。
#figure(
table(
columns: (auto, 1fr, 1fr),
inset: 10pt,
align: horizon,
[隐因子数量], [Pre@10], [Re@10],
"6", "0.5876", "0.5903",
"8", "0.5394", "0.5415",
"10","0.5669", "0.5689"
),
caption: "不同隐因子的Pre@10和Re@10"
)<table1>
== 与其他模型的对比
采用ALS与BPR模型作为baseline,与本模型进行对比。从@baseline 中可以观察到ALS(Alternating Least Squares)和BPR(Bayesian Personalized Ranking)两种模型在Precision@10和Recall@10指标上的表现。
#figure(image("images/baseline.png"),
caption: [
ALS与BPR模型的表现
],
)<baseline>
=== Pre@10比较
- 本模型:隐因子数量为6时的Pre@10最高,为0.5876;隐因子数量为10时,Pre@10也较高,为0.5669。
- ALS模型:Pre@10值较低,约为0.025。
- BPR模型:Pre@10值较高,约为0.04,但仍远低于本模型的表现。
=== Re@10比较
- 本模型:隐因子数量为6时的Re@10最高,为0.5903;隐因子数量为10时,Re@10也较高,为0.5689。
- ALS模型:Re@10值较低,约为0.01。
- BPR模型:Re@10值较高,约为0.022,但仍远低于本模型的表现。
从对比中可以明显看出,本模型在不同隐因子数量下的Pre@10和Re@10指标均显著高于ALS和BPR模型。这表明在推荐系统的前10个推荐项中,本模型的推荐准确性和召回率远高于ALS和BPR模型,特别是在隐因子数量为6和10时表现最佳。
= 实验总结
在本次实验中,我对比了不同推荐算法和模型在隐性反馈数据上的表现,重点评估了本模型、ALS(Alternating Least Squares)模型和BPR(Bayesian Personalized Ranking)模型在Precision@10和Recall@10两个指标上的表现。
从实验结果中可以明显看出,本模型在不同隐因子数量配置下的Precision@10和Recall@10指标均显著优于ALS和BPR模型。特别是在隐因子数量为6和10时,本模型的推荐准确性和召回率表现最佳。这表明本模型在处理隐性反馈数据时具有较强的优势,能够提供更为精准和全面的推荐结果。
|
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/typst_packages/mtgstory/0.1.0/mtgstory.typ | typst | #let conf(
title,
set_name: "Unknown set",
author: "Unknown author",
show_images: true,
doc
) = {
set par(justify: true)
set page(
paper: "a4",
header: [
#grid(
columns: (1fr, 1fr),
gutter: 2em,
[*#title\ by #author*],
align(right)[*#set_name*],
)
#line(length: 100%)
],
footer: [
#align(center)[#counter(page).display("1")]
],
)
[
#set document(title: title, author: author)
#{
set text(size: 2.5em)
set align(center)
heading(level: 2, title)
author
}
#{
set text(size: 1.5em)
set align(center)
[From set #emph[#set_name]]
}
#set heading(outlined: false)
#if show_images == false [
#show figure: it => {}
#doc
] else [
#doc
]
]
}
|
|
https://github.com/jonaspleyer/peace-of-posters | https://raw.githubusercontent.com/jonaspleyer/peace-of-posters/main/docs/content/documentation/themes.md | markdown | MIT License | ---
title: "Themes"
weight: 30
---
# Themes
Themes are dictionaries with particular variables that control overall styling of the generated boxes.
The dictionary is saved as a [state](https://typst.app/docs/reference/meta/state/) variable and can be accessed by the `update-theme` and `set-theme` methods.
Most of the time, themes are meant to be set initially without any further alteration.
```typst
theme = (
"body-box-args": [dictionary],
"body-box-args-with-title": [dictionary],
"body-box-function": [function],
"heading-box-args": [dictionary],
"heading-box-args-with-body": [dictionary],
"heading-box-function": [function],
)
```
| Argument | Type | Default Value | Description |
| --- | --- | --- | --- |
| `body-box-args` | [dictionary] | | Arguemtns given to the body box. |
| `body-box-args-with-title` | [dictionary] | | Arguemtns given to the body box when a title is present. This dictionary is optional. Leaving |
| `body-box-function` | [function] | | Arguemtns given to the body box. |
| `heading-box-args` | [dictionary] | | Arguemtns given to the body box. |
| `heading-box-args-with-body` | [dictionary] | | Arguemtns given to the body box. |
| `heading-box-function` | [function] | | Arguemtns given to the body box. |
## Updating a Theme
```typst
update-theme(
..args
)
```
All arguments coincide with the values of the ones of `theme` shown above.
### Note: Updating in the middle of the document
The user can also update the theme in the middle of the document.
This will alter all following boxes but should not touch preceding ones.
## Setting a new Theme
To entirely change the theme of a document, one can use this method and set the new theme.
It is not checked that all keys and values are properly populated.
Thus the user is responsible for defining them.
It is often easier to instead take an existing theme and modify its entries.
```typst
set-theme(
theme: [dictionary]
)
```
## Example Themes
### Default
The default values of the theme. If nothing is specified by the user, these values will be chosen.
```typst
default = (
"body-box-args": (
inset: 0.6em,
width: 100%,
),
"body-text-args": (:),
"heading-box-args": (
inset: 0.6em,
width: 100%,
fill: rgb(50, 50, 50),
stroke: rgb(25, 25, 25),
),
"heading-text-args": (
fill: white,
)
)
```
### Uni Freiburg
A theme surrounding colors specifically chosen in complience with the corporate design of the University of Freiburg.
```typst
#let uni-fr = (
"body-box-args": (
inset: 0.6em,
width: 100%,
),
"body-text-args": (:),
"heading-box-args": (
inset: 0.6em,
width: 100%,
fill: rgb("#1d154d"),
stroke: rgb("#1d154d"),
),
"heading-text-args": (
fill: white,
),
)
```
|
https://github.com/takotori/PhAI-Spick | https://raw.githubusercontent.com/takotori/PhAI-Spick/main/utils.typ | typst | #let colorange(x) = text(fill: orange, $#x$)
#let colgreen(x) = text(fill: green, $#x$)
#let colmagenta(x) = text(fill: fuchsia, $#x$)
#let colblue(x) = text(fill: blue, $#x$)
#let colred(x) = text(fill: red, $#x$) |
|
https://github.com/RiccardoTonioloDev/TypUrNotes | https://raw.githubusercontent.com/RiccardoTonioloDev/TypUrNotes/main/template_demo.typ | typst | MIT License | #import "tun_template/tun.typ": *
#show: config.with(
myAuthor: "<NAME>",
myTitle: "Template creation in Typst",
myLang: "en",
pages_numbering: "1",
creation_day: "01",
creation_month: "01",
creation_year: "1970",
associated_with: "University Typography Course",
use_glossary: true,
use_bibliography: true,
digital: true,
)
= Chapter
== Sub chapter
#lorem(256)
Use of the @ft and the @st.
Citing @ImportantPaper.
#not_break([
Sum of a list in python:
```python
l = [1,2,3,4]
sum = 0
for n in l:
sum += n
print(f"The sum is: {sum}")
```
])
= Another chapter
#lorem(256)
Using the @tt.
Citing both @MentionedBook and @IncredibleArticle.
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/fletcher/0.4.3/src/exports.typ | typst | Apache License 2.0 | #import "deps.typ": cetz
#import "marks.typ": *
#import "draw.typ": *
#import "shapes.typ"
#import "layout.typ": *
#import "main.typ": *
#import "utils.typ"
|
https://github.com/B-Ricey763/resume | https://raw.githubusercontent.com/B-Ricey763/resume/main/README.md | markdown | # My Resume
This is where I host my resume, which is built in Typst and based off of [this wonderful template](https://github.com/tzx/NNJR)

|
|
https://github.com/ClassicConor/UoKCSYear1ExamNotes2024 | https://raw.githubusercontent.com/ClassicConor/UoKCSYear1ExamNotes2024/master/Databases%20(With%20Exam%20Answers)/Databases%202023%20Paper/Databases%202023%20Answers.typ | typst | = 2023 Databases and the Web Exam
<databases-and-the-web-exam>
== Question 1
<question-1>
=== a: Answer the following based on the below HTML/CSS code
<a-answer-the-following-based-on-the-below-htmlcss-code>
```html
<html>
<head>
<meta charset="UTF-8"/>
<title>HTML example</title>
<style>
p {font-style: italic;}
div {width: 50vw;}
div.b {margin-left: auto;}
</style>
</head>
<body>
<span>
<div class="a">A</div>
<div class="b">B
<div class="c">C</div>
<div class="d">D</div>
</div>
<div class="e">E</div>
</span>
<div class="container">
<p>COMP3230</p> <p>Exam</p>
</div>
</body>
</html>
```
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 1)
+ Show the output of this code as you would see on a web browser. \[12
marks\]
]
]
#figure(image("./Databases1a.png"),
caption: [
Question1 1a Answer
]
)
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 2)
+ Write a CSS rule to change the colour of all paragraph (`<p>`)
descendants of div with class "container" to blue. \[2 marks\]
]
]
```css
div.container p {
color: blue;
}
```
#quote(block: true)[
#block[
#set enum(numbering: "(a)", start: 2)
+ Briefly explain the difference between inline and block-level HTML
elements, and show an example of each. \[6 marks\]
]
]
Inline elements:
- Inline elements do not start on a new line and only take up as much
width as necessary. #strong[Basically, when they are used, they can
occur on the same line as other text that’s already there]
- They allow other elements to sit beside them horizontally.
- Examples of inline elements include `<span>`, `<a>`, `<img>`,
`<strong>`, `<em>`, `<input>`, etc
Example:
```html
<p>This is an <strong>inline</strong> element.</p>
```
Block-level elements:
- Block-level elements always start on a new line and take up the full
width available, pushing subsequent elements onto new lines.
- They create a "block" of content.
- Examples of block-level elements include `<div>`, `<p>`, `<h1>` to
`<h6>`, `<ul>`, `<ol>`, `<li>`, etc.
Example:
```html
<div>This is a <p>block-level</p> element.</div>
```
#pagebreak()
== Question 2
<question-2>
#quote(block: true)[
#block[
#set enum(numbering: "(a)", start: 1)
+ JavaScript variables can have global or local scope. Briefly explain
what each one of these two means
]
]
Global and local scope refers to the accessibility of variables within a
JavaScript program.
- Global variables can be accessed from anywhere within the program,
including functions, blocks, and nested loops.
- Local variables have a much more limited scope from which they can be
accessed or used. They can only be accessed within a function, or a
specific block of code, meaning other parts of the programs will not
be able to use them.
=== (b) You have the following JavaScript function
<b-you-have-the-following-javascript-function>
```javascript
function checkSpeed(temp){
if (temp > 70)
speed = "over the limit";
if (temp > 40)
speed = "slow down";
if (temp > 0)
speed = "tortoise";
else speed = "stuck in traffic";
return speed;
}
```
What would the above function return in the following three cases:
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 1)
+ checkSpeed(80); \[2 marks\]
]
]
tortoise
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 2)
+ checkSpeed(55); \[2 marks\]
]
]
tortoise
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 3)
+ checkSpeed(0); \[2 marks\]
]
]
stuck in traffic
#quote(block: true)[
#block[
#set enum(numbering: "(a)", start: 3)
+ Function showResult takes input mark, and shows an alert box with
message Pass if the mark is at least 40, otherwise Fail. If the mark
is negative or greater than 100, the message is Not a valid mark
\<br\>
]
Someone attempted to implement the function showResult in JavaScript, as
shown below: \
Line 1 function showResult(){ \
Line 2 if (mark\<0 OR mark \>100){ \
Line 3 alert("Not a valid mark"); \
Line 4 } else if ( \>=40){ \
Line 5 alert("Pass"); \
Line 6 else { \
Line 7 alert (Fail); \
Line 8 } \
Line 9 } \
However, there are 5 errors in the above code. For each error you
identify, write down the line number and the correct version. \[10
marks\]
]
Errors in code:
- "OR" should be replaced by "||"
- Needs a finishing curly bracket after the else if statement, because
it’s missing it
- The alert for the else statement needs to have quotation marks
- The variable mark isn’t ever brought into the function, which would
mean that there’s nothing to test
- The else if statement logic isn’t correct. It have the word mark
inside of it, and be written like this:
```javascript
else if (mark >= 40)
```
#pagebreak()
== Question 3
<question-3>
=== (a) An associated array named scores is used to record the team and score on a Sunday rugby match as given below
<a-an-associated-array-named-scores-is-used-to-record-the-team-and-score-on-a-sunday-rugby-match-as-given-below>
```php
$scores = array(
"Exeter"=>42, "Gloucester"=>76, "Sale"=>34,
"Bristol"=>67, "Leicester"=>52, "Bath"=>28,
"Newcastle"=>84, "Worcester"=>61);
```
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 1)
+ Here is a section of PHP code to list on a web page the teams in the
array \$scores who have obtained a score over 40:
]
```php
foreach (scores as $team and $score) {
IF ($score = 40) {
echo "<p>$name</p>",
]
}
```
However, there are errors in the code. Identify the errors and write
down the correct version. \[6 marks\]
]
- The if statement should use a lower case if
- The square bracket should be replaced with a curly bracket
- In the foreach, scores should have a \$ at the front of it
- It should have a =\> instead of and, as this indicates the key and
value pairing of both
- It should echo \$team, instead of \$name, which hasn’t been identified
- It should use == instead of =, as we’re comparing values, not
assigning values
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 2)
+ Write a PHP statement to record in the array \$score the score 58 of
the team Northampton. \[2 marks\]
]
]
```php
$scores["Northampton"] = 58;
```
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 3)
+ Write a PHP statement to print out the total number of teams in the
array \$scores. \[2 marks\]
]
]
```php
$totalTeams = count($scores);
echo "Total teams: " . $totalTeams";
```
#block[
#set enum(numbering: "(a)", start: 2)
+ A PHP script on the site `www.travel.com`, named script.php outputs a
specific journey on request. The script is accessed after the user has
entered a ID number and destination letter on a form. The user’s
browser requests the script using a URL similar to the one below:
]
`http://www.travel.com/script.php?ID=3&destination=b`
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 1)
+ Is this an example of passing data to the PHP script using the HTTP
GET or the HTTP POST method? \[2 marks\]
]
]
GET
In the URL `http://www.travel.com/script.php?ID=3&destination=b`, the
data (ID and destination) is included in the URL itself as query
parameters after the ? symbol. This is characteristic of the GET method,
where data is appended to the URL as key-value pairs in the form of
query parameters.
In contrast, the HTTP POST method sends data in the request body rather
than as part of the URL.
#strong[The POST method wouldn’t change the appearance of the url.]
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 2)
+ What single line of PHP code, if contained within script.php would
place the ID number into a PHP variable named \$ID\_number? \[2
marks\]
]
]
```php
$ID_number = $_GET["ID"];
```
#block[
#set enum(numbering: "(a)", start: 3)
+ What is a cookie? Explain how could a web site use a cookie to track
whether or not a user is logged in. \[6 marks\]
]
A cookie is a small piece of data that a website sends to a user’s
browser and saved there. The website is then able to access the data on
this cookie, and send the data back with each request. This may be
useful for remembering a user’s preference on a website, as well as
whether a user is logged in. If the user is logged in, then
different/additional layouts to the page may be shown.
#pagebreak()
== Question 4
<question-4>
=== (a) Consider the SQL code below. You need to understand what the queries are doing and write down the results. Be aware that not all queries written here are correct
<a-consider-the-sql-code-below.-you-need-to-understand-what-the-queries-are-doing-and-write-down-the-results.-be-aware-that-not-all-queries-written-here-are-correct>
```sql
CREATE TABLE Author(
authorID INT PRIMARY KEY,
surname CHAR(255),
firstName CHAR(255));
CREATE TABLE Presentations(
presentationID INT PRIMARY KEY,
date DATE NOT NULL,
location CHAR(255),
authorID INT,
FOREIGN KEY (authorID) REFERENCES Author(authorID));
INSERT INTO Author VALUES(1,'Novikova','Julia');
INSERT INTO Author VALUES(2,'Netrebko','Anna');
INSERT INTO Author VALUES(3,'Terfel','Bryn');
INSERT INTO Author VALUES(4,'Terfel','Bryn');
INSERT INTO Author VALUES(2,'Kauffmann','Jonas');
INSERT INTO Presentations VALUES (3, '2023-01-04','Salzburg',1);
INSERT INTO Presentations VALUES (30, '2023-01-04','London',2);
INSERT INTO Presentations VALUES (31, '2023-01-01','Salzburg',1);
```
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 1)
+ Write down the contents of the two tables that have just been created.
\[10 marks\]
]
]
=== Author table:
#figure(
align(center)[#table(
columns: 3,
align: (auto,auto,auto,),
table.header([authorID], [surname], [firstName],),
table.hline(),
[1], [Novikova], [Julia],
[2], [Netrebko], [Anna],
[3], [Terfel], [Bryn],
[4], [Terfel], [Bryn],
)],
)
(note: attempting to insert Kauffmann into the Author table with the ID of 2 will cause an error, as this ID is already in use)
=== Presentations Table:
#figure(
align(center)[#table(
columns: 4,
align: (auto,auto,auto,auto,),
table.header([presentationID], [date], [location], [authorID],),
table.hline(),
[3], [023-01-04], [Salzburg], [1],
[30], [2023-01-04], [London], [2],
[31], [2023-01-01], [Salzburg], [1],
)]
, kind: table
)
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 2)
+ How many presentations by <NAME> are recorded in the database?
\[1 mark\]
]
]
There are two presentations presented by <NAME>.
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 3)
+ Write the output from the following query:
]
```sql
SELECT COUNT(*) FROM Author WHERE firstName='Anna'
```
]
#figure(
align(center)[#table(
columns: 1,
align: (auto,),
table.header([COUNT(\*)],),
table.hline(),
[1],
)]
, kind: table
)
```sql
COUNT(*)
--------
1
```
(basically it would show just a table with the header COUNT(\*), and
then underneath it show the value of 1, given that "Anna" only appears
once in the table)
#quote(block: true)[
#block[
#set enum(numbering: "(i)", start: 4)
+ Write down the output from the following query:
]
```sql
SELECT location FROM Presentations; [2 marks]
```
\[2 marks\]
]
```sql
location
---------
Salzburg
London
Salzburg
```
(basically it would show just a table with the header location, and then
underneath it show all the locations specified from the Presentations
table)
#quote(block: true)[
#block[
#set enum(numbering: "(a)", start: 22)
+ Assume you issue the following command:
]
```sql
INSERT INTO Presentations VALUES (39, '2023-02-02','London',3);
```
Now write down the result from the following query.
```sql
SELECT * FROM Author a WHERE EXISTS(SELECT authorID FROM
Presentations WHERE authorID=a.authorID AND location='London' );
```
\[5 marks\]
]
#figure(
align(center)[#table(
columns: 3,
align: (auto,auto,auto,),
table.header([authorID], [surname], [firstName],),
table.hline(),
[2], [Netrebko], [Anna],
[3], [Terfel], [Bryn],
)]
, kind: table
)
|
|
https://github.com/Walfisch115/thb-typst-template | https://raw.githubusercontent.com/Walfisch115/thb-typst-template/main/README.md | markdown | # THB Typst Vorlagen
Adaption der [THB Vorlagen](https://informatik.th-brandenburg.de/studium/abschlussarbeiten/) des Fachbereich Informatik und Medien für [Typst](https://typst.app/).
Vorlagen inklusive Beispiele für:
- Abschlussarbeit ([Vorschau PDF](thesis/Vorlage%20Thesis.pdf))
- Abschlussposter ([Vorschau PDF](poster/Vorlage%20Abschlussposter.pdf))
- Präsentationsvorlage für Vorträge ([Vorschau PDF](presentation/Vorlage%20Präsentation.pdf))
|
|
https://github.com/dangh3014/postercise | https://raw.githubusercontent.com/dangh3014/postercise/main/examples/basic-example.typ | typst | MIT License | // Import a theme
#import "../postercise.typ": *
#import themes.basic: *
// Set up paper dimensions and text
#set page(width: 24in, height: 18in)
#set text(size: 28pt)
// Set up colors
#show: theme.with()
// Add content
#poster-content[
// Add title, subtitle, author, affiliation, logos
#poster-header(
title: [Title of Research Project:],
subtitle: [Subtitle],
authors: [List of Authors],
logo-1: image("emu-logo.png")
)
// Include content in the footer
#poster-footer[
#set text(fill: white)
_Additional information_
]
// normal-box is used to create sections
#normal-box()[
= Background
#lorem(20)
]
// color can be overwritten
#normal-box(color: aqua)[
= Methods
#lorem(20)
$ gamma = 1/2 alpha beta^2 $
#lorem(15)
#figure(image("placeholder.png", width: 50%),
caption: [_Fig. 1: Sample Figure_])
]
#normal-box()[
= Results
#lorem(20)
#figure(image("placeholder.png", width: 50%),
caption: [_Fig. 2: Sample Results_])
#lorem(20)
#figure(table(columns: 3,
rows: 2,
fill: white, stroke: 0.0625em,
[*a*], [*b*], [*c*],
[1], [2], [3]),
caption: [_Table 1: Sample Table_])
]
#lorem(20)
#focus-box()[
= Key Findings
+ #lorem(5)
+ #lorem(4)
+ #lorem(8)
]
#normal-box()[
= Discussion
#lorem(30)
]
// Content can also be added without boxes for more flexible formatting
= Acknowledgements
The authors wish to thank those providing guidance, support, and funding.
= References
#set text(size: 0.8em)
+ #lorem(8)
+ #lorem(12)
]
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-0840.typ | typst | Apache License 2.0 | #let data = (
("MANDAIC LETTER HALQA", "Lo", 0),
("MANDAIC LETTER AB", "Lo", 0),
("MANDAIC LETTER AG", "Lo", 0),
("MANDAIC LETTER AD", "Lo", 0),
("MANDAIC LETTER AH", "Lo", 0),
("MANDAIC LETTER USHENNA", "Lo", 0),
("MANDAIC LETTER AZ", "Lo", 0),
("MANDAIC LETTER IT", "Lo", 0),
("MANDAIC LETTER ATT", "Lo", 0),
("MANDAIC LETTER AKSA", "Lo", 0),
("MANDAIC LETTER AK", "Lo", 0),
("MANDAIC LETTER AL", "Lo", 0),
("MANDAIC LETTER AM", "Lo", 0),
("MANDAIC LETTER AN", "Lo", 0),
("MANDAIC LETTER AS", "Lo", 0),
("MANDAIC LETTER IN", "Lo", 0),
("MANDAIC LETTER AP", "Lo", 0),
("MANDAIC LETTER ASZ", "Lo", 0),
("MANDAIC LETTER AQ", "Lo", 0),
("MANDAIC LETTER AR", "Lo", 0),
("MANDAIC LETTER ASH", "Lo", 0),
("MANDAIC LETTER AT", "Lo", 0),
("MANDAIC LETTER DUSHENNA", "Lo", 0),
("MANDAIC LETTER KAD", "Lo", 0),
("MANDAIC LETTER AIN", "Lo", 0),
("MANDAIC AFFRICATION MARK", "Mn", 220),
("MANDAIC VOCALIZATION MARK", "Mn", 220),
("MANDAIC GEMINATION MARK", "Mn", 220),
(),
(),
("MANDAIC PUNCTUATION", "Po", 0),
)
|
https://github.com/Myriad-Dreamin/tinymist | https://raw.githubusercontent.com/Myriad-Dreamin/tinymist/main/syntaxes/textmate/tests/unit/bugs/tinymist-issue334.typ | typst | Apache License 2.0 | #let xxx = n => $#n$
#xxx(1) |
https://github.com/maxwell-thum/typst-pf3 | https://raw.githubusercontent.com/maxwell-thum/typst-pf3/main/template.typ | typst | MIT License | #let project(title: "", authors: (), body) = {
// Set the document's basic properties.
set document(author: authors, title: title)
set page(paper: "us-letter")
set text(font: "New Computer Modern", lang: "en")
show math.equation: set text(weight: 400)
set par(justify: true)
body
} |
https://github.com/binhtran432k/ungrammar-docs | https://raw.githubusercontent.com/binhtran432k/ungrammar-docs/main/contents/system-design/system-architecture.typ | typst | == System Architecture <sec-sys-arch>
=== Overview
#figure(
image("/diagrams/generated/package/pkg-system.svg", width: 80%),
caption: [Ungrammar Language Ecosystem Architecture],
)
The Ungrammar language ecosystem comprises six primary components and an
external component:
*Ungrammar Lezer*: A powerful parser built on the Lezer framework, specifically
designed to analyze and understand Ungrammar syntax.
*Ungrammar Language Service*:
- This core component encompasses various language features, including:
- Annotation Service: Provides annotations for context-related information.
- Hover Service: Offers contextual information when hovering over elements.
- Completion Service: Provides code completion suggestions.
- Code Action Service: Suggests code actions for refactoring or improvements.
- Formatting Service: Applies consistent formatting rules to code.
- Validation Service: Detects and reports errors or inconsistencies in the
code.
- Highlight Semantic Service: Highlights code elements based on their
semantic meaning.
- Highlight Related Service: Identifies and highlights references to specific
elements.
- Folding Service: Enables collapsing and expanding code sections for better
readability.
- Definition Service: Allows users to quickly jump to the definition of a
symbol.
- Reference Service: Helps users locate all references to a specific symbol
within the codebase.
*Ungrammar Language Server*:
- LSP Implementation: Adheres to the Language Server Protocol (LSP) for
seamless integration with various code editors.
- Communication Bridge: Acts as a communication intermediary between the code
editor and the underlying Ungrammar language service.
- Language Service Integration: Leverages the *Ungrammar Language Service* to
provide language-specific features and functionality.
- JSON-RPC Interface: Utilizes JSON-RPC Service for efficient data exchange between the
language server and the code editor, enabling robust communication and
feature implementation.
*Ungrammar VS Code Extension*:
- Language Server Integration: Seamlessly integrates the *Ungrammar Language
Server* with the VS Code editor, providing a comprehensive language support
experience.
- Communication Bridge: Acts as a communication intermediary between the VS
Code editor and the language server, ensuring efficient data exchange and
feature implementation.
*Ungrammar Monaco*:
- Seamless Integration: Integrates the *Ungrammar Language Service* with the
Monaco editor, providing robust language support capabilities within the
Monaco environment.
- JavaScript-Based Communication: Manages communication between the Monaco
editor and the language server using pure JavaScript, ensuring efficient data
exchange and feature implementation.
- Enhanced Code Editing: Enables a range of LSP features within the Monaco
editor, including syntax highlighting, code completion, diagnostics, and
navigation, to enhance the overall coding experience.
*Ungrammar Online Demonstration Playground*:
- Interactive Environment: Provides a web-based platform for users to explore
and experiment with the Ungrammar language features in a live coding
environment.
- Monaco Editor Integration: Leverages the *Monaco Editor* component to offer a
robust and customizable code editing experience.
- Language Feature Showcase: Demonstrates the capabilities of the *Ungrammar
Monaco*, including syntax highlighting, code completion,
diagnostics, and other essential features.
- User-Friendly Interface: Presents the language features and functionality in
an intuitive and accessible manner, making it easy for users to learn and
experiment.
- Code Examples: Provides code examples and tutorials to guide users in
effectively utilizing the Ungrammar language.
*Monaco Editor (external)*:
- Powerful Code Editor: A versatile and customizable code editor component that
provides a rich text editing experience within the web-based demonstration.
- Core Features: Offers essential text editing functionalities such as syntax
highlighting, code completion, code folding, and indentation.
- Customization Options: Allows for customization of themes, keybindings, and
other editor preferences to tailor the experience to individual needs.
- Performance Optimization: Designed for efficient performance, even when
handling large codebases.
=== Benefits of Modular Architecture
*Enhanced Maintainability*: The well-structured modular design facilitates
easier maintenance and updates by isolating changes to specific components.
*Increased Flexibility*: The modular design allows for greater customization
and integration with various platforms, ensuring adaptability to evolving
requirements.
*Improved Performance*: The separation of concerns between modules reduces
complexity and improves overall system performance, leading to a more
responsive and efficient user experience.
*Reusability*: The Language Service and Language Server modules can potentially
be reused in other projects, saving development time and effort.
*Reduced Coupling*: The separation of concerns minimizes dependencies between
modules, making it easier to isolate changes and prevent unintended side
effects.
|
|
https://github.com/deb06/typst-templates | https://raw.githubusercontent.com/deb06/typst-templates/main/mla.typ | typst | #let mla(
heading: [],
title: [],
lastname: [],
content: [],
citations: []
) = {
page(
margin: (x: 1in, y: 1in),
header: [
#set align(right)
#set text(font: "Times New Roman", size: 12pt)
#lastname #counter(page).display("1")
]
)[
#set par(leading: 2em)
#show par: set block(spacing: 2em)
#set align(left)
#heading
#set align(center)
#title
#set align(left)
#set par(first-line-indent: 0.5in)
#content
#set par(first-line-indent: 0in)
#set align(center)
Works Cited
#set align(left)
#citations
]
} |
|
https://github.com/7sDream/fonts-and-layout-zhCN | https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/06-features-2/substitution/i-matra.typ | typst | Other | #import "/lib/draw.typ": *
#import "/template/lang.typ": hind
// 本例需要使用 dev2 布局方法和 Hind 字体
#let start = (0, 0)
#let end = (600, 400)
#let without-pres = it => hind(text(features: ("pres": 0,), it))
#let graph = with-unit((ux, uy) => {
// mesh(start, end, (100, 100))
txt([未开启`pres`特性时:], (30, 370), anchor: "lt", size: 36 * ux)
txt(without-pres[हि + ख = हिख], (150, 280), anchor: "lt", size: 72 * ux)
txt([开启`pres`特性时:], (30, 170), anchor: "lt", size: 36 * ux)
txt(hind[हि + ख = हिख], (150, 80), anchor: "lt", size: 72 * ux)
})
#canvas(end, width: 70%, graph)
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/oktoich/Hlas2/5_Piatok.typ | typst | #let V = (
"HV": (
("", "Jehdá ot dréva", "Spáse, na kresťí prihvozdívsja, sólnce víďiv pomračísja ot strácha tvojehó, i zavísa cerkóvnaja razdrásja: zemľá že potrjasésja, i kámenije tákožde trépetom raspadóšasja, zríti ne terpjášče ziždíteľa svojehó i Bóha, na drévi stráždušča neprávedno vóleju, i ot bezzakónnik dosaždájema."),
("", "", "Vés nizložén býsť na zémľu, vés ujazvívsja, i ležít padénijem čúdnym zmíj vselukávyj, voznesénu bývšu tí na drévo čelovikoľúbče: Adám že ot kľátvy razrišájetsja, i spasájem byvájet, íže préžde osuždényj. Ťímže i mý mólimsja: spasí nás ščédryj vsích, i cárstvija tvojehó spodóbi."),
("", "", "Jehdá vozdvíhlsja na krest, i v rébra probodén býl jesí kopijém bezhríšne, sólnce sokryvášesja, zríti ne choťá Spáse, i zemľá kolebášesja, i kámenije stráchom tohdá raspadášesja, dosaždájemu tebí. Tvár že vopijáše vsjá: sláva raspjátiju tvojemú Slóve, ímže vsích spásl jesí čelovikoľúbče."),
("", "Jehdá ot dréva", "Na drévi krestňim ťá Iisúse, vozdvížena zrjášči neiskusobráčnaja, plákaše i hlahólaše: čádo sládkoje, vskúju ostávil jesí mené jedínu róždšuju ťá? Svíte nepristúpnyj prebeznačáľnaho Otcá, potščísja i proslávi, jáko da slávu polučát božéstvennuju, íže božéstvennyja strásti tvojá slávjaščiji."),
("", "", "Jehdá na drévi živót umirájušč zrjáše Ďíva, i rébra jehó kopijém boľíznenno probodájema, pláčušči vzyváše: Sýne i Bóže mój, čtó ti vozdadé sobór bezblahodátnyj? Uvý mňí, boľízni ne terpjá sňidájusja utróboju, víďašči sijá stráždušča ťá Vladýko!"),
("", "", "Jehdá ot dréva Sýna víde snémlema otrokovíca neiskusomúžnaja, prósta že položéna bez dychánija na zemlí jáko čelovíka, v ňídrich objémši, i oblobyzájušči ustňí že i óči, tomú vzyváše dívno: káko vsjá oživľájuščaho bezhlásna, ne dvížima nýňi zrjú ťa? Voístinnu čúdo vélije."),
("Krestobohoródičen", "Jehdá ot dréva", "Jehdá neskvérnaja áhnica víďi svojehó áhnca, na zakolénije jáko čelovíka vóleju vlekóma, pláčušči hlahólaše: bezčádstvovati mjá nýňi tščíšisja Christé, róždšuju ťá. Čtó sijé sotvoríl jesí, izbáviteľu vsjáčeskich? Obáče vospiváju i slávľu tvojú, júže páče umá i slóva, krájňuju bláhosť čelovikoľúbče."),
),
"S": (
("", "", "Spasí mja Christé Spáse síloju krestnoju, spasýj Petrá v móri, i pomíluj mjá Bóže."),
("", "", "Da ráspnetsja vopijáchu, íže tvojích darovánij prísno naslaždájuščijisja, i zloďíja vo blahoďíteľa místo prošáchu prijáti, íže právednikom ubíjcy: molčál že jesí Christé, terpjá ích surovstvó, postradáti choťá, i spastí nás jáko čelovikoľúbec."),
("Múčeničen", "", "Íže zemných naslaždénij ne vozľubívše strastotérpcy, nebésnych blahích spodóbišasja, i ánhelom sožítele býša: Hóspodi, molítvami ích pomíluj i spasí nás."),
("Krestobohoródičen", "Jehdá ot dréva", "Jehdá ťa bezzakónniji ľúdije Spáse, žízň vsích, na drévo voznesóša, tohdá čístaja i preneporóčnaja Máti tvojá predstojášči i rydájušči vzyváše: čádo mojé sládkoje, svíte mojíma očíma, uvý mňí, káko posreďí zloďíju na kresťí prihvozdítisja preterpíl jesí, íže zémľu povíšej na vodách?"),
),
)
#let P = (
"1": (
("", "", "Vo hlubiňí postlá inohdá, faraonítskoje vsevóinstvo preoružénnaja síla, voplóščšejesja že Slóvo vsezlóbnyj hrích potrebílo jésť, preproslávlennyj Hospóď, slávno bo proslávisja."),
("", "", "Jáko krásnuju, jáko predóbruju vsjú, jáko neporóčnuju v ženách, Bóh ťá izbrá, i vo utróbu tvojú vselísja neporóčnuju: jehóže molí vseneporóčnaja, poróka hrichóv izbáviti vsjá pojúščyja ťá."),
("", "", "Psalómski, čístaja, odesnúju jákože caríca, ot tvojejá utróby vozsijávšaho carjá predstá: jehóže molí vseneporóčnaja, da desnáho predstáteľa pokážet mjá v déň vozdajánija."),
("", "", "Presóchšeje jestestvó čelovíčeskoje bezmístnymi ďíly, róždšaja dóžď nebésnyj vsjá obnoví: ťímže moľúsja, duší mojejá brazdú izsóchšuju pokaží plodonósnu, Bohonevísto."),
("", "", "Umertvívšesja sádom rázuma, drévom že žízni čístaja, k žízni víčňij prizváni býchom, ot tebé Bohoródice, procvítšim páče smýsla, Christóm Bohom: jehóže so derznovénijem molí, spastísja dušám nášym."),
),
"3": (
("", "", "Procvilá jésť pustýňa, jáko krín, Hóspodi, jazýčeskaja neploďáščaja cérkov, prišéstvijem tvojím, v néjže utverdísja mojé sérdce."),
("", "", "Oblečésja v mjá čelovíka, ot čréva tvojehó prošéd, tvoréc prečístaja, netľínija odéždu dáruja obnážšemusja mnóhimi zloďíjstvy."),
("", "", "Prečestnóje rodilá jesí Bóha Slóvo Vladýčice: jehóže priľížno molí, uščédriti smirénnuju mojú dúšu, sládostnymi bezčéstiji sítujuščuju."),
("", "", "Jázvy iscilí duší mojejá prečístaja, i smirénnoje sérdce mojé, ohorčénnoje jádom zmiínym, ďíjstvennoju tvojéju ľičbóju uvračúj."),
("", "", "Jáko Máti imúšči derznovénije, Vladýčice, k Sýnu tvojemú, prosí pómošč ozlóblennym ľúdem, bezzakónnych že nizloží šatánije."),
),
"4": (
("", "", "Prišél jesí ot Ďívy, ne chodátaj, ni ánhel, no sám Hóspodi voplóščsja, i spásl jesí vsehó mja čelovíka. Ťím zovú ti: sláva síľi tvojéj Hóspodi."),
("", "", "Kápľu mí umilénija odoždí Vladýčice, otjémľušči vés sérdca mojehó vár, i pečáľ mojú, i pákostnyja prilóhi othoňájušči."),
("", "", "Orúžijem mjá slástnym ujázvlena, i ležášča v ránach, prečístaja ne prézri, no iscilí kopijém i króviju raspénšahosja Sýna tvojehó, i Bóha nášeho."),
("", "", "Obohaščénnaja Vladýčnim vsjákim zdánijem, ľúťi mjá obniščávša, blahodáti božéstvennyja spodóbi: jáko da veličáju ťá, jáko blahúju mojú zastúpnicu, vseneporóčnaja."),
("", "", "Vozsijá iz utróby tvojejá, otrokovíce neiskusobráčnaja, Ótčaja zarjá Christós. I prosvití vselénnuju raspinájem, i bisóvskuju ťmú potrebí."),
),
"5": (
("", "", "Chodátaj Bóhu i čelovíkom býl jesí Christé Bóže: tobóju bo Vladýko, k svitonačáľniku Otcú tvojemú, ot nóšči nevíďinija, privedénije ímamy."),
("", "", "Púť žízni róždšaja prečístaja, nastávi mjá nýňi na púť právyj, v bezpútije i v bréh ľútych padénij bezslovésno nizrinovénnaho."),
("", "", "Ustránsja bez umá ot rázuma Bóžija, blúdno požích, vo straňí dáľňij strastéj zabludív: no vozvráščši Ďívo čístaja, spasí tvojím uťišénijem."),
("", "", "Vodámi tvojími živótnymi napój rabá tvojehó, plámenem razžihájemaho hrichóvnym, i opaľájemaho prilóhi bisóvskimi, Ďívo Máti prečístaja."),
("", "", "Sé vo črévi Bohoródice prečístaja, Christá Bóha páče slóva imíla jesí, jákože Isáia provozhlasí, i páče jestestvá sehó Bohorodíteľnice, rodilá jesí."),
),
"6": (
("", "", "V bézdňi hrichóvňij vaľájasja, neizsľídnuju milosérdija tvojehó prizyváju bézdnu: ot tlí Bóže mjá vozvedí."),
("", "", "Ne javí mené bisóm v rádosť na sudíšči búduščem, Vladýčice: no bláhopremínno vozzrívši na mjá, sudijú i Sýna tvojehó umolí."),
("", "", "Pómysly prohňívav ťá Hóspodi, i lukávymi i nečístymi mojími ďijáňmi, v molítvu privoždú ti Máter tvojú, uščédriv spasí mja."),
("", "", "Osuždénija izbávi mjá Vladýčice, samoosuždéna súšča prehrišéňmi, jáko sudijú róždšaja, i Bóha vsjáčeskich prepítaja."),
("", "", "Iisúsa Spása molí, jehóže páče jestestvá plótiju rodilá jesí, Ďívo Máti prečístaja, izbávitisja ot bíd rabóm tvojím."),
),
"S": (
("", "Milosérdija súšči", "Ďíva i Máti tvojá Christé, na drévi zrjášči ťá mértva prostérta pláčušči hórko hlahólaše: Sýne mój, čtó stránnoje sijé táinstvo, vsím dárujaj žízň víčnuju, vóleju na kresťí káko umiráješi smértiju ponósnoju?"),
),
"7": (
("", "", "Bohoprotívnoje veľínije bezzakónnujuščaho mučíteľa vysók plámeň voznesló jésť: Christós že prostré Bohočestívym otrokóm rósu duchóvnuju, sýj blahoslovén, i preproslávlen."),
("", "", "Kriposť mojá i pínije, i spasénije, i tvérdoje zastuplénije, i sťiná nepobidíma súšči Vladýčice, borjúščyja mjá bísy pobidí, prísno íščuščyja umertvíti mjá."),
("", "", "Bóha voplóščši ďivíčeskimi tvojími krovmí, obožíla jesí Ďívo, čelovíčestvo: ťímže moľúsja tí strasťmí oskvernénnaho mjá, i rastľínnaho vrážijimi kovárstvy izbávi molítvami tvojími."),
("", "", "Péšč proobrazováše roždestvó tvojé vseneporóčnaja, ótroki bo ne opalí, jákože ni ložesná tvojá óhň nepostojánnyj: ťímže mólim ťá, izbávi rabý tvojá ohňá víčnaho."),
("", "", "Prečístoje začátije, i netľínnoje roždestvó, tý jedína javíla jesí, Ďívoju prebývši: Christá bo začénši, čístaja, nad vsími Bóha, čelovíka bývša, vírnym na spasénije i izbavlénije."),
),
"8": (
("", "", "Péšč inohdá óhnennaja vo Vavilóňi ďíjstva razďiľáše, Bóžijim veľínijem chaldéi opaľájuščaja, vírnyja že orošájuščaja, pojúščyja: blahoslovíte vsjá ďilá Hospódňa Hóspoda."),
("", "", "Revnúj dóbrym, zlých udáľšisja, popečénijem božéstvennych ďijánij, dušé mojá, moľáščujusja o tebí Bohorodíteľnicu, i vsích nepostýdnuju imúšči zastúpnicu, jáko mílostivu i blahoľubívu."),
("", "", "Razrišíla jesí soúz čelovíčeskij drévňaho osuždénija: ťímže moľú ťa Bohorodíteľnice, razriší vsják soúz zlóbnyj sérdca mojehó, svjazávši mjá prečístaja, božéstvennoju ľubóviju ziždíteľa."),
("", "", "Slávy Ótčuju zarjú róždši Bohoródice, bezslávijem prehrišénij sítujuščeje sérdce mojé ujasní i slávy prisnosúščnyja pokaží mja pričástnika. Jáko da víroju slávľu ťá."),
("", "", "Javísja nám iz tebé Bohorodíteľnice, právdy ístinnoje sólnce, prosviščája vsjáčeskaja lučámi Božestvá, voplóščsja výšnij, jehóže pisnoslóvim."),
),
"9": (
("", "", "Beznačáľna rodíteľa Sýn, Bóh i Hospóď, voplóščsja ot Ďívy nám javísja, omračénnaja prosvitíti, sobráti rastočénnaja: ťím vsepítuju Bohoródicu veličájem."),
("", "", "Vkusív Adám sňíď primísnuju smérti, ot dréva hóresť obját: na drévi že prihvóžďsja Sýn tvój prečístaja, sládosť bezsmértija istočí: sehó rádi ťá voschvaľájem:"),
("", "", "Caríca jesí carjá Christá i Hóspoda páče slóva róždši, razóršaho ádova cárstva: jehóže priľížno molí otrokovíce, výšňaho cárstvija spodóbiti vsjá čtúščyja ťá."),
("", "", "Ublaží Vladýčice, smirénnoje sérdce mojé, ozlóblenoje slastnými zatvóry, jáko blaháho rodíteľnica, i blahája súšči vsjá: i k pokajániju mjá blahích dveréj vvedí."),
("", "", "Mértv býv na krest voznosím, sím umorívyj zmíja. Ťímže zovú ti: umerščvlénnuju dúšu mojú lukávymi ďíly, pomíluj Slóve, i oživí molítvami róždšija ťá."),
),
)
#let U = (
"S1": (
("", "", "Spasénije soďílal jesí posreďí zemlí <NAME>, na kresťí prečísťiji rúci tvojí prostérl jesí, sobirája vsjá jazýki zovúščyja: Hóspodi sláva tebí."),
("", "", "Ímže óbrazom pľiníl jésť vráh Adáma drévom sňídnym: tákožde sám Hóspodi pľiníl jesí tý vrahá drévom krestnym, i strástiju tvojéju. Na sé bo priíde vtorýj Adám, vzyskáti zablúždšaho, i oživíti uméršaho: Bóže, sláva tebí."),
("Krestobohoródičen", "", "Ďíva i Máti tvojá Christé, na drévi zrjášči ťá mértva prostérta, pláčušči hórko hlahólaše: Sýne mój, čtó stránnoje sijé táinstvo? Íže vsím dárujaj živót víčnyj, vóleju na kresťí káko umiráješi smértiju ponósnoju?"),
),
"S2": (
("", "", "Životvorjáščij krest tvojejá bláhosti, jehóže darovál jesí nám nedostójnym, Hóspodi, tebí prinósim v molítvu: spasí hrád tvój, mír dáruja Bohoródicy rádi, jedíne čelovikoľúbče."),
("", "", "Prečístomu óbrazu tvojemú poklaňájemsja blahíj, prosjášče proščénija prehrišénij nášich Christé Bóže: vóleju bo bláhovolíl jesí plótiju vzýti na krest, da izbáviši jáže sozdál jesí ot rabóty vrážija. Ťím blahodárstvenno vopijém tí: rádosti ispólnil jesí vsjá Spáse náš, prišédyj spastí mír."),
("Múčeničen", "", "Tebé oďivájuščaho nébo óblaki, imúšče svjatíji oďijánije v míri, múki ot bezzakónnych preterpíša, i prélesť ídoľskuju uprazdníša. Ťích molítvami i nás svobodí ot nevídimaho vrahá, Spáse, i spasí nás."),
("Krestobohoródičen", "", "Predstojášči u krestá tvojehó, jáže bez símene róždšaja ťá Christé, i ne terpjášči zríti neprávedne stráždušča, rydáše s pláčem, i vopijáše tí: káko stráždeši, íže jestestvóm bezstrásten, sladčájšij Sýne? Pojú tvojú krájňuju bláhosť."),
),
"S3": (
("", "", "Jáko razbójnik ispovíduju, i vopijú ti blahómu: pomjaní mja Hóspodi, vo cárstviji tvojém: i s ním mjá sopričtí, íže vóleju strásti nás rádi preterpívyj."),
("", "", "Prosvitívyj zemnája krestóm tvojím, i prizvávyj na pokajánije hríšnyja, ne otlučí mené stáda tvojehó, pástyrju dóbryj: no vzyščí mené zablúždšaho Vladýko, i svjatómu tvojemú stádu sopričtí jedíne mílostive i čelovikoľúbče."),
("Krestobohoródičen", "", "Čéstným krestóm Sýna tvojehó sochraňájemi Vladýčice, čístaja Bohoródice, vsják prilóh boríteľa vsí udóbňi pobiždájem: sehó rádi po dólhu ťá ublažájem, jáko Bóžiju Máter, i jedínu upovánije dušám nášym."),
),
"K": (
"P1": (
"1": (
("", "", "Netrénu, neobýčnu, nemókrenno morskúju šéstvovav stezjú, izbránnyj vopijáše Izráiľ: Hóspodevi poím, jáko proslávisja."),
("", "", "Raspjátije prijím, i hvozďmí prihvoždén býv bezčéstno, Slóve, vsjá čelovíki počtíti choťáj, íže tvojá vóľnaja stradánija slávjaščyja."),
("", "", "Prostérl jesí na kresťí dláni Spáse, íže prostrýj nébo jáko kóžu, ímiže obját jazýki i ľúdi, íže tvojá vóľnyja strásti slávjaščyja."),
("Múčeničen", "", "Vzémše krest na rámo strastotérpcy, raspénšemusja posľídovaša Christú tépľi, tohó soobrazújuščesja božéstvennym strastém."),
("Múčeničen", "", "Vospíša ánheľskija síly, víďivše váša stradánija, vosplákasja že bisóv mnóžestvo, pobidonóscy múčenicy Bohozríteľňijšiji."),
("Bohoródičen", "", "Slóvo čestnáho proróka ispólnisja: orúžije bo sérdce tvojé prójde, Vladýčice, jehdá na kresťí prihvoždéna víďila jesí tvojehó Sýna."),
),
"2": (
("", "", "Hrjadíte ľúdije, pojím písň Christú Bóhu, razďíľšemu móre, i nastávľšemu ľúdi, jáže izvedé iz rabóty jehípetskija: jáko proslávisja."),
("", "", "Jáže istóčnik bezstrástija róždšaja, ujázvlenaho mjá strasťmí otrokovíce iscilí, i ohňá víčnaho ischití, jedína Bohorádovannaja."),
("", "", "Ťilésnych nedúh izbávi mjá, i duší mojejá iscilí bezmístnyja strásti: i ohňá víčnaho ischití mja, jedína Bohoblahodátnaja."),
("", "", "Pod tvojú nýňi pribiháju bláhosť, Ďívo Máti prečístaja, izbávi rabá tvojehó dušévnych boľíznej, i strastéj dušetľínnych, i víčnaho ohňá."),
("", "", "Tý Vladýčice mojé téploje očistílišče, k tebí priríšču i spasájusja, i priobritáju dušévnoje spasénije: móžeši bo vsích spastí, jáko Máti súšči Bóha."),
),
),
"P3": (
"1": (
("", "", "Na kámeni mjá víry utverdív, razširíl jesí ustá mojá na vrahí mojá. Vozveselí bo sja dúch mój vnehdá píti: ňísť svját, jákože Bóh náš, i ňísť práveden páče tebé Hóspodi."),
("", "", "Hrózd netľínnyj na drévi vísjašč, iskápa božéstvennuju sládosť, serdcá veseľáščuju čelovíkov: zlóby že pohubľájuščuju pijánstvo blahodátiju , Iisús izbáviteľ dúš nášich."),
("", "", "Voznéslsja jesí na drévo vóleju Iisúse, i vsé dijávole zloďijánije svérhl jesí: pádšyja že čelovíki v páhubu umóm razvraščénnym, voznésl jesí mnohomílostive."),
("Múčeničen", "", "Ohném božéstvennyja ľubvé raspáľšesja, ohňá ne ustrašíšasja dóbliji, i ne užasóšasja smérti, bezsmértnyja dáry naďíjuščesja vosprijáti, i rádosť bezkonéčnuju, i svít nezachodímyj."),
("Múčeničen", "", "Ot krovéj svojích strastotérpcy, presvítluju očervleníša bahrjanícu, i tóju oďíjavšesja, desnóju že rukóju jáko skíptr nosjášče božéstvennyj krest, s Hóspodem vsehdá cárstvujut."),
("Bohoródičen", "", "Čtút ťá čínove bezplótnych, vsích bo Vladýku plotonósca rodilá jesí, razrišívšaho drévom svjázannyja vsjá, otrokovíce Bohonevísto, i vírnyja privjazávšaho k ľubví svojéj."),
),
"2": (
("", "", "Na kámeni mjá víry utverdív, razširíl jesí ustá mojá na vrahí mojá. Vozveselí bo sja dúch mój vnehdá píti: ňísť svját, jákože Bóh náš, i ňísť práveden páče tebé Hóspodi."),
("", "", "Rodilá jesí beznačáľnaho carjá, iz tebé Ďívo Máti plóť prijémša: tohó úbo jáko čelovikoľúbca molí, spastí rabá tvojehó ot vsjákija skórbi, i búduščaho osuždénija."),
("", "", "Razorí nedoumínije sérdca mojehó, jázvy iscilí, i hnojénija otžení božéstvennoju tvojéju síloju: i umilénija strujú podážď mí, jáže istóčnik róždši prisnoživótnyj."),
("", "", "Boľívšuju dúšu mojú bisóvskimi napásťmi i unýnijem, Bohorodíteľnice iscilí: i slézy pokajánija dážď sérdcu mojemú, i Vladýki mojehó strách vsadí v ném prečístaja."),
("", "", "Ľínostiju žízň mojú iždív, i strasťmí sérdce mojé oskvernív, prichoždú k tebí Vladýčice umilénijem duší, i moľúsja: uščédri i spasí mja, pokajánija mjá óbrazy utverždájušči."),
),
),
"P4": (
"1": (
("", "", "Prišél jesí ot Ďívy, ne chodátaj, ni ánhel, no sám Hóspodi voplóščsja, i spásl jesí vsehó mja čelovíka. Ťím zovú ti: sláva síľi tvojéj Hóspodi."),
("", "", "Povíšen býl jesí na drévi, povíšej zémľu na vodách vsesíľne: i kopijém v rébra probodájem, króv že s vodóju iskápal jesí na izbavlénije vsích."),
("", "", "Probodénym tvojím rébrom, isciľí bolézň mojá: rukóju po laníťi bijénu tí svobódu ulučích: žélči že vkušénijem, slastnáho izbávichomsja Christé brášna."),
("Múčeničen", "", "Strupmí ostrúpľše zmíja ľstívaho, isciľájete strúpy serdéc nášich, vsehdá blahodáť istočájušče ot istóčnik Spásovych, božéstvenniji múčenicy."),
("Múčeničen", "", "Vseťilésnuju jázvu vrahú naneslí jesté vsečestníji, jázvami okrovavľájemi, na kresťí že proťazájemi, i odirájemi, Bohozráčniji strastotérpcy."),
("Bohoródičen", "", "Voplotísja iz prečístych krovéj tvojích Výšnij: jehóže víďašči na drévi prečístaja, bez právdy vozdvizájema, steňáše slezjášči, i tohó blahoutróbije veličála jesí."),
),
"2": (
("", "", "Pojú ťa, slúchom bo Hóspodi uslýšach, i užasóchsja: do mené bo ídeši, mené iščjá zablúždšaho. Ťím mnóhoje tvojé snizchoždénije, jéže na mjá, proslavľáju mnohomílostive."),
("", "", "Pojú ťa voístinnu vsepítaja, prepítaho Bóha Slóvo páče jestestvá róždšuju: i moľúsja, smirénnyja duší mojejá boľízni iscilí, i ot ľútaho mjá izbávi osuždénija."),
("", "", "Obýčno na ný bohátyja tvojejá mílosti Ďívo orošáj, nedúhi ustavľájušči, strásti razrušájušči razlíčnyja duší: ťímže razriší sérdca mojehó plenícy hrichóvnyja, i boľíznej mnóhich."),
("", "", "Oskverních dúšu mojú strasťmí: čísťíjšeje tý bývši prečístomu žilíšče, očísti Bohorodíteľnice, k svítu pokajánija nastavľájušči mjá, i ohňá búduščaho izymájušči."),
("", "", "Úm mój prečístaja Vladýčice prosvití, moľúsja tebí. Vólny utiší strástnaho sérdca mojehó, plotskája choťínija potrebľájušči, i ko pristánišču božéstvennomu privoďášči:"),
),
),
"P5": (
"1": (
("", "", "Úhľ Isáiji projavléjsja, sólnce iz ďívstvennyja utróby vozsijá, vo ťmí zablúždšym, Bohorazúmija prosviščénije dáruja."),
("", "", "Za milosérdije priobščívsja krestú Vladýko, iz hlubiný mja zlých istórhl jesí, i počtíl jesí sosiďínijem Ótčim, obezčéstvovannyj vóleju."),
("", "", "Térnijem vinčávsja, íže vinčavájaj cvíty vsjú zémľu, strastéj mojích térnije iz kórene sičéši Slóve, i nasaždáješi vo mňí tvój rázum."),
("Múčeničen", "", "Krípostiju nemožénija vášeho, svjatíji múčenicy vóleju oblóžšesja, i ukrípľšesja, bisóv kríposť otňúd pohubíste."),
("Múčeničen", "", "Veľmí podvíhšesja svjatíji na zemlí, na nebesích véliju slávu obritóste, i velíkich bíd izbavľájete nás, vás čtúščich."),
("Bohoródičen", "", "Íže na pleščú cheruvímsku, na nebesích Bohoľípno nosímyj, jáko voístinnu prečístaja, na rukú tvojéju sídyj, ráspjat býv, vsích iz tlí izbávi."),
),
"2": (
("", "", "Prosviščénije vo ťmí ležáščich, spasénije otčájannych Christé Spáse mój, k tebí útreňuju carjú míra, prosvití mja sijánijem tvojím: inóho bo rázvi tebé Bóha ne znáju."),
("", "", "Navíty i lovléňmi ľstívaho, umerščvlénaho oživí mja vseneporóčnaja Vladýčice Bohoródice, jáže róždši žízň vsích ipostásnuju: da ťá pojú blahočéstno vsepítuju."),
("", "", "Jáže áhnca i pástyrja, jávľšisja Ďívo Máti, upasí mja nrávom zabluždénnaho, i desným mjá sočetátisja ovcám, v déň súdnyj spodóbi: jáko da tvojú blahodáť pojú spasíteľnuju."),
("", "", "Ot strastéj omračénija, ot soblázn pribyvájuščich napásťmi čuždáho, búduščich že múk víčnych sohrišájuščym, izbávi mjá otrokovíce tvojími moľbámi, moľúsja."),
("", "", "Nevísto Bóžija, v ňúže vselísja jedíno božéstvennoje Slóvo, vsjú prosviščájuščeje vselénnuju, vozsijáj mí zarjú ístinnaho pokajánija: ozarí mňí spasíteľnyja lučý, razorjájušči strastéj mojích ťmú tvojími moľbámi, moľúsja."),
),
),
"P6": (
"1": (
("", "", "Hlás hlahól molébnych ot boľíznennyja Vladýko, duší uslýšav, ot ľútych mjá izbávi: jedín bo jesí nášeho spasénija vinóven."),
("", "", "Pleščí vdáv na rány, i laníťi tvojí na udarénije, licé že Spáse na oplevánije, spásl mjá jesí mnóho tebí sohrišívšaho v rázumi i nevíďiniji."),
("", "", "Jákože áhnec, vo jéže zaklátisja, vedén býl jesí Christé Bóže mój: vólka mýslennaho jadovítym uhryzénijem uméršich páki vozvoďá k životú: sláva raspjátiju tvojemú."),
("Múčeničen", "", "Zakóny sobľudájušče múčenicy Vladýčnija, bezzakónen sovít zakonoprestúpnych otňúd ukloníša, i umérše, žízň búduščuju prijáša."),
("Múčeničen", "", "Opolčívšesja svjatíji rádujuščesja, k soprotívnym načálom božéstvennymi orúžiji sích pobidíste, i vincý pobídnyja prijáste ot Bóha."),
("Bohoródičen", "", "Da obožít čelovíka, iz tebé Ďívo raždájetsja Bóh, i raspinájetsja, i smérť vkušájet, ubivája krestóm mené drévle ubívšaho."),
),
"2": (
("", "", "V bézdňi hrichóvňij vaľájasja, neizsľídnuju milosérdija tvojehó prizyváju bézdnu: ot tlí Bóže mjá vozvedí."),
("", "", "Nýňi k tebí pribiháju prepítaja, spasí mja molítvami tvojími i sobľudí: jelíka bo chóščeši, i móžeši jáko Máti vsjá ukripľájuščaho."),
("", "", "Oburevájema búreju pečálej, i potopľájema nastojáňmi trevolnénija, spasí mja Bohoródice Ďívo rabá tvojehó."),
("", "", "Milosérdija tvojehó spodóbi mjá, nemilosérdijem i zlóboju oderžímaho, i tomlénij predležáščich i ohňá víčnaho ischití mja."),
("", "", "Hrichí míra vzémľuščaho, prečístaho áhnca začénši rodilá jesí vseneporóčnaja, hrichóv proščénije darováti mí, moľáščisja jemú ne prestáj."),
),
),
"P7": (
"1": (
("", "", "Bohoprotívnoje veľínije bezzakónnujuščaho mučíteľa, vysók plámeň voznesló jésť: Christós že prostré Bohočestívym otrokóm rósu duchóvnuju, sýj blahoslovén i preproslávlen."),
("", "", "Pádša mjá prestuplénijem vozdvíhl jesí, na krest vozdvížen íže vsích Voskresénije, i sovozdvižénije Slóve: i nizvérhl jesí svérhšaho boríteľa, vsehó bezďíľna mértva pokazál jesí. Sláva deržávi tvojéj."),
("", "", "Hvozďmí prihvozdíl jesí Christé hrichí práotca, tróstiju že bijém, napisál jesí svobódu vsím čelovíkom. Sláva stradániju tvojemú, ímže izbávichomsja ťmý strastéj."),
("Múčeničen", "", "Sikómi býša po ťilesém skvernoubíjstvennymi rukámi, dobropobídniji Christóvy velikomúčenicy, i prebyváchu dúchom ot Bóha nerazlučími, sikúšče múžestva mečém, i zakalájušče ľstívaho vrahá."),
("Múčeničen", "", "Kríposť nepoborímuju raspénšahosja Christá imíja, vóinstvo nepobidímoje, hubíteľnoje vóinstvo v konéc pohubí: postradáv že, vinéc pobídy priját, žízň blažénnuju i nehíblemuju."),
("Bohoródičen", "", "Paláta oduševlénnaja caréva, i prestól ohneobráznyj Ďívo pokazálasja jesí, na némže siďá, vozdvíže ot pérvaho padénija vsjá čelovíki, i sosidénijem otéčeskim počté."),
),
"2": (
("", "", "Bohoprotívnoje veľínije bezzakónnujuščaho mučíteľa, vysók plámeň voznesló jésť: Christós že prostré Bohočestívym otrokóm rósu duchóvnuju, sýj blahoslovén i preproslávlen."),
("", "", "Živót ipostásnyj nám róždši, smértiju smérť jávi pohúbľšij, strásti umertví sérdca mojehó, i istóčnik sléz podážď mí čístaja: jáko da prísno slávľu ťá."),
("", "", "Nadéžda nepostýdnaja, upovánije izvístnoje, i sťiná neoborímaja, pokróv že i pomóščnica búdi mňí vseneporóčnaja, upovájuščemu na ťá: i k svítu nastávi čístaja pokajánija i umilénija."),
("", "", "Izbávitisja rabú tvojemú vsjákija zlóby bisóvskija i pečáli, i osuždénija, i víčnaho ohňá, Sýna tvojehó umolí: jáko da víroju prísno slávľu ťá."),
("", "", "Prečístoje začátije, i netľínnoje roždestvó, tý jedína pokazála jesí, Ďíva prebývši: Christá bo začénši čístaja, nad vsími Bóha, čelovíka bývša, vírnym na spasénije i izbavlénije."),
),
),
"P8": (
"1": (
("", "", "O podóbiji zláťi nebréhše treblažénniji júnoši, neizmínnyj i živýj Bóžij óbraz víďivše, sredí ohňá vospiváchu osuščestvovánnaja da pojét Hóspoda vsjá tvár, i prevoznósit vo vsjá víki."),
("", "", "Ľúdije nepokoríviji, bez strácha že bezzakónnaja vsjá tvorjášče, posreďí bezzakónnoju ťá ščédre, opravdájušča bezzakónnyja, na drévi vozdvíhše raspjáša: tebé že vsjá tvár slávit, jáko Hóspoda i Vladýku, vospivájušči tvojé dolhoterpínije."),
("", "", "Okrovavíl jesí Christé pérsty tvojá na drévi prihvoždájem, íže prinosímuju bisóm króv drévle, na páhubu prinosjáščym jú, prestávil jesí: ťímže ťá slávit vsjá tvár, Bóže vsích, vospivájušči tvojé čelovikoľúbije."),
("Múčeničen", "", "Vód živótnych súšče ispólň múčenicy, potóki léstnyja izsušíša božéstvennymi strujámi krovéj, víroju neuklónnoju zovúšče: osuščestvovánnaja da pojét Hóspoda vsjá tvár, i prevoznósit jehó vo vsjá víki."),
("Múčeničen", "", "Neisčétnoje mnóžestvo krovéj vášich svjatíji, nečéstija óhň pohasí, i jéllinskuju mnohobóžnuju razruší prélesť, vsích že vírnych prosvití pojúščich: da pojét vsjá tvár Hóspoda, i prevoznósit jehó vo vsjá víki."),
("Bohoródičen", "", "Neporóčnaja áhnica, prorókov že i múčenikov ukrašénije, jákože áhnca ťá vozdvížena na drévo uzrívši, beznačáľnoje Slóvo, plákaše hórko, i hlahólaše: osuščestvovánnaja da pojét Hóspoda vsjá tvár, i prevoznósit jehó vo víki."),
),
"2": (
("", "", "V péšč óhnennuju ko otrokóm jevréjskim snizšédšaho, i plámeň v rósu prelóžšaho Bóha, pójte ďilá jáko Hóspoda, i prevoznosíte vo vsjá víki."),
("", "", "Pribížišče christijánom i pomóščnice, v ľútych oderžíma mjá, prečístaja Ďívo ne prézri, bidámi obchodímaho vsehdá, i mnóhimi ustremléniji lukávych bisóv."),
("", "", "Ne zabúdi hlása molítvennik tvojích, predstáteľnice strášnaja, no ot vsjákija boľízni, i ot vsjákaho preščénija moľbámi tvojími ischití: prekloňájet bo Bóha tvojá Máterňaja molítva."),
("", "", "Utolí strastéj mojích ľútuju nýňi búrju, čístaja blahoslovénnaja: i pobidí otrokovíce, neščádno na mojú niščetú napádajuščich, vsjá vrahí bezplótnyja, jáko da víroju pojú ťa."),
("", "", "Ot péšči iskušénij, ot plámene hrichóv i ohňá strastéj i hejénny, i bisóvskaho našéstvija, v čás skončánija ischití mjá jedína Bohorodíteľnice, predstáteľnice vírnych."),
),
),
"P9": (
"1": (
("", "", "Nedoumíjet vsják jazýk blahochvalíti po dostojániju, izumivájet že úm i premírnyj píti ťá Bohoródice, obáče blahája súšči, víru prijimí: íbo ľubóv vísi božéstvennuju nášu, tý bo christiján jesí predstáteľnica, ťá veličájem."),
("", "", "Da voobrazít drévle Isaák tvojú strásť, svjazújetsja Slóve: razrišájet že svjázannoje ovčá v tójže óbraz, v saďí Savékovi ostavlénija, i otpustísja nevóľnaja tohdá žértva voístinnu: tebí bo vóleju požéršusja, ot zól razrišíchomsja."),
("", "", "Krasén dobrótoju páče synóv čelovíčeskich, Christé sýj dobróty ne imýj, nižé vída, v strásti na drévi krestňim povíšen, ukrašája neľipótu vsehó róda čelovíča: sláva blahoutróbiju tvojemú, jedíne milosérde Hóspodi."),
("Múčeničen", "", "Sióna výšňaho javístesja žítelije božéstvenniji, i ánhelom ravnočéstniji múčenicy, jáko súščiji sohráždane: i cérkov svjatíji pervoródnych svítlo prosviščájete, sijájušče svítom božéstvennym, i mučénija vincý ukrašájemi."),
("Múčeničen", "", "Vozľúblenniji drúzi, vás preslávno vozľúbľšaho, izbávite mjá drúžby ľstívyja, jáže k plóti, svjatíji Hospódni múčenicy: osvjaščénije že i prosviščénije i razrišénije prehrišénij ľútych, vsím soveršájuščym pámjať vášu isprosíte."),
("Bohoródičen", "", "Svitíl dobróta tečénija obýčnaho ustupí, jehdá ťa víďiša sólnca právdy vozneséna na krest choťínijem: Ďíva že so učenikóm ďívstvennym vosklicáše s pláčem, uvý mňí, vopijúšči, čtó sijé stránnoje zrínije?"),
),
"2": (
("", "", "Beznačáľna rodíteľa Sýn, Bóh i Hospóď, voplóščsja ot Ďívy nám javísja, omračénnaja prosvitíti, sobráti rastočénnaja. Ťím vsepítuju Bohoródicu veličájem."),
("", "", "Čelovikoľúbca Hóspoda jedínaho mnohomílostivaho, páče umá že i slóva rodilá jesí: tohó molí Ďívo, v čás strášnyj sudá izbáviti rabá tvojehó ohňá víčnaho."),
("", "", "Nám pojúščym ťá, i víroju slávjaščym, i k božéstvennomu tvojemú pokróvu prísno pritekájuščym, podážď s nebesé razrišénije ľútych, i múčaščich strastéj, Bohonevísto, i múki i sudá izbávi."),
("", "", "Krasén vo viďíniji, vo vkušéniji že horčájšij, íže mené umorívyj hrichá plód, jehóže napitáchsja v sýtosť, strášnaho čáju sudá, ot nehóže mjá ischití presvjatája Ďívo Máti."),
("", "", "Ublaží prečístaja, smirénnoje sérdce mojé, ozlóblennoje slastnými zatvóry, jáko blahómu rodíteľnica, i blahá súšči vsjá: i k pokajániju mjá blahích dveréj vvedí."),
),
),
),
"ST": (
("", "", "Krestá tvojehó drévo, <NAME>, drévo živótnoje pokazál jesí nám vírujuščym v ťá, i sím uprazdnív deržávu imúščaho smérti, oživíl jesí nás umerščvlényja hrichóm. Ťímže vopijém tí blahodáteľu vsích Hóspodi, sláva tebí."),
("", "", "Vóleju obniščáv, obniščánija rádi Adámova, <NAME>, prišél jesí na zémľu ot Ďívy voplóščsja, i raspjátije priját, da nás svobodíši ot rabóty vrážija: Hóspodi sláva tebí."),
("Múčeničen", "", "Po Chrisťí postradávše dáže do smérti, o strastotérpcy múčenicy! Dúšy úbo ímate na nebesích v rucí Bóžiji, i po míru vsemú počitájemy súť váša móšči, svjaščénnicy poklaňájutsja, i ľúdije vsí, rádujuščesja, sohlásno vopijém: són čésten pred Hóspodem smérť prepodóbnych jehó."),
("Krestobohoródičen", "Jehdá ot dréva", "Jehdá neskvérnaja áhnica víďi svojehó áhnca, na zakolénije jáko čelovíka vóleju vlekóma, rydájušči hlahólaše: bezčádstvovati mjá nýňi tščíšisja Christé, róždšuju ťá. Čtó sijé sotvoríl jesí izbáviteľu vsích? Obáče vospiváju i slávľu tvojú krájňuju bláhosť páče umá i slóva, čelovikoľúbče."),
)
)
#let L = (
"B": (
("", "", "Hlás tí prinósim razbójnič, i mólimsja: pomjaní nás Hóspodi vo cárstviji tvojém."),
("", "", "Iskoreníl jesí Vladýko, zlóbnyj térn, vinéc ternóv vóleju nosív, dolhoterpilíve."),
("", "", "Ráspjat býv, bezhríšne, na lóbňim, sokrušíl jesí hlavú lukávaho, i vsjá čelovíki spásl jesí."),
("", "", "Sokrušájemi múčenicy, vrahá sokrušíli jesté vsjú sílu, i pobídnyja vincý prijáste."),
("", "", "Okroplénijem božéstvennyja króve vírniji prosviščájemi, jedíno v trijéch lícich Božestvó čtím."),
("", "", "Jáko áhnca povíšena na drévi, vseneporóčnaja víďašči Christá, rydájušči s pláčem, tohó veličáše."),
)
) |
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/let-21.typ | typst | Other | // Ref: false
// Destructuring with unnamed sink.
#let (a, ..) = (a: 1, b: 2)
#test(a, 1)
|
https://github.com/Scriptorgames/JIF-JUFO-Paper | https://raw.githubusercontent.com/Scriptorgames/JIF-JUFO-Paper/main/term.typ | typst | // Colorscheme
// https://www.schemecolor.com/macos-window-ui-colors.php
#let width = 300pt
#let inset_size = 10pt
#let radius_size = 10pt
#let button_size = 10pt
#let button_spacing = 10pt
#let button_red_color = rgb("FF605C")
#let button_orange_color = rgb("FFBD44")
#let button_green_color = rgb("00CA4E")
#let toolbar_bg_color = rgb("F5F5F5")
#let stroke_color = rgb("E1DFE1")
#let main_bg_color = rgb("FFFFFF")
#let font = "Roboto Mono"
#show raw: set text(font: font)
#let button(color: none) = {
return box(
width: button_size,
height: button_size,
radius: button_size,
fill: color,
)
}
#let toolbar() = {
return block(
width: 100%,
inset: inset_size,
radius: (top: radius_size),
fill: toolbar_bg_color,
stroke: stroke_color,
stack(
dir: ltr,
spacing: button_spacing,
button(color: button_red_color),
button(color: button_orange_color),
button(color: button_green_color),
),
)
}
#let main(ps1: [], input: [], output: []) = {
return block(
width: 100%,
inset: inset_size,
radius: (bottom: radius_size),
fill: main_bg_color,
stroke: stroke_color,
[
#ps1 #input \
#output
],
)
}
#let term(ps1: [], input: [], output: []) = {
return align(left, box(width: 300pt, stack(
dir: ttb,
align(left, toolbar()),
main(ps1: ps1, input: input, output: output),
)))
}
|
|
https://github.com/zurgl/typst-resume | https://raw.githubusercontent.com/zurgl/typst-resume/main/templates/resume/section.typ | typst | #import "../../metadata.typ": *
#import "../commun.typ": *
#import "@preview/fontawesome:0.1.0": *
/* resume section */
#let sectionTitleStyle(str, color: black) = { text(size: 16pt, weight: "bold", fill: color, str) }
#let cvSection(title, highlighted: true, letters: 3) = {
let highlightText = title.slice(0, letters)
let normalText = title.slice(letters)
v(beforeSectionSkip)
if highlighted {
sectionTitleStyle(highlightText, color: accentColor)
sectionTitleStyle(normalText, color: black)
} else {
sectionTitleStyle(title, color: black)
}
h(2pt)
box(width: 1fr, line(stroke: 0.9pt, length: 100%))
}
#let skillTypeStyle(str) = {
align(right, text(size: 10pt, weight: "bold", str))
}
#let skillInfoStyle(str) = { text(str) }
#let cvSkill(type: "Type", info: "Info") = {
table(
columns: (16%, 1fr),
inset: 0pt,
column-gutter: 10pt,
stroke: none,
skillTypeStyle(type),
skillInfoStyle(info),
)
v(-6pt)
}
|
|
https://github.com/SkytAsul/INSA-Typst-Template | https://raw.githubusercontent.com/SkytAsul/INSA-Typst-Template/main/packages/silky-report-insa/README.md | markdown | MIT License | # INSA - Typst Template
Typst Template for full documents and reports for the french engineering school INSA.
## Table of contents
1. [Examples & Usage](#examples)
1. [🧪 TP report](#🧪-tp-report)
1. [📚 Internship report](#📚-internship-report)
1. [🗒️ Blank templates](#🗒️-blank-templates)
1. [Fonts information](#fonts)
1. [Notes](#notes)
1. [License](#license)
1. [Changelog](#changelog)
## Examples & Usage
### 🧪 TP report
<p align="center">
<img alt="thumbnail" src="thumbnail-insa-report.png" style="width: 65%"/>
</p>
This is the default report for the `silky-report-insa` package. It uses the `insa-report` show rule.
It is primarily used for reports of Practical Works (Travaux Pratiques).
#### Example
```typst
#import "@preview/silky-report-insa:{{VERSION}}": *
#show: doc => insa-report(
id: 3,
pre-title: "STPI 2",
title: "Interférences et diffraction",
authors: [
*<NAME>*
*<NAME>*
Groupe D
Binôme 5
],
date: "11/04/2023",
insa: "rennes",
doc)
= Introduction
Le but de ce TP est d’interpréter les figures de diffraction observées avec différents objets diffractants
et d’en déduire les dimensions de ces objets.
= Partie théorique - Phénomène d'interférence
== Diffraction par une fente double
Lors du passage de la lumière par une fente double de largeur $a$ et de distance $b$ entre les centres
des fentes...
```
#### Parameters
| Parameter | Description | Type | Example |
|----------- |------------------------------- |-------------- |-------------------------------- |
| **id** | TP number | int | `1` |
| **pre-title** | Text written before the title | str | `"STPI 2"` |
| **title** | Title of the TP | str | `"Interférences et diffraction"` |
| **authors** | Authors | content | `[\*<NAME>\*]` |
| **date** | Date of the TP | datetime/str | `"11/04/2023"` |
| **insa** | INSA name (`rennes`, `hdf`...) | str | `"rennes"` |
| **lang** | Language | str | `"fr"` |
### 📚 Internship report
<p align="center">
<img alt="thumbnail" src="thumbnail-insa-stage.png" style="width: 90%"/>
</p>
If you want to make an internship report, you will need to use another show rule: `insa-stage`.
#### Example
```typst
#import "@preview/silky-report-insa:{{VERSION}}": *
#show: doc => insa-stage(
"<NAME>",
"INFO",
"2023-2024",
"Real-time virtual interaction with deformable structure",
"Sapienza University of Rome",
image("logo-example.png"),
"<NAME>",
"<NAME>",
[
Résumé du stage en français.
],
[
Summary of the internship in english.
],
insa: "rennes",
lang: "fr",
doc
)
= Introduction
Présentation de l'entreprise, tout ça tout ça.
#pagebreak()
= Travail réalisé
== Première partie
Blabla
== Seconde partie
Bleble
#pagebreak()
= Conclusion
Conclusion random
#pagebreak()
= Annexes
```
This template can also be used for a report that is written in english: in this case, add the `lang: "en"` parameter to the function call in the show rule.
#### Parameters
| **Parameter** | Required | Type | Description | Example |
|----------------- |---------- |--------- |-------------------------------------------------------- |----------------------------------------------------------- |
| **name** | yes | str | Name of the student | `"<NAME>"` |
| **department** | yes | str | Department of the student | `"INFO"` |
| **year** | yes | str | School year during the internship | `"2023-2024"` |
| **title** | yes | str | Title of the internship | `"Real-time virtual interaction with deformable structure"` |
| **company** | yes | str | Company | `Sapienza University of Rome` |
| **company-logo** | yes | content | Logo of the company | `image("logo-example.png")` |
| **company-tutor** | yes | str | Tutor in the company | `"<NAME>"` |
| **insa-tutor** | yes | str | Tutor at INSA | `"<NAME>"` |
| **insa-tutor-suffix** | no | str | Suffix at the end of "encadrant" in french | `"e"` |
| **summary-french** | yes | content | Summary in French | `[ Résumé du stage en français. ]` |
| **summary-english** | yes | content | Summary in English | `[ Summary of the internship in english. ]` |
| **student-suffix** | no | str | Suffix at the end of "ingénieur" in french | `"e"` |
| **thanks-page** | no | content | Special thanks page. | `[ Thanks to my *supervisor*, blah blah blah. ]` |
| **omit-outline** | no | bool | Whether to skip the outline page or not | `false` |
| **insa** | no | str | INSA name (`rennes`, `hdf`...) | `"rennes"` |
| **lang** | no | str | Language of the template. Some strings are translated. | `"fr"` |
### 🗒️ Blank templates
<p align="center">
<img alt="thumbnail" src="thumbnail-insa-document.png" style="width: 90%"/>
</p>
If you do not want the preformatted output with "TP x", the title and date in the header, etc. you can simply use the `insa-document` show rule and customize all by yourself.
#### Blank template types
The graphic charter provides 3 different document types, that are translated in this Typst template under those names:
- **`light`**, which does not have many color and can be printed easily. Has 3 spots to write on the cover: `cover-top-left`, `cover-middle-left` and `cover-bottom-right`.
- **`colored`**, which is beautiful but consumes a lot of ink to print. Only has 1 spot to write on the cover: `cover-top-left`.
- **`pfe`**, which is primarily used for internship reports. Has 4 spots to write on both the front and back covers: `cover-top-left`, `cover-middle-left`, `cover-bottom-right` and `back-cover`.
The document type must be the first argument of the `insa-document` function.
#### Example
```typst
#import "@preview/silky-report-insa:{{VERSION}}": *
#show: doc => insa-document(
"light",
cover-top-left: [*Document important*],
cover-middle-left: [
NOM Prénom
Département INFO
],
cover-bottom-right: "uwu",
page-header: "En-tête au pif",
doc
)
```
#### Parameters
| **Parameter** | Type | Description |
|-------------------- |---------- |---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **cover-type** | str | (**REQUIRED**) Type of cover. Available are: light, colored, pfe. |
| **cover-top-left** | content | |
| **cover-middle-left** | content | |
| **cover-bottom-right** | content | |
| **back-cover** | content | What to display on the back cover. |
| **page-header** | content | Header of the pages (except the front and back). If `none`, will display the INSA logo. If not empty, will display the passed content with an underline. |
| **page-footer** | content | Footer of the pages (except the front and back). The page counter will be displayed at the right of the footer, except if the page number is 0. |
| **include-back-cover** | bool | whether to add the back cover or not. |
| **insa** | str | INSA name (`rennes`, `hdf`...) | `"rennes"` |
| **lang** | str | Language of the template. Some strings are translated. |
| **metadata-title** | content | Title of the document that will be embedded in the PDF metadata. |
| **metadata-authors** | str list | Authors that will be embedded in the PDF metadata. |
| **metadata-date** | datetime | Date that will be set as the document creation date. If not specified, will be set to now. |
## Fonts
The graphic charter recommends the fonts **League Spartan** for headings and **Source Serif** for regular text. To have the best look, you should install those fonts.
> You can download the fonts from [here](https://github.com/SkytAsul/INSA-Typst-Template/tree/main/fonts).
To behave correctly on computers lacking those specific fonts, this template will automatically fallback to similar ones:
- **League Spartan** -> **Arial** (approved by INSA's graphic charter, by default in Windows) -> **Liberation Sans** (by default in most Linux)
- **Source Serif** -> **Source Serif 4** (downloadable for free) -> **Georgia** (approved by the graphic charter) -> **Linux Libertine** (default Typst font)
### Note on variable fonts
If you want to install those fonts on your computer, Typst might not recognize them if you install their _Variable_ versions. You should install the static versions (**League Spartan Bold** and most versions of **Source Serif**).
Keep an eye on [the issue in Typst bug tracker](https://github.com/typst/typst/issues/185) to see when variable fonts will be used!
## Notes
This template is being developed by <NAME> from the INSA de Rennes in [this repository](https://github.com/SkytAsul/INSA-Typst-Template).
For now it includes assets from the INSA de Rennes and INSA Hauts de France graphic charters, but users from other INSAs can open a pull request on the repository with the correct assets for their INSA.
If you have any other feature request, open an issue on the repository.
## License
The typst template is licensed under the [MIT license](https://github.com/SkytAsul/INSA-Typst-Template/blob/main/LICENSE). This does *not* apply to the image assets. Those image files are property of Groupe INSA and INSA Rennes.
## Changelog
### 0.4.0
- Added `insa-tutor-suffix` option to `insa-stage`
### 0.3.1
- Added `insa` option to all templates
- Added INSA HdF assets
- Added `student-suffix` option to `insa-stage`
- Made outline not shown in outline
### 0.3.0
- Added `omit-outline` option to `insa-stage`
- Added `thanks-page` parameter to `insa-stage`
- Added metadata-related options to `insa-document`
- Made some PDF metadata automatically exported for `insa-stage` and `insa-report`
- Made page number not displayed if equals to 0
- Adjusted positions of elements in back covers
- Fixed some translations
- Updated README to have changelog, visual examples of all documents and parameters table |
https://github.com/kdog3682/typkit | https://raw.githubusercontent.com/kdog3682/typkit/main/0.1.0/src/is.typ | typst |
#let is-string(x) = { type(x) == str }
#let test(s, r) = {
if is-string(s) {
return s.match(regex(r)) != none
}
return false
}
#let is-content(x) = { type(x) == content }
#let is-none(x) = { x == none }
#let is-color(x) = { type(x) == color }
#let is-array(x) = { type(x) == array }
#let is-nested-array(x) = { type(x) == "array" and type(x.at(0)) == array }
#let is-object(x) = { type(x) == dictionary }
#let is-integer(x) = { type(x) == int }
#let is-number(x) = { type(x) == int or type(x) == float }
#let is-length(x) = { type(x) == length }
#let is-str-number(x) = { test(x, "^\d+$") }
#let is-function(x) = { type(x) == function }
#let is-truthy(x) = { x == true or x == 1 }
#let is-falsy(x) = { x == false or x == 0 }
#let is-odd(x) = { calc.odd(x) }
#let is-even(x) = { calc.even(x) }
|
|
https://github.com/chubetho/Bachelor_Thesis | https://raw.githubusercontent.com/chubetho/Bachelor_Thesis/main/chapters/approaches.typ | typst | #import "@preview/glossarium:0.4.1": glspl
= Micro Frontend Implementation Approaches
Building on the Decision Framework outlined in the previous chapter, this section presents several commonly adopted approaches for implementing micro frontends. The effectiveness and challenges of these approaches often depend on the composition strategy they are paired with. As a result, general benefits and drawbacks will not be discussed here, except in cases where a specific approach has distinct characteristics.
The following approaches utilizing server-side and edge-side composition will be demonstrated within a horizontal-split strategy, while those employing client-side composition will be explored through a vertical-split strategy.
== Server-Side Includes
@ssi is a server-side scripting language often used in a server-side composition approach, where web pages are constructed on the server by fetching content from various micro frontends before delivering the final page to the user. @ssi accomplishes this by providing a set of specific directives within an @html file, which the server processes to execute commands such as setting variables, printing the current date and time, or including common elements from other files, like headers or footers, within the page @_IntroductionServerSide_. This capability makes @ssi particularly useful for maintaining consistency across multiple pages of a website.
However, @ssi's utility is generally limited to simpler tasks, as it lacks the flexibility and power required for more complex website architectures. While @ssi is effective at including static components across multiple pages, it is not designed to support dynamic interactions between components within a single page. Since page composition occurs on the server side, any communication between different micro frontends within the view must be routed through the server, typically using REST APIs or similar server-side communication methods. Consequently, @ssi is better suited for basic page assembly tasks rather than for scenarios that demand complex, interactive user interfaces or real-time communication between components.
#figure(caption: [An example of using Server Side Includes.])[
```html
<!-- http://header.mfe/index.html -->
<html>
<header>Header</header>
</html>
```
```html
<html>
<body>
<!--#include virtual="http://header.mfe/index.html" -->
<!--#include virtual="http://catalogue.mfe/index.html" -->
<!--#include virtual="http://footer.mfe/index.html -->
</body>
</html>
```
]
Additionally, several frameworks are specifically designed to implement micro frontend architectures in combination with server-side composition, such as OpenComponents #footnote[https://opencomponents.github.io/], OneApp from American Express #footnote[https://github.com/americanexpress/one-app], Mosaic from Zalando #footnote[https://www.mosaic9.org/], and Podium #footnote[https://podium-lib.io/]. These frameworks offer more robust solutions for developing modular, scalable frontend applications.
== Edge-Side Includes
The primary purpose of @esi, a markup language, is to enable edge-side composition, which allows web pages to be constructed from fragments directly at the edge of the network. The key difference between @esi and @ssi lies in where the page assembly occurs: @esi operates at the network edge, typically within a @cdn, whereas @ssi performs this function on the server-side @_ESIDocument_2004.
However, @esi implementations can vary significantly across different #glspl("cdn") and may not be supported by all. In cases where @esi is unsupported, tools like nginx or Varnish can be employed to mimic @esi's functionality by providing similar edge-side processing capabilities. These tools can intercept requests and dynamically assemble content at the edge. Furthermore, @esi shares some of the same disadvantages as @ssi, such as being more suitable for simple static websites and offering limited communication capabilities between components.
#figure(caption: [An example of using Edge Side Includes.])[
```html
<!-- http://cdn.mfe/header.html -->
<html>
<header>Header</header>
</html>
```
```html
<html>
<body>
<esi:include src="http://cdn.mfe/header.html" />
<esi:include src="http://cdn.mfe/catalogue.html" />
<esi:include src="http://cdn.mfe/footer.html" />
</body>
</html>
```
]
== iframe
An iframe is an inline frame embedded within a webpage that allows the loading of a separate HTML document from different sources. It offers one of the highest levels of isolation within a browser, as it maintains its own context and resources independently from the parent document @_InlineFrameElement_2024. Because of this strong isolation, communication between iframes often relies on the `postMessage` method @_WindowPostMessageMethod_2024. Additionally, iframes are advantageous due to their ease of implementation, making them a common and intuitive choice when considering micro frontend architectures.
Despite the strong isolation benefits provided by iframes, their performance is often criticized by the community for being suboptimal and CPU-intensive, particularly on websites that use multiple iframes. This performance issue, combined with the difficulty of making iframes easily indexable by search engine crawlers, limits their suitability primarily to desktop or intranet applications, as demonstrated by Spotify's use of iframes in their desktop apps @engineering_BuildingFutureOur_2021. Additionally, accessibility concerns arise with iframes. While they can visually integrate seamlessly into a web application, they essentially represent separate small pages within a single view, which can pose significant challenges for accessibility tools like screen readers. These tools must navigate multiple documents, hierarchical information, and varying navigation states within a single page, complicating the user experience for individuals with disabilities.
This approach is a type of client-side composition. As explained in @section_decision_framework, this composition strategy starts with the browser downloading a shell application, which manages the loading and unloading of various micro frontends. As illustrated in the figure below, the shell application determines the appropriate @html file path based on the current URL and assigns it as the source of the iframe element.
#figure(caption: [An example of using iframe.])[
```html
<!-- http://home.mfe/index.html -->
<html>
<body>
<h1>Home</h1>
<!-- other elements -->
</body>
</html>
```
```html
<html>
<body>
<iframe src="" />
<script>
const routes = {
'/': 'http://home.mfe/index.html',
'/product': 'http://product.mfe/index.html',
}
const src = routes[window.location.pathname]
const iframe = document.querySelector('iframe')
iframe.src = src
</script>
</body>
</html>
```
]<figure_approach_iframe>
== Web Components
Web components are a collection of web platform APIs that enable developers to create reusable and encapsulated custom elements. These components are based on three key specifications: Custom Elements, Shadow DOM, and HTML Templates @_WebComponentsWeb_2024.
- Custom Elements: This set of JavaScript APIs allows developers to define their own HTML elements with custom behaviors. Once defined, these elements can be used just like standard HTML tags.
- Shadow DOM: Another set of JavaScript APIs provides encapsulation by creating a hidden context, a shadow DOM, that includes the internal structure, styles, and behavior of the component. This encapsulation ensures that the component is isolated from the rest of the main DOM, preventing style and script conflicts.
- HTML Templates: This feature allows developers to define reusable HTML fragments that are not rendered during the initial page load. These templates can be reused as needed throughout the application.
While web components provide substantial benefits, they also present certain challenges. The concept of web components has been around for some time, however, full support is only available in modern browsers. To maintain compatibility with older browsers, developers often need to rely on polyfills #footnote[https://remysharp.com/2010/10/08/what-is-a-polyfill]. Additionally, the use of custom elements and the shadow DOM within web components differs from traditional frontend development practices, which may introduce a learning curve for developers who are not yet familiar with these concepts.
Web components are primarily intended for client-side composition, where they are rendered and executed within the browser. However, they can also be integrated with server-side composition by having the server load other parts of the @html, while the web components are executed after the page has been loaded, allowing for a hybrid composition strategy.
At the time of writing this thesis, a framework called Lit #footnote[https://lit.dev/] had already experimentally achieved the ability to render web components on the server-side.
#figure(caption: [An example of using Web Components.])[
```js
// http://home.mfe/index.js
class HomeApp extends HTMLElement {
constructor(){
const shadowRoot = this.attachShadow({ mode: 'open' })
const heading = document.createElement('h1')
heading.textContent = 'Home'
shadowRoot.appendChild(heading)
}
}
customElements.define('home-app', HomeApp)
```
```html
<html>
<head>
<script src="http://home.mfe/index.js"></script>
<script src="http://product.mfe/index.js"></script>
</head>
<body>
<div id="root">
<home-app /> <!-- <h1>Home</h1> -->
</div>
<script>
const routes = {
'/': 'home-app',
'/product': 'product-app',
}
const root = document.getElementById('root')
const elementName = routes[window.location.pathname]
const element = document.createElement(elementName)
root.appendChild(element)
</script>
</body>
</html>
```
]
#pagebreak()
== Module Federation
Module Federation, introduced in Webpack5 #footnote[https://webpack.js.org/], is a feature of this popular JavaScript bundler that enables different parts of an application to be treated as separate modules. These modules can be shared and used by other parts of the application at runtime @_ModuleFederation_. There are two types of modules:
- Exposed Module: Also referred to as a remote application, this is a module that is made available for other applications to consume. It can change its behavior at runtime and is typically defined to provide resources such as a component library or utility functions to other parts of the application.
- Consuming Module: Known as the host application, this module can utilize exposed modules without needing to bundle them directly into its codebase. As a result, if the exposed module is updated, the consuming application automatically integrates the latest version.
Module Federation is an approach that can be seamlessly integrated with both vertical and horizontal splitting strategies, as well as with client-side or server-side composition. In a survey on micro frontends conducted in late 2023 @steyer_ConsequencesMicroFrontends_2023, Module Federation appeared as the most adopted approach, highlighting its effectiveness as a solution in modern web development.
Moreover, enabling code sharing across different parts of an application, significantly reduces duplication and decreases the overall size of the application bundle compared to iframe or Web Components. For instance, if multiple micro frontends rely on the same library, they can all access a single shared instance rather than bundling it separately in each module.
However, Module Federation introduces certain complexities, particularly in managing the versions of shared modules across different applications. This process can be complex and requires careful configuration, especially in environments with multiple modules or complex dependency structures. The challenge is further expanded when dealing with commonly used modules that are widely consumed by other parts of the application. These modules must be cautiously managed and monitored to avoid becoming a single point of failure, as any changes to them can have widespread effects across the entire application ecosystem.
#figure(caption: [An example of using Module Federation.])[
```vue
<!-- home/App.vue -->
<template>
<h1>Home</h1>
</template>
```
```ts
// home/webpack.config.js
export default defineConfig({
plugin: [
new ModuleFederationPlugin({
name: 'remote',
exposes: { './App': './src/App.vue' },
shared: ['vue'],
}),
]
})
```
```vue
<!-- host/src/App.vue -->
<script setup>
import App from 'remote/App'
</script>
<template>
<App /> <!-- <h1>Home</h1> -->
</template>
```
]
#pagebreak(weak: true) |
|
https://github.com/dssgabriel/master-thesis | https://raw.githubusercontent.com/dssgabriel/master-thesis/main/src/cea.typ | typst | Apache License 2.0 | = Host institution
== The CEA
As a significant actor in research, development and innovation, the French Atomic Energy and Alternative Energies Commission (CEA) operates in four fields:
- defense and security;
- low-carbon energies (nuclear and renewable);
- technological research for industry;
- fundamental research (material and life sciences).
Drawing on its recognized expertise, the CEA is involved in setting up collaborative projects with numerous academic and industrial partners.
The CEA is based in 9 centers throughout France. It is developing numerous partnerships with other research organizations, local authorities and universities. As such, the CEA is a stakeholder in the national alliances coordinating French research in the fields of energy (ANCRE), life sciences and health (AVIESAN), digital sciences and technologies (ALLISTENE), environmental sciences (AlIEnvi) and human and social sciences (ATHENA).
Recognized as an expert in its fields of competence, the CEA is fully integrated into the European research space and has a growing presence at the international level.
The CEA employs 19,925 technicians, engineers, researchers and staff with a budget of 5 billion euros (figures published at the end of 2018).
== The Department of Military Applications (DAM)
=== A division dedicated to deterrence
#h(1.8em)
CEA's Military Applications Division (DAM) designs, manufactures, maintains and dismantles the nuclear warheads used by France's airborne and naval nuclear forces.
The DAM is responsible for designing and producing reactors and nuclear cores for French Navy vessels, submarines and aircraft carriers. It supports the French Navy in the in-service monitoring and maintenance of its reactors.
The DAM is also responsible for the supply of strategic nuclear materials for deterrence purposes.
In a world undergoing profound upheaval, the DAM also contributes to national and international security through the technical support it provides to the authorities in the fight against nuclear proliferation, terrorism and disarmament.
Since the transfer of the Gramat center in 2010 from the Direction Générale de l'Armement (DGA) to the CEA, the DAM has been providing its expertise to the French Defense Ministry in the field of conventional armaments.
=== A division open to research
#h(1.8em)
The national and international sharing of knowledge (where possible), exposure to external scientific assessment, and integration into networks of expertise all guarantee scientific credibility.
Each year, DAM teams produce around 2,000 publications and scientific papers. The DAM's open approach also involves making its experimental resources available to the research community and enabling its teams to contribute to other research programs.
=== A division driving France's industrial policy
#h(1.8em)
The DAM essentially shares its activities with the French industry: over two-thirds of its budget is spent on purchases from the latter, with the remaining third divided between staff salaries (one-fifth) and taxes.
#linebreak()
DAM's industrial policy is unique in more ways than one:
- firstly, because the DAM retains overall prime contractor ship for the vast majority of the systems for which it is responsible: it thus ensures the right balance between the major defense industrial groups and the often innovative SMEs by contracting directly with the latter, thus enabling them to receive fair remuneration for their production;
- secondly, because an explicit distribution of work underpins the distribution of its budget: the DAM conducts research in its laboratories thanks to its high-level scientific and technological staff. Once a product has been defined, the DAM transfers the definition and the processes to the industrialists, who then develop and produce it.
#h(1.8em)
The DAM also aims to ensure that its centers participate in local economic life through their involvement in competitive clusters. Outside its own field of application, the DAM promotes its research by transferring technology to industry and registering numerous patents.
=== The format
#h(1.8em)
DAM comprises five centers with homogeneous missions, whose activities are divided between basic research, development and manufacturing:
- DAM Ile-de-France (DIF), at Bruyères-le-Châtel, carries out weapons physics, numerical simulation and nuclear counter-proliferation activities. DIF is also the center responsible for engineering at DAM. Finally, the INBS-Propulsion Nucléaire at the CEA/Cadarache center, in the Provence Alpes-Côte d'Azur region, is attached to the DIF center and houses the onshore testing facilities and part of the nuclear propulsion manufacturing;
- Cesta, in the Aquitaine region, is dedicated to weapons architecture and environmental testing. It is also home to the Megajoule Laser, a major simulation facility;
- Valduc, in Burgundy, is dedicated to nuclear materials and the Epure experimental facility of the Simulation program;
- Le Ripault, in the Centre region of France, dedicated to non-nuclear materials (chemical explosives, etc.);
- Gramat, (formerly DGA) in the Midi-Pyrénées region, conducts system vulnerability and weapons effectiveness activities on behalf of the French Defense Ministry.
== The DAM Île-de-France center
#h(1.8em)
CEA/DAM - Île de France (DIF) is one of DAM's operational divisions.
The DIF site employs around 2,000 CEA staff and welcomes around 600 employees from outside companies daily. It is located in Bruyères-le-Châtel, about 40 km south of Paris, in the Essonne department.
#linebreak()
DIF's missions include :
- the design and guarantee of nuclear weapons, thanks to the Simulation program. The challenge is to reproduce the different phases in the operation of a nuclear weapon and to compare these results with measurements from past nuclear firings and experimental results obtained on current facilities (radiographic machine, power lasers, particle accelerators);
- the effort against proliferation and terrorism, in particular by contributing to the Non-Proliferation Treaty safeguards program and by providing French technical expertise for the implementation of the Comprehensive Nuclear Test Ban Treaty (CTBT);
- scientific and technical expertise for the construction and dismantling of complex structures, as well as for environmental monitoring and earth sciences;
- alerting the authorities, an operational mission carried out 24 hours a day, 365 days a year, in the event of nuclear tests, earthquakes in France or abroad, and tsunamis in the Euro-Mediterranean zone. The DIF provides the authorities with related analyses and technical summaries.
Since 2003, the DAM Île-de-France center has been home to the CEA's scientific computing facilities, which bring together all the CEA's supercomputers:
- the EXA1 supercomputer for the CEA/DAM Simulation program, successor to TERA 1000, with 23.2 petaflops computing power, i.e., capable of performing 23.2 million billion floating-point operations per second.
- Computers at the Centre de Calcul pour la Recherche et la Technologie (CCRT), open to the research community and industry, for a total power of 8.8 petaflops.
- The 22 petaflops Joliot-Curie supercomputer, the second in a network of petaflops-class supercomputers for researchers in the European scientific community. This supercomputer is housed at the TGCC (Très Grand Centre de Calcul) and operated by CEA teams, thus contributing to France's participation in the PRACE (Partnership for Advanced Computing in Europe) project.
|
https://github.com/joshuabeny1999/unisg-thesis-template-typst | https://raw.githubusercontent.com/joshuabeny1999/unisg-thesis-template-typst/main/thesis.typ | typst | Other | #import "/layout/thesis_template.typ": *
#import "/metadata.typ": *
#set document(title: title, author: author)
#show: thesis.with(
language: language,
title: title,
subtitle: subtitle,
type: type,
professor: professor,
author: author,
matriculationNumber: matriculationNumber,
submissionDate: submissionDate,
abstract: include "/content/abstract.typ",
acknowledgement: include "/content/acknowledgement.typ",
directory_writing_aids: include "/content/directory_writing_aids.typ",
appendix: include "/content/appendix.typ",
)
#include "/content/01_content.typ"
#include "/content/02_content.typ" |
https://github.com/An-314/Note-of-Quantum_Mechanics | https://raw.githubusercontent.com/An-314/Note-of-Quantum_Mechanics/main/chap4.typ | typst | #import "@preview/physica:0.9.2": *
#import "@local/mytemplate:1.0.0": *
= ⼒学量算符与波函数
== 量子力学的基本公设
+ 公设1:微观体系的状态由波函数描述,波函数满足单值、有限、连续条件
+ 公设2:波函数的动力学演化满足薛定鄂方程
+ 公设3:力学量用*厄密算符*表示,且有组成*完备集的本征函数系*
+ 公设4:任一波函数可以展开为力学量算符本征函数的线性叠加,测得力学量为本征值$lambda_n$的几率(密度)为展开式中对应本征函数系数的模方$|c_n|^2$#footnote[意思是测量的只能是本征值,而且是又概率的]
== 力学量的算符表示
在量子力学中力学量有完全不同于经典力学的表示方法,这就是用算符表示:
$
"基本的力学量算符" <=> "数学上的函数变换、算子"
$
算符就是可以作用于波函数把它变成另一个函数的运算。
代表力学量$F$的算符是$hat(F)$。
量子力学中基本的力学量算符是:
- *动量算符*
$
hat(arrow(p)) = -i hbar nabla
$
$
hat(p)_x - i hbar (diff)/(diff x)
$
- *位置算符*
$
hat(arrow(r)) = arrow(r)
$
其它的力学量算符按下列规则来构成:若在经典力学中力学量$F$用坐标和动量表示出的关系式是
$
F = f(arrow(r), arrow(p))
$
则在量子力学中$F$的算符表示是
$
hat(F) = f(hat(arrow(r)), hat(arrow(p))) = f(arrow(r), -i hbar nabla)
$
$f$代表相同的关系函数。
总能量(动能加势能)在分析力学中称为Hamiltonian(哈密顿量),记为H。对于单粒子,
$
H = T + U = (arrow(p)^2)/(2m) + U(arrow(r))
$
对应的*Hamilton算符* :
$
hat(H) = hat(p)^2/(2m) + V(arrow(r)) = -hbar^2/(2m) nabla^2 + V(arrow(r))
$
轨道角动量的经典表达式是
$
arrow(L) = arrow(r) crossproduct arrow(p)
$
对应的$L$*角动量算符*是
$
hat(L) = hat(arrow(r)) crossproduct hat(arrow(p)) = - i hbar arrow(r) crossproduct nabla
$
更准确地说,上面所定义的算符应该称作是“坐标表象”中的算符。用算符来代替经典力学中的力学量,是把经典力学模型“量子化”的步骤的重要部分。
在量子力学中有一些量是没有经典力学的对应物的,比如宇称和自旋角动量。那时我们就要直接从量子力学的分析出发来引进它们的算符。
== 不同坐标系下的微分算符表示
=== 直角坐标系
在量子力学中,我们经常需要在不同坐标系下表示微分算符。
在直角坐标系下,微分(梯度)算符是#footnote[有$partial f = f' + f partial$]
$
nabla = (partial)/(partial x) arrow(i) + (partial)/(partial y) arrow(j) + (partial)/(partial z) arrow(k) = partial_x arrow(i) + partial_y arrow(j) + partial_z arrow(k)
$
Laplacian算符是
$
nabla^2 = partial^2/(partial x^2) + partial^2/(partial y^2) + partial^2/(partial z^2)
$
=== 柱坐标系
在柱坐标系下,微分算符是
$
nabla = (partial)/(partial r) arrow(r) + 1/r (partial)/(partial theta) arrow(theta) + (partial)/(partial z) arrow(z)
$
Laplacian算符是
$
nabla^2 &= partial^2/(partial r^2) + 1/r (partial)/(partial r) + 1/r^2 partial^2/(partial theta^2) + partial^2/(partial z^2)\
&= 1/r partial/(partial r) (r partial/(partial r)) + 1/r^2 partial^2/(partial theta^2) + partial^2/(partial z^2)
$
并且有Jacobi行列式
$
dd(x)dd(y)dd(z) = r dd(r) dd(theta) dd(z)
$
=== 球坐标系
在球坐标系下,微分算符是
$
nabla = (partial)/(partial r) arrow(r) + 1/r (partial)/(partial theta) arrow(theta) + 1/(r sin(theta)) (partial)/(partial phi) arrow(phi)
$
Laplacian算符是
$
nabla^2 &= partial^2/(partial r^2) + 1/r (partial)/(partial r) + 1/r^2 partial^2/(partial theta^2) + 1/(r^2 sin(theta)^2) partial^2/(partial phi^2)\
&= 1/r^2 partial/(partial r) (r^2 partial/(partial r)) + 1/(r^2 sin(theta)) partial/(partial theta) (sin(theta) partial/(partial theta)) + 1/(r^2 sin(theta)^2) partial^2/(partial phi^2)
$
并且有Jacobi行列式
$
dd(x)dd(y)dd(z) = r^2 sin(theta) dd(r) dd(theta) dd(phi)
$
*定义*
$
hat(arrow(Y)) = hat(r) crossproduct nabla
$
其在球坐标系的表示是
$
hat(arrow(Y)) = partial/(partial theta) arrow(phi) - 1/sin(theta) partial/(partial phi) arrow(theta)
$
且有
$
hat(Y)^2 &= partial^2/(partial theta^2) + 1/sin(theta) partial/(partial theta) + 1/(sin(theta)^2) partial^2/(partial phi^2)\
&= 1/sin(theta) partial/(partial theta) (sin(theta) partial/(partial theta)) + 1/(sin(theta)^2) partial^2/(partial phi^2)
$
于是有
$
nabla^2 = 1/r^2 (hat(Y)^2 + partial/(partial r)(r^2 partial/(partial r)))
$
*角动量算符:*
$
hat(arrow(L)) = hat(arrow(r)) crossproduct hat(arrow(p)) = -i hbar hat(Y)
$
$
hat(L)^2 = - hbar^2 hat(arrow(Y))^2
$
== 算符的一般性质和运算规则
量子力学中的算符,代表着对波函数(量子态)的一种运算(或操作)。
=== 线性算符
算符$hat(A)$是线性的,就是说对于任意两个波函数$psi_1$和$psi_2$和任意两个复数$a$和$b$,有
$
hat(A)(a psi_1 + b psi_2) = a hat(A) psi_1 + b hat(A) psi_2
$
例如:$hat(arrow(p)) = -i hbar nabla$是线性算符。
描述可观测量的算符都是线性算符,这是态叠加原理的体现。
=== 单位算符
单位算符$hat(I)$是一个恒等算符,对任意波函数$psi$有
$
hat(I) psi = psi
$
=== 算符的相等
若对于体系的任何波函数,都有
$
hat(A) psi = hat(B) psi
$
则称算符$hat(A)$和$hat(B)$相等,记作$hat(A) = hat(B)$。
=== 算符之和
若$hat(A)$和$hat(B)$是两个算符,定义它们的和为
$
(hat(A) + hat(B)) psi = hat(A) psi + hat(B) psi
$
例如:Hamilton算符$hat(H) = hat(T) + hat(U)$。
显然算符求和*满足交换率和结合率*:
$
hat(A) + hat(B) = hat(B) + hat(A)\
hat(A) + (hat(B) + hat(C)) = (hat(A) + hat(B)) + hat(C)
$
可以证明:两个线性算符之和仍为线性算符。
=== 算符的乘积
若$hat(A)$和$hat(B)$是两个算符,定义它们的乘积为
$
(hat(A) hat(B)) psi = hat(A) (hat(B) psi)
$
一般说来,算符之积不满足交换率:
$
hat(A) hat(B) != hat(B) hat(A)
$
或者说对易关系
$
[hat(A), hat(B)] = hat(A) hat(B) - hat(B) hat(A) != 0
$
这里$[hat(A), hat(B)]$称为算符$hat(A)$和$hat(B)$的*对易子*。
=== 算符的复共轭算符、转置算符
算符$hat(arrow(P))$的复共轭算符是
$
hat(arrow(P))^* = (- i hbar nabla)^* = i hbar nabla = - hat(arrow(P))
$
写成内积的形式:
$
(psi, hat(A) phi) = (hat(A)^* phi^*, psi^*)
$
#newpara()
算符$hat(A)$的转置算符$hat(A)^T$:
$
integral psi^* hat(A) phi dd(V) = integral phi hat(A)^T psi^* dd(V)
$
#newpara()
定义两个波函数的*内积*或标积为
$
(psi_1, psi_2) = integral psi_1^* psi_2 dd(tau)
$
有:
$
(psi_1, psi_2) = (psi_2^*, psi_1^*)
$
那么转置算符的定义又可写为
$
(psi, hat(A)^T phi) = (phi^*, hat(A) psi^*)
$
#newpara()
转置有性质:
$
(hat(A) hat(B))^T = hat(B)^T hat(A)^T\
(hat(A) + hat(B))^T = hat(A)^T + hat(B)^T
$
给出第一个性质的证明:
$
(psi, (hat(A) hat(B))^T phi) = (phi^*, hat(A) hat(B) psi^*) = (hat(B)^* psi, hat(A)^* phi) = (hat(A)^(T*) phi^*, hat(B)^T psi^*) = (phi, hat(B)^T hat(A)^T psi)
$
=== 算符的逆算符
若算符$hat(A)$满足
$
hat(A) psi = phi\
hat(A)^(-1) phi = psi
$
也就是说根据$phi$可以唯一确定$psi$,则称$hat(A)$是可逆的,$hat(A)^(-1)$称为$hat(A)$的逆算符。但不是所有的算符都有逆算符,如投影算符。
有性质:
$
hat(A) hat(A)^(-1) = hat(A)^(-1) hat(A) = hat(I)\
(hat(A)hat(B))^(-1) = hat(B)^(-1) hat(A)^(-1)\
((hat(A))^(-1))^(-1) = hat(A)
$
在散射微扰问题中,算符$E - hat(H)_0$的逆算符定义为$(E - hat(H)_0)^(-1)$,也就是与传播子相关的格林函数算符。
=== 算符的厄密共轭算符
算符$hat(A)$的厄密共轭算符$hat(A)^dagger$定义为
$
integral psi^* hat(A) phi dd(V) = integral (hat(A)^dagger psi)^* phi dd(V)
$
写成内积的形式:
$
(psi, hat(A) phi) = (hat(A)^dagger psi, phi)
$
#newpara()
有性质:
$
(hat(A))^dagger = hat(A)^(*T) = hat(A)^(T*)\
(hat(A) + hat(B))^dagger = hat(A)^dagger + hat(B)^dagger\
(hat(A) hat(B))^dagger = hat(B)^dagger hat(A)^dagger
$
#newpara()
算符$hat(A)$为*厄密算符*的条件:
$
hat(A)^dagger = hat(A)
$
== 厄密算符的本征值和本征函数
可以定义*厄密算符*
$
integral psi^* hat(F) psi dd(V) = integral (hat(F) psi)^* psi dd(V)
$
=== 厄密算符的本征值
*Hermitian算符的本征值都是实数*
$
hat(F) psi_lambda &= lambda psi_lambda\
(hat(F) psi_lambda)^* &= lambda^* psi_lambda^*\
$
代入定义式
$
lambda integral psi_lambda^* psi_lambda dd(V) &= lambda^* integral psi_lambda psi_lambda^* dd(V)\
lambda &= lambda^*
$
从而得到$lambda$是实数。由于这个定理,我们*要求所有的物理量(或者称为“可测量量”)的算符都是Hermitian算符*(但是反过来不一定)。
不难证明坐标算符和动量算符都是Hermitian算符。在一定条件下,它们的函数也是Hermitian算符。
假设已经证明了$hat(arrow(P))^T = - hat(arrow(P))$,那么有
$
hat(arrow(P))^dagger = (hat(arrow(P))^T)^* = - hat(arrow(P))^* = hat(arrow(P))
$
而对于$hat(arrow(L)) = arrow(r) crossproduct hat(arrow(P))$,有
$
hat(arrow(L))_x = y hat(p)_z - z hat(p)_y \
hat(arrow(L))_x^dagger = hat(p)_z^dagger y - hat(p)_y^dagger z = hat(p)_z y - hat(p)_y z = hat(arrow(L))_x
$
径向动量算符$hat(p)_r = hat(r) dot hat(arrow(p))$*不是Hermitian算符*,因为
$
(hat(r) dot hat(arrow(p)))^dagger = hat(arrow(p))^dagger dot hat(r)^dagger = hat(arrow(p)) dot hat(r) = - i hbar (partial/(partial r) hat(r)+ 1/r hat(theta) + 1/(r sin(theta)) hat(phi)) dot hat(r) = - i hbar (partial/(partial r) + 2/r)
$
于是有
$
(hat(r) dot hat(arrow(p)))^dagger = hat(r) dot hat(arrow(p)) - 2 i hbar/r
$
所以径向动量算符不是Hermitian算符。但我们可以构造一个厄密算符——*坐标表象*表达式:
$
hat(p)_r = 1/2 ((hat(r) dot hat(arrow(p)))^dagger + hat(r) dot hat(arrow(p))) = - i hbar (partial/(partial r) + 1/(r))
$
=== 厄密算符的本征函数
正交:若两个函数$psi_1$和$psi_2$满足
$
integral psi_1^*psi_2 dd(tau) = 0
$
则称$psi_1$和$psi_2$是正交的。
*Hermitian算符的本征函数对应于不同本征值的本征函数是正交的*:
$
hat(F) psi_lambda &= lambda psi_lambda\
hat(F) psi_mu &= mu psi_mu\
lambda integral psi_lambda^* psi_mu dd(V) &= mu integral psi_lambda psi_mu^* dd(V)\
(lambda - mu) integral psi_lambda^* psi_mu dd(V) &= 0\
integral psi_lambda^* psi_mu dd(V) &= 0
$
说明了Hermitian算符的本征函数是正交的。
- 若本征值谱是非简并的和离散的,本征值为${lambda_i}$,本征函数为${phi_i}$, 那么波函数是平方可积的,因而可以归一化,所以正交和归一可统一写为
$
integral phi_i^* phi_j dd(tau) = delta_(i j)
$
- 若$F$的本征值谱是非简并的和连续的,本征函数可以按$delta$函数正交“归一”化,即
$
integral phi^*_(lambda) phi_(mu) dd(tau) = delta(lambda - mu)
$
或者是箱归一化。
=== 平面波的箱归一化
对于平面波:
$
psi(arrow(r)) = A e^(i/hbar arrow(p) dot arrow(r))
$
箱归一化要求:粒子波函数在任意边长为$L$的正方体内正交归一化。
- 粒子在三维空间自由运动
- 周期性边界条件
- 箱边长 $L -> oo$
$
integral_V psi^*_(arrow(p)_1)(arrow(r),t) psi_(arrow(p)_2)(arrow(r),t) dd(V) = |C|^2 integral_V e^(i/hbar (arrow(p)_1 - arrow(p)_2) dot arrow(r)) dd(V)
$
在$arrow(p)_1=arrow(p)_2$时,归一化为($a,b,c$为任意常数):
$
|C|^2 integral_a^(a+L) integral_b^(b+L) integral_c^(c+L) e^(i/hbar (arrow(p)_1 - arrow(p)_2) dot arrow(r)) dd(r) = 1
$
即
$
|C|^2 L^3 = 1 => C = 1/sqrt(L^3)
$
在$arrow(p)_1!=arrow(p)_2$时,
$
integral_0^L e^(i/hbar (p_1 - p_2) dot x) dd(x) = (i/hbar Delta p) ^(-1) (e^(i/hbar Delta p L) - 1)
$
正交要求为:
$
(-i hbar)^3/(L^3 Delta p_x Delta p_y Delta p_z) e^(i/hbar (Delta p_x a + Delta p_y b + Delta p_z c)) (e^(i/hbar Delta p_x L) - 1) (e^(i/hbar Delta p_y L) - 1) (e^(i/hbar Delta p_z L) - 1) = 0
$
于是有:
$
e^(i/hbar Delta p_x L) = e^(i/hbar Delta p_y L) = e^(i/hbar Delta p_z L) = 1
$
即
$
Delta p_i = (2 pi hbar n_i) / L\
$
从而
$
p_i = (2 pi hbar n_i) / L + delta_i
$
其中$n_i$是整数,$delta_i$是初始相位,一般不妨设为0。
于是得到$p_i$
$
p_i = (2 pi hbar n_i) / L
$
系统的动量是分立的,但当$L -> oo$时,又过渡到连续的动量谱。
最终的波函数为
$
psi_(arrow(p))(arrow(r),t) = 1/sqrt(L^3) e^((2 pi i)/ L arrow(n) dot arrow(r))
$
== 算符的本征方程
对于Hermitian算符$hat(F)$,有*本征方程*
$
hat(F) psi_lambda = lambda psi_lambda
$
其中$lambda$是*本征值*,$psi_lambda$是$hat(F)$属于本征值$lambda$的*本征函数*。
量子力学关于测量问题的基本假设是:
算符$hat(F)$的本征值集${lambda}$就是力学量$hat(F)$的*测量值集*。
$hat(F)$的本征函数$psi_lambda$代表力学量$F$有确定值$lambda$的量子状态$psi = sum_lambda c_lambda psi_lambda$中的一个分量,概率为$|c_lambda|^2$。
_例:动量本征函数_
动量算符$hat(arrow(p))$的本征方程是
$
hat(arrow(p)) psi_(arrow(p)) = - i hbar nabla psi_(arrow(p)) = arrow(p) psi_(arrow(p))
$
于是
$
psi_arrow(p) = A e^(i arrow(p) dot arrow(r)/hbar)
$
其中$A = 1/(2 pi hbar)^(3/2)$是归一化系数。但是,在无穷空间中它们是平方不可积的,这时它们正交归一化为$delta$函数。
_例:位置算符_
位置算符$hat(arrow(r))$的本征方程是
$
hat(arrow(r)) psi_(arrow(r)) = arrow(r) psi_(arrow(r))
$
解出的本征函数是$psi_(arrow(r)_0) = delta(arrow(r) - arrow(r_0))$,即位置算符的本征函数是位置本身。
对波函数,可以按照位置算符的本征函数展开:
$
psi(arrow(r)) &= sum_arrow(r_0) c_(arrow(r_0)) psi_(arrow(r_0)) psi_(arrow(r)) \
&= integral c_(arrow(r_0)) delta(arrow(r) - arrow(r_0)) dd(r_0) = c_(arrow(r))
$
这就是波函数的位置表象。
== 简并波函数的正交化
如果出现简并(即一个本征值有若干个线性独立的本征函数)的情形,则*正交性定理不能保证同一本征值的不同本征函数是彼此正交的*。
经过对本征函数进行适当的重新组合,可以使它们仍然是正交的。这个过程称为*正交化*。
=== Schmidt正交化
*Gram-Schmidt正交化*方法是一种常用的正交化方法。
设函数$rho_1, rho_2, ..., rho_n$是线性独立的,但不正交的函数。我们要把它们正交化。
1. 先把第一个函数归一化:
2. 第二个函数减去第一个函数在第二个函数方向上的投影,得到新的函数,再归一化:
3. 第三个函数减去前两个函数在第三个函数方向上的投影,得到新的函数,再归一化:
4. 以此类推,直到最后一个函数。
$
rho_1 = rho_1\
rho_2 = rho_2 - ((rho_2, rho_1))/((rho_1, rho_1)) rho_1\
rho_3 = rho_3 - ((rho_3, rho_1))/((rho_1, rho_1)) rho_1 - ((rho_3, rho_2))/((rho_2, rho_2)) rho_2\
...
$
这样得到的函数就是正交的。
=== 共同本征函数
在量子力学中,一个更为物理的解决简并本征函数的办法是考虑*两个算符的共同本征函数*。
*对易:*若$hat(F)$和$hat(G)$是两个算符,若它们的*对易子*是
$
[hat(F), hat(G)] = hat(F) hat(G) - hat(G) hat(F)
$
若$[hat(F), hat(G)] = 0$,则称$hat(F)$和$hat(G)$是*对易*的。
*共同本征函数:*若$[hat(F), hat(G)] = 0$则$hat(F)$和$hat(G)$有共同的本征函数。即存在$phi$使得
$
hat(F) phi = lambda phi\
hat(G) phi = mu phi
$
该定理也很容易推广到多个算符的情形。
共同本征函数描写的就是几个力学量同时有确定值的状态。
这样,如果算符$hat(F)$的本征值$l$有简并,我们就再引进另一算符$hat(G)$,使得$hat(F)$和$hat(G)$有共同的本征函数,这样就可以把简并的本征函数正交化。
如果对于$F$简并的本征函数对于$G$不是简并的,那么*正交性定理就保证了它们是正交的*。但也可能$F$和$G$的共同本征函数仍然有简并,我们就再引进第三个算符,如此等等,直到所有的简并完全去除为止。这时,*一组量子数*就完全确定了一个量子态。
这种情形多半出现在多自由度体系中。对这种体系,一组两两对易的、完全去除简并的算符集称为它的*对易可观测量完全集(CSCO)*。完备算符集中算符的数目就是体系的*自由度数*。
如果这些量子数都是分立量子数,共同本征函数的正交归一关系就是:
$
(phi_(n l m), phi_(n' l' m')) = delta_(n n') delta_(l l') delta_(m m')
$
#newpara()
*例如:动量算符*
动量算符的各个分量是彼此对易的:
$
[p_x, p_y] = [p_x, p_z] = [p_y, p_z] = 0
$
所以动量算符的三个分量有共同的本征函数:
$
phi_arrow(p) (x,y,z) = (1/sqrt(2 pi hbar))^3 e^(i/hbar p_x x) e^(i/hbar p_y y) e^(i/hbar p_z z)
$
即是三维平面波,任何波函数都可以用它们来展开(函数的Fourier变换)。
*例如:动量算符和哈密顿算符*
对一维自由粒子来说:
$
hat(p)_x = - i hbar partial/(partial x)\
hat(H) = hat(p)^2/(2m) = - hbar^2/(2m) partial^2/(partial x^2)
$
这两个算符是对易的:
$
[hat(p)_x, hat(H)] = 0
$
所以它们有共同的本征函数:
$
phi_(p_x) (x) = 1/sqrt(2 pi hbar) e^(i/hbar p_x x)
$
其中参数$p_x$为$hat(p)_x$算符的某个本征值。
*例:对于氢原子,考察下面三个算符*
$
hat(L) &= - i hbar hat(Y)_z = - i hbar partial/(partial phi)\
hat(L)^2 &= - hbar^2 hat(Y)^2 = - hbar^2 (1/sin(theta) partial/(partial theta) (sin(theta) partial/(partial theta)) + 1/(sin(theta)^2) partial^2/(partial phi^2))\
hat(H) &= - hbar^2/(2m) nabla^2 + U(r) = - hbar^2/(2m r^2) partial/(partial r) (r^2 partial/(partial r)) + hat(L)^2/(2 m r^2) + U(r)
$
有:
$
[hat(L)^2, hat(H)] = [hat(L), hat(H)] = [hat(L), hat(L)^2] = 0
$
所以它们有共同的本征函数——氢原子能量本征函数:
$
psi_(n l m) (r, theta, phi) = R_(n l) (r) Y_(l m) (theta, phi)
$
满足正交归一:
$
(psi_(n l m), psi_(n' l' m')) = delta_(n n') delta_(l l') delta_(m m')
$
#newpara()
已知算符$hat(A),hat(B)$满足$[hat(A),hat(B)] = 0$ ,$phi_B$是$hat(B)$的一个本征态(对应本征值为$B$),则$hat(A) phi_B$也是$hat(B)$的一个本征态(对应本征值为$B$)。从而$hat(A) phi_B = A phi_B$。其中$A$也是该函数的本征值。这就证明了$hat(A)$和$hat(B)$有共同的本征函数。
=== 对易括号的运算
1. 对易括号是交换反对称的,即
$
[hat(A), hat(B)] = - [hat(B), hat(A)]
$
2. 对易括号的运算满足线性性,即
$
[hat(A), hat(B) + hat(C)] = [hat(A), hat(B)] + [hat(A), hat(C)]\
[hat(A) + hat(B), hat(C)] = [hat(A), hat(C)] + [hat(B), hat(C)]\
[c hat(A), hat(B)] = [hat(A), c hat(B)] = c [hat(A), hat(B)]
$
3. 对易括号的运算满足Leibniz法则,即
$
[hat(A), hat(B) hat(C)] = [hat(A), hat(B)] hat(C) + hat(B) [hat(A), hat(C)]\
[hat(A) hat(B), hat(C)] = hat(A) [hat(B), hat(C)] + [hat(A), hat(C)] hat(B)
$
4. 量子力学的基本对易括号是
$
[hat(x)_i, hat(p)_j] = i hbar delta_(i j)
$
其中$hat(p)_i = - i hbar partial/(partial x_i)$(坐标表象)。
_证明:_
$
[hat(x)_i, hat(p)_j] psi &= hat(x)_i hat(p)_j psi - hat(p)_j hat(x)_i psi\
&= - i hbar (x_i partial/(partial x_j) psi - partial/(partial x_j) (x_i psi))\
&= i hbar delta_(i j) psi
$
#newpara()
利用上面给出的对易括号的性质和运算法则:
$
[hat(x), hat(F)] = i hbar hat((partial F)/(partial p_x))\
[hat(p), hat(F)] = - i hbar hat((partial F)/(partial x))
$
其中$hat(F) = hat(F)(hat(x), hat(p)) = sum_(m,n = 0)^oo c_(m n) hat(x)^m hat(p)^n$,是算符$hat(x)$和$hat(p)$的多项式。
*例:角动量算符的对易括号*
$
[hat(L)_i, hat(L)_j] = i hbar epsilon_(i j k) hat(L)_k
$
其中:
$
hat(L)_i = hat(r) crossproduct hat(p)_i = - i hbar epsilon_(i j k) hat(r)_j hat(p)_k
$
而角动量平方算符的对易括号:
$
[hat(L)^2, hat(L)_i] = 0
$
其中:
$
hat(L)^2 = hat(L)_x^2 + hat(L)_y^2 + hat(L)_z^2
$
角动量各分量之间互相不对易有深刻的物理结果。
== 波函数按本征函数系展开
一维情形。假设力学量算符$hat(F)$的本征值集是${λ_n, n=1,2,...}$,(离散的、非简并的),本征函数系是${phi_n(x), n = 1, 2,...}$按叠加原理,
$
psi(x) = sum_n c_n phi_n (x)
$
注意到${phi_n(x)}$是正交归一的,
$
(phi_n, phi_m) = delta_(n m)
$
所以
$
c_n = (phi_n, psi) = integral phi_n^* psi dd(x)
$
只有当${phi_n (x)}$是完备的函数系时,才能用它来展开任意的连续函数:
$
psi(x) = sum_n integral phi_n (x') psi(x') dd(x') phi_n (x) = integral (sum_n phi_n (x) phi_n (x')) psi(x') dd(x')\
psi(x) = integral delta(x - x') psi(x') dd(x')
$
从而得到
$
sum_n phi_n (x) phi_n (x') = delta(x - x')
$
这个条件就称为函数系${phi_n (x)}$的完备性条件。
_注:_
- 本征值是连续谱,本征函数系是$phi_lambda (x)$($lambda$连续变化)
$
psi (x) = integral c_lambda phi_lambda (x) dd(lambda)\
integral phi_lambda^* phi_lambda' dd(x) = delta(lambda - lambda')\
c_lambda = integral phi_lambda^*(x) psi(x) dd(x)\
integral phi_lambda^* psi (x) phi_lambda (x') dd(lambda) = delta(x - x')
$
- 多自由度体系(例如三维运动)。这时要按CSCO算符集的共同本征函数系展开。系数的计算方法是类似的。
- 与时间有关的波函数$c_n -> c_n (t)$,展开系数也是时间的函数。
- 根据完备力学量集的定义和态的叠加原理,完备力学量集的全体算符的共同本征函数构成了表示该系统量子状态的正交归一的完备基底,即系统的任何状态都可以展开为这些基底的线性组合。
== 量子力学量的测量-波包坍缩
量子力学的测量结果是几率性的,比如我们测一个非定态系统的能量,其波函数为:
$
psi(x, t) = sum_n c_n(t) phi_n(x) e^(-i E_n t/hbar)
$
在测量以前,系统的状态是许许多多本征态的叠加。测量之后,系统坍缩为某一个本征态:
$
sum_n c_n(t) phi_n(x) e^(-i E_n t/hbar) ->^"测量并读数" phi_n(x) e^(-i E_n t/hbar)
$
这一过程称为*“波包坍缩”*(von Neumann,1932年)。
波包坍缩的动力学过程至今仍在研究(不服从薛定谔方程)。量子力学关于测量的假定是理论的基本假定之一,是量子力学目前无法解释的。比如,在对粒子做空间位置测量后的一刻,其波函数坍缩为
$
psi(x) = delta(x - x_0)
$
=== 力学量的测量几率
一维离散情形:假设力学量算符$hat(F)$的本征值集是${lambda_n, n=1,2,...}$,本征函数系是${phi_n (x), n = 1, 2,...}$,波函数为
$
psi(x) = sum_n c_n phi_n (x)
$
则测量力学量$F$的本征值为$lambda_n$的几率是
$
w(lambda_n) = |c_n|^2
$
#newpara()
总几率不变的验证: 测量$hat(F)$得到各种可能测量值的总几率为
$
sum_n w(lambda_n) &= sum_n |integral phi_n^* psi dd(x)|^2 \
&= sum_n integral phi_n (x) psi^*_n (x) dd(x) integral psi (x') phi_n^*(x') dd(x') \
&= integral.double (sum_n phi_n (x)psi_n^* (x')) phi_n^*(x) psi (x') dd(x)dd(x') \
&= integral.double delta(x - x') psi^* (x) psi (x') dd(x)dd(x') \
&= integral delta(x - x) (integral psi^* (x) psi (x') dd(x)) dd(x') \
&= integral psi^* (x) psi (x) dd(x) = 1
$
推广:
- 本征值是连续的。此时要引入几率密度:记测量值在$lambda->lambda+dd(lambda)$之间的几率为$dd(W(lambda))$,则
$
w(lambda) = dd(W(lambda))/dd(lambda) = |c_lambda|^2
$
是$lambda$的测量几率密度,它的计算公式是
$
c_lambda = integral phi_lambda^*(x) psi(x) dd(x)
$
- 对多自由度体系,只问某一个力学量的测量几率,经常会有简并。这时要找到一个包含$hat(F)$的CSCO完全集,并求出它们的共同本征函数。设力学量$F$的离散的本征值$lambda_n$的简并度为$k$,简并的本征态为$phi_(n 1), phi_(n 2), ..., phi_(n k)$,则
$
psi(x) = sum_n sum_(i = 1)^k c_(n i) phi_(n i) (x)
$
测量$F$得到$lambda_n$的几率是
$
w(lambda_n) = sum_(i = 1)^k |c_(n i)|^2
$
对连续谱的情况也做类似的推广。
=== 力学量的平均值
可以定义力学量$F$的平均值为
$
macron(F) &= sum_n lambda_n w(lambda_n) \
&= sum_n lambda_n |c_n|^2 \
&= sum_n integral phi_n (x) psi^*_n (x) dd(x) integral psi (x') (hat(F)phi_n (x'))^* dd(x') \
&= integral.double (sum_n phi_n (x)psi_n^* (x')) (hat(F)phi_n (x'))^* dd(x)dd(x') \
&= integral.double delta(x - x') psi^* (x) hat(F) psi (x') dd(x)dd(x') \
&= integral psi^* (x) hat(F) psi (x) dd(x)
$
这个计算式的条件是$psi(x)$已经归一,即
$
integral psi^* (x) psi (x) dd(x) = 1
$
如果没有归一:
$
macron(F) =( integral psi^* (x) hat(F) psi (x) dd(x) )/( integral psi^* (x) psi (x) dd(x))
$
#pagebreak(weak: true)
= 算符对易和不确定关系
== 对易算符与本征函数
定理:两个力学量算符$hat(F)$和$hat(G)$有一组完备的共同本征函数的充要条件是它们彼此对易
$
[hat(F), hat(G)] = 0
$
*必要性:*设$hat(F)$和$hat(G)$有一组完备的共同本征函数${phi_(f g)}$,则
$
hat(F) phi_(f g) = f phi_(f g)\
hat(G) phi_(f g) = g phi_(f g)
$
对于任意波函数$psi$,都可以展开为这组共同本征函数的线性组合:
$
[hat(F), hat(G) psi] = hat(F) hat(G) psi - hat(G) hat(F) psi = (f g - g f)psi = 0
$
根据$psi$的任意性
$
[hat(F), hat(G)] = 0
$
*充分性:*如果$hat(F)$和$hat(G)$中有一个是非简并的(比如$hat(F)$),也就是说对应每个本征值只有一个线性无关本征态
$
hat(F) phi_f = f phi_f
$
那么
$
0 = [hat(F), hat(G)] phi_f = hat(F) hat(G) phi_f - hat(G) hat(F) phi_f = hat(F) hat(G) phi_f - f hat(G) phi_f\
hat(F)(hat(G) phi_f) = f (hat(G) phi_f)
$
也就是说,$phi_f$和$hat(G)phi_f$都属于$hat(F)$的对应本征值$f$的本征函数,非简并有:
$
hat(G) phi_(f g) = g phi_(f g)
$
这样就证明了$hat(F)$和$hat(G)$有一组完备的共同本征函数。
对于二者都简并的情况,设
$
hat(F) phi_(f k) = f phi_(f k) (k = 1, 2, ..., n)
$
有
$
hat(F)(hat(G) phi_(f k)) = f (hat(G) phi_(f k))
$
那么必有
$
hat(G) phi_(f k) = sum_(m = 1)^n c_(k m) phi_(f m)
$
写成矩阵形式,同时略去角标$f$:
$
hat(G)
mat(
phi_1;
phi_2;
dots.v;
phi_n
)
=
mat(
c_11 , c_12, ..., c_(1n);
c_21 , c_22, ..., c_(2n);
dots.v, dots.v, dots.down, dots.v;
c_(n 1) , c_(n 2), ..., c_(n n)
)
mat(
phi_1;
phi_2;
dots.v;
phi_n
)
$
*把系数矩阵对角化(厄密矩阵可以对对角化),就得到了$hat(G)$的本征值和本征函数。*
存在$n times n$的变换矩阵$U$,使得
$
U mat(
c_11 , c_12, ..., c_(1n);
c_21 , c_22, ..., c_(2n);
dots.v, dots.v, dots.down, dots.v;
c_(n 1) , c_(n 2), ..., c_(n n)
) U^(-1) = diag(g_1, g_2, ..., g_n)
$
那么:
$
U hat(G) mat(
phi_1;
phi_2;
dots.v;
phi_n
) = U
mat(
c_11 , c_12, ..., c_(1n);
c_21 , c_22, ..., c_(2n);
dots.v, dots.v, dots.down, dots.v;
c_(n 1) , c_(n 2), ..., c_(n n)
)
mat(
phi_1;
phi_2;
dots.v;
phi_n
)
$
即
$
hat(G)
mat(
phi_1^';
phi_2^';
dots.v;
phi_n^'
) =
mat(
g_1 , 0, ..., 0;
0 , g_2, ..., 0;
dots.v, dots.v, dots.down, dots.v;
0 , 0, ..., g_n
)
mat(
phi_1^';
phi_2^';
dots.v;
phi_n^'
)
$
其中
$
mat(
phi_1^';
phi_2^';
dots.v;
phi_n^'
) = U
mat(
phi_1;
phi_2;
dots.v;
phi_n
)
$
这样就得到了(再把角标$f$放回):
$
hat(F) phi_(f k)^' = f phi_(f k)^'\
hat(G) phi_(f k)^' = g_k phi_(f k)^'
$
这样就证明了$hat(F)$和$hat(G)$有一组完备的共同本征函数。
这个证明过程有两点启示:
- 提供了一种消除简并的方法(找对易算符或CSCO算符集);
- 算符的作用可以用矩阵来表示-海森堡矩阵力学。
两个力学量算符不对易,则它们不能有共同的完备的本征函数集,但不排除它们碰巧有个别共同本征函数。例:
$
[hat(L)_x, hat(L)_y] = i hbar hat(L)_z\
psi(arrow(r)) = 1/(2 pi hbar)^(3/2)\
$
有共同本征函数:
$
hat(L)_z psi(arrow(r)) = 0 psi(arrow(r))\
hat(L)_y psi(arrow(r)) = 0 psi(arrow(r))
$
== 对易算符与不确定性原理
若
$
[hat(F), hat(G)] != 0
$
则一般来说$F$和$G$不能同时有确定值。例如:
$
hat(p)_x = - i hbar partial/(partial x)\
hat(x) = x
$
它在本质上是波粒二象性的反映。例如在粒子的单缝衍射实验中,$Delta x$越小,$Delta p_x$越大,
$
Delta x Delta p_x approx hbar
$
二者不能同时有确定值。所以,运动轨道的概念对微观粒子是不适用的。
对这种不确定性的定量描写如下。定义偏差算符为:
$
Delta hat(F) = hat(F) - macron(F)
$
有性质:
$
[Delta hat(F), Delta hat(G)] = [hat(F) - macron(F), hat(G) - macron(G)] = [hat(F), hat(G)]
$
$
macron(Delta hat(F)) = macron(hat(F) - macron(F)) = macron(F) - macron(F) = 0
$
$
macron(Delta hat(F)^2) = macron((hat(F) - macron(F))^2) = macron(hat(F)^2 - 2 macron(F) hat(F) + macron(F)^2) = macron(hat(F)^2) - 2 macron(F) macron(F) + macron(F)^2 = macron(hat(F)^2) - macron(F)^2
$
#newpara()
如果
$
[hat(F), hat(G)] = i hat(C) != 0
$
其中$hat(C)$是厄密算符,考虑积分不等式:
$
I(xi) = integral |(xi Delta hat(F) - i Delta hat(G))psi|^2 dd(tau) >= 0
$
其中$psi$为体系的任一态,$xi$为任意实数。化简得到:
$
I(xi) &= integral (xi(Delta hat(F) psi)^* + i (Delta hat(G) psi)^*) (xi Delta hat(F) psi - i Delta hat(G) psi) dd(tau) \
&= xi^2 integral (Delta hat(F) psi)^* (Delta hat(F)) psi dd(tau) + i xi integral (Delta hat(G) psi)^* (Delta hat(F) psi) dd(tau) - i xi integral (Delta hat(F) psi)^* (Delta hat(G) psi) dd(tau) + integral (Delta hat(G) psi)^* (Delta hat(G) psi) dd(tau) \
&=^"Hermit性质" xi^2 integral psi^* (Delta hat(F))^2 psi dd(tau) + xi integral psi^* (Delta hat(G) Delta hat(F) + Delta hat(F) Delta hat(G)) psi dd(tau) + integral psi^* (Delta hat(G))^2 psi dd(tau) \
&= xi^2 macron(Delta hat(F)^2) + xi macron(hat(C)) + macron(Delta hat(G)^2) >= 0
$
这是一个关于$xi$的二次函数,所以它的判别式小于等于0,得到*Heisenberg不确定关系*:
$
macron(Delta hat(F)^2) macron(Delta hat(G)^2) >= 1/4 |macron(hat(C))|^2
$
也是Schwartz不等式。
若$[hat(F),hat(G)] != 0$则一般说来$Delta F$和$Delta G$不能同时为零,即$F$和$G$不能同时有确定值(但是注意$macron([hat(F),hat(G)]) = 0$的特殊态例外),或者说它们不能有共同的本征态。
反之,若$[hat(F),hat(G)] = 0$,则可以找到这样的态,使得$Delta F$和$Delta G$同时为零,即$F$和$G$可以同时有确定值,或者说它们有共同的本征态。
#newpara()
对于坐标和动量算符:
$
macron(Delta x)^2 macron(Delta p)^2 >= 1/4 hbar^2
$
即:
$
Delta x Delta p_x >= hbar/2
$
上面的不等式中取“=”的量子态,被称为“最小不确定态”。
对于谐振子的基态:
$
hat(H) = 1/(2m) hat(p)^2 + 1/2 m omega^2 hat(x)^2\
macron(E) = 1/2 macron(p)^2/(2m) + 1/2 m omega^2 macron(x)^2\
$
对于谐振子任意本征态,$macron(p) = 0$,$macron(x) = 0$,所以
$
macron(hat(p)^2) = macron(Delta hat(p)^2) \
macron(hat(x)^2) = macron(Delta hat(x)^2) \
$
从而得到
$
macron(E) = 1/(2m) macron(Delta p)^2 + 1/2 m omega^2 macron(Delta x)^2
$
在极限情况下,即最小不确定态,有
$
macron(E) = hbar omega/2
$
谐振子的基态是最小不确定态。(不是所有量子系统的基态都是最小不确定态)
== 联级Stern-Gerlach实验
$hat(L)_x$和$hat(L)_z$不对易,所以不能同时有确定值。
#figure(
image("pic/2024-04-25-17-01-26.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-04-25-17-02-28.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-04-25-17-03-13.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-04-25-17-04-31.png", width: 80%),
numbering: none
)
#pagebreak(weak: true)
= 角动量算符
== 角动量算符的本征值和本征态
角动量算符(轨道角动量)的定义是:
$
hat(L) = hat(r) crossproduct hat(p) = - i hbar hat(r) crossproduct nabla\
hat(L)_z = - i hbar (x partial/(partial y) - y partial/(partial x))\
hat(L)^2 = hat(L)_x^2 + hat(L)_y^2 + hat(L)_z^2
$
角动量算符的球坐标表示为:
$
hat(L)_x &= i hbar (sin(phi) partial/(partial theta) + cot(theta) cos(phi) partial/(partial phi))\
hat(L)_y &= - i hbar (cos(phi) partial/(partial theta) - cot(theta) sin(phi) partial/(partial phi))\
hat(L)_z &= - i hbar partial/(partial phi)\
hat(L)^2 &= - hbar^2 (1/sin(theta) partial/(partial theta) (sin(theta) partial/(partial theta)) + 1/(sin(theta)^2) partial^2/(partial phi^2))
$
== $hat(L)_z$的本征值和本征函数
$hat(L)_z$的本征值方程是:
$
hat(L)_z psi_(m) = m hbar psi_(m)
$
解出的本征函数是:
$
psi_(m) = C e^(i m phi)
$
由波函数的连续性,必须有:
$
psi_m (phi) = psi_m (phi + 2 pi)
$
周期性边界条件要求$m$是整数。归一化条件是:
$
1 = integral_0^(2 pi) |C|^2 d phi = 2 pi |C|^2\
C = 1/sqrt(2 pi)
$
== $hat(L)^2$的本征值和本征函数
$hat(L)^2$的本征值方程是:
$
hat(L)^2 Y = lambda hbar^2 Y , lambda = l (l + 1)\
1/(sin theta) partial/(partial theta) (sin theta partial/(partial theta) Y) + 1/(sin^2 theta) partial^2/(partial phi^2) Y = - lambda Y
$
分离变量法,设$Y(theta, phi) = Theta(theta) Phi(phi)$,得到两个方程:
$
1/(sin theta) partial/(partial theta) (sin theta partial/(partial theta) Theta) + lambda Theta = 0\
partial^2/(partial phi^2) Phi = - m^2 Phi
$
第一个方程是Legendre方程,解为连带Legendre多项式$P_l^m (cos theta)$,第二个方程是周期函数,解为$e^(i m phi)$。
详细地,缔合Legendre方程是:
$
dd("")/dd(w) (1 - w^2) dd(P)/dd(w) + (lambda - m^2/(1 - w^2)) P = 0
$
$w=plus.minus 1$是这个方程的“奇点”,除非$l$取某些特定值,方程的解将在$w=plus.minus 1$处变成无穷大。这些使得级数截断的$l$满足:
$
l = |m|, |m| + 1, |m| + 2, ...
$
它的解是连带Legendre函数:
$
P_l^m (cos theta) = 1/(2^l l!)(1 - cos^2 theta)^(m/2) dd("")^(l+m)/(d cos^(l+m) theta) (w^2 - 1)^l , |m| <= l
$
其正交归一性是:
$
integral_(-1)^1 P_l^m (cos theta) P_(l')^m (cos theta) dd(cos theta) = 2/(2 l + 1) (l + m)!/(l - m)! delta_(l ,l')
$
根据球谐函数的正交归一性:
$
integral_0^(2 pi) integral_0^pi Y_(l m)^* Y_(l' m') sin theta dd(theta) dd(phi) = delta_(l l') delta_(m m')
$
得到$Y(theta, phi)$球谐函数:
$
Y_(l m) (theta, phi) = sqrt((2 l + 1)/(4 pi) (l - m)!/(l + m)!) P_l^m (cos theta) e^(i m phi)
$
其中$l$是角量子数,$m$是磁量子数。
$l = 0,1,2,...$,对应SPDF态。对于给定的$l$,$m = -l, -l + 1, ..., l$,这证明$hat(L)^2$是$2l + 1$度简并的。
== 球谐函数的基本性质
1. $Y_(l m) (theta, phi)$是角动量算符$hat(L)^2$和$hat(L)_z$的共同本征函数,对应本征值分别是$l (l + 1) hbar^2$和$m hbar$。
$
hat(L)^2 Y_(l m) = l (l + 1) hbar^2 Y_(l m)\
hat(L)_z Y_(l m) = m hbar Y_(l m)
$
2. $Y_(l m) (theta, phi)$是正交归一的:
$
integral_0^(2 pi) integral_0^pi Y_(l m)^* Y_(l' m') sin theta dd(theta) dd(phi) = delta_(l l') delta_(m m')
$
3. 关于宇称的定义也可以推广到三维空间。变换
$
cal(P) : arrow(r) -> - arrow(r)
$
称为宇称变换。对于球谐函数,有
$
cal(P) Y_(l m) (theta, phi) = (-1)^l Y_(l m) (theta, phi)
$
即$Y_(l m) (theta, phi)$的宇称是$(-1)^l$。
4. $Y_(l m) (theta, phi)$是单位球面$r=1$,上的完备正交函数系。任意函数$psi(theta, phi)$都可以展开为球谐函数的级数:
$
psi(theta, phi) = sum_(l = 0)^oo sum_(m = -l)^l c_(l m) Y_(l m) (theta, phi)
$
其中系数$c_(l m)$是:
$
c_(l m) = integral_0^(2 pi) integral_0^pi Y_(l m)^* psi(theta, phi) sin theta dd(theta) dd(phi)
$
5. $Y_(l m) (theta, phi)$满足微分方程:
$
- r^2 nabla^2 Y_(l m) = l (l + 1) hbar^2 Y_(l m)
$
如果一个函数$f(theta, phi)$满足
$
- r^2 nabla^2 f(theta, phi) = lambda f(theta, phi)
$
那么$f(theta, phi)$就位于角动量量子数$l$的子空间里,相应的其展开式为
$
f(theta, phi) = sum_(m = -l)^l c_m Y_(l m) (theta, phi)
$
6. 加法定理:设球坐标系中有两个矢量
$
arrow(r) = (r, theta, phi)\
arrow(r') = (r', theta', phi')
$
则
$
cos gamma = cos theta cos theta' + sin theta sin theta' (cos(phi - phi'))
$
其中$gamma$是两个矢量之间的夹角。这个公式可以用来证明球谐函数的加法定理:
$
P_l (cos gamma) = (4 pi)/(2 l + 1) sum_(m = -l)^l Y_(l m) (theta, phi) Y_(l m)^* (theta', phi')
$
7. 两点距离倒数的展开:
$
1/abs(arrow(r) - arrow(r')) = 1/r (1 + r'^2/r^2 - 2 r'/r cos gamma)^(-1/2) = cases(
1/r sum_(l = 0)^oo (r'/r)^l P_l (cos gamma) &"if" r > r'\
1/r' sum_(l = 0)^oo (r/r')^l P_l (cos gamma) &"if" r < r'
)
$
以及相应的积分:
$
integral_0^(2 pi) integral_0^pi 1/abs(arrow(r) - arrow(r')) sin theta dd(theta) dd(phi) = cases(
4pi/r "if" r > r'\
4pi/r' "if" r < r'
)
$
#pagebreak(weak: true)
= 量⼦系统的时间演化
== 不含时$hat(H)$的本征函数
定态薛定谔方程:
$
hat(H) psi = E psi
$
其中$hat(H)$是哈密顿算符,$E$是能量本征值,$phi$是能量本征函数。薛定谔方程的解是:
$
psi(arrow(r), t) = sum_n a_n (t) phi_n (arrow(r))
$
带入薛定谔方程,得到:
$
i hbar partial/(partial t) psi(arrow(r), t) = hat(H) psi(arrow(r), t)\
sum_n i hbar dd(a_n (t))/dd(t) phi_n (arrow(r)) = sum_n a_n (t) hat(H) phi_n (arrow(r))\
$
即:
$
i hbar dd(a_n (t))/dd(t) = E_n a_n (t)
$
解得:
$
a_n (t) = a_n(0) e^(-i/hbar E_n t)
$
所以:
$
psi(arrow(r), t) = sum_n a_n e^(-i/hbar E_n t) phi_n (arrow(r))
$
这就是量子系统的时间演化。其中
$
a_n (0) = a_n
$
与时间无关。并且可以得到:
$
|a_n (t)|^2 = |a_n|^2
$
即*系统在任意时刻的能量几率分布都和初始时刻的能量几率分布相同*。
在$hat(H)$和时间无关的情况下,只要我们完全地解决了定态薛定谔方程的问题,那么一旦知道了波函数的初始值,与时间有关的Schrödinger方程的解就可以很方便地得出。形式地说,这个解是
$
Psi(arrow(r), t) = e^(-i/hbar hat(H) t) Psi(arrow(r), 0)
$
其中$Psi(arrow(r), 0)$是初始波函数,而$e^(-i/hbar hat(H) t)$是*时间演化算符*。
我们可以用时间演化算符作用在初始波函数上来得到此后任一时刻系统的波函数:
$
psi(arrow(r), t) &= sum_n a_n (0) e^(-i E_n t/hbar) phi_n (arrow(r))\
&= sum_n a_n (0) e^(-i/hbar hat(H) t) phi_n (arrow(r))\
&= e^(-i/hbar hat(H) t) sum_n a_n (0) phi_n (arrow(r))\
&= e^(-i/hbar hat(H) t) psi(arrow(r), 0)\
&= hat(U)(t) psi(arrow(r), 0)
$
其中$hat(U)(t) = e^(-i/hbar hat(H) t)$是时间演化算符。
_例:一维自由粒子高斯波包的时间演化。_
$t=0$时刻波函数为
$
psi(x, 0) = (1/(2 pi sigma^2))^(1/4) e^(-x^2/(4sigma^2)) e^(i k_0 x)\
|psi(x, 0)|^2 = (1/(2 pi sigma^2))^(1/2) e^(-x^2/(2sigma^2))"是Gauss函数"
$
初始时刻的波包是一个高斯函数,它的宽度是$sigma$,时间$t$之后,波函数演化为
$
psi(x, t) &= e^(-i/hbar hat(H) t) psi(x, 0)\
$
其中*自由粒子的哈密顿算符的本征函数是平面波*:
$
psi(x, t) &= e^(-i/hbar hat(H) t) psi(x, 0)\
&= e^(-i/hbar hat(H) t) 1/sqrt(2pi) integral e^(-i/hbar hat(H) t) psi(k) dd(k)\
&= 1/sqrt(2pi) integral e^(-i/hbar hat(H) t) phi(k) e^(i k x) dd(k)\
&= 1/sqrt(2pi) integral phi(k) e^(i k x - i (hbar k^2)/(2m) t) dd(k)\
&= (sqrt(2 pi)sigma(1 + (i hbar t)/(2 m sigma^2)))^(-1/2) e^(i (k_0 x - (hbar k_0^2)/(2 m) t) - (x - (hbar k_0 t)/m)^2/(2(2 sigma^2 + i hbar t/m)))
$
其中
$
phi(k) = ((2 sigma^2)/pi)^(1/4) e^(-sigma^2 (k - k_0)^2)
$
于是得到模方:
$
|psi(x, t)|^2 prop e^(-(x - (hbar k_0 t)/m)^2/(2(2 sigma^2 + (hbar^2 t^2)/(4 m^2 sigma^2))))
$
对照高斯分布表达式,可见时间$t$之后,波包中心运动速度为
$
x/t = (hbar k_0)/m = p_0/m = v_0
$
波包宽度变为
$
sigma_t = sigma sqrt(1 + (hbar^2 t^2)/(4 m^2 sigma^2))
$
波包宽度随时间增大,即波包发散。这反驳了薛定谔对其波函数即是粒子的夸大解释。
对于位置算符的本征态$delta(x)$,对其做时间演化:
$
e^( - i/hbar hat(H) t) delta(t) &= e^(- i/hbar hat(H) t) (1/sqrt(2 pi))^2 integral e^(i k x) dd(k)\
&= 1/(2 pi) integral e^(i k x - i (hbar k^2)/(2m) t) dd(k)\
&= sqrt(m/(2 pi i hbar t)) e^(-m x^2/(2 i hbar t)) e^(-i pi/4)
$
似乎在无穷远处也能有概率,这是超光速的。这就证明Schrodinger方程是非相对论的,不能描述高速粒子,在此时不再适用。
== 力学量平均值随时间的变化
对于力学量$hat(F)$,其平均值为:
$
macron(F) = integral psi^* hat(F) psi dd(x)
$
在推导过程中,并未要求$psi$的展开系数与时间无关。实际上这个公式对任意时刻$t$的波函数都适用
$
macron(F) = integral psi^* (x,t) hat(F) psi(x,t) dd(x)
$
如此便产生了平均值随时间变化的结果。平均值随时间变化的原因一般有:
- 力学量算符本身显含时间
- 力学量算符与哈密顿算符不对易
我们假设系统的哈密顿量是与时间无关的
$
dd(macron(F))/dd(t) = integral dd(psi^* (arrow(r),t))/dd(t) hat(F) psi(arrow(r),t) + psi^* (arrow(r),t) hat(F) dd(psi(arrow(r),t))/dd(t) dd(tau)
$
将薛定谔方程代入,得到
$
dd(macron(F))/dd(t) &= (1/i hbar) integral psi^* (arrow(r),t) hat(H) hat(F) psi(arrow(r),t) - psi^* (arrow(r),t) hat(F) hat(H) psi(arrow(r),t) dd(tau)\
&= (1/i hbar) integral psi^* (arrow(r),t) [hat(H), hat(F)] psi(arrow(r),t) dd(tau)
$
如果$hat(H)$和$hat(F)$对易,则平均值不随时间变化。这是量子力学中的一个重要结论,称为*Ehrenfest定理*:
$
dd(macron(F))/dd(t) = 1/(i hbar) macron([hat(H), hat(F)]) + macron( dd(hat(F))/dd(t))
$
从上面公式容易发现,力学量F平均值不变的充分条件是力学算符$hat(F)$本身不显含时间,同时$hat(F)$与哈密顿算符$hat(H)$对易。
这个条件也保证了力学量$F$可以和$H$(也就是能量)同时有确定值,或者说算符$hat(F)$和$hat(H)$有共同本征函数系。这时,描写算符$hat(F)$的本征值的那个量子数被称为*“好量子数”*。
*守恒量*的严格定义:*在任意态下(不管是否是定态)平均值和所有可能测值的概率都不随时间改变的物理量称为守恒量*。
== 对易与守恒量
*定理:如果力学量算符$hat(A)$不显含时间,且与也不显含时间的哈密顿算符$hat(H)$对易,则$A$为守恒量($hat(A)$在任意态下的平均值和所有可能测值的几率都守恒,不随时间变化)*
我们可以选取其共同本征函数系$(psi_n)$来展开任一波函数
$
psi(arrow(r), t) = sum_n a_n (t) psi_n (arrow(r))\
hat(H) psi_n = E_n psi_n\
hat(A) psi_n = a_n psi_n
$
于是在$n$态的概率随时间的变化为:
$
dd("")/dd(t) (a_n^* (t) a_n (t))
$
而$a_n$可以由本征函数正交归一化性质得出:
$
a_n (t) = integral psi_n^* psi dd(tau)
$
所以
$
dd("")/dd(t) a_n (t) &= integral psi^*_n dd("")/dd(t) psi dd(tau)\
&= integral psi^*_n 1/(i hbar) hat(H) psi dd(tau)\
&= 1/(i hbar) integral (hat(H) psi_n)^* psi_n dd(tau)\
&= 1/(i hbar) E_n integral psi_n^* psi_n dd(tau)\
&= E_n / (i hbar) a_n (t)
$
同理有:
$
dd("")/dd(t) a_n^* (t) = - E_n / (i hbar) a_n^* (t)
$
所以
$
dd("")/dd(t) (a_n^* (t) a_n (t)) = 0
$
也就是说,不论体系处于什么量子态下,如果$hat(A)$与$hat(H)$对易,则不仅$hat(A)$的力学量平均值为常数,其可能测值的概率分布也不随时间变化。
这一点与$hat(H)$本身的概率分布守恒是一致的。
设$t=0$时刻波函数满足$hat(A) psi(x,0) = A psi(x, 0)$,即在$psi(x,0)$态下的测量值为$A$的概率为$100%$。如果是$hat(A)$守恒量,那么在后续$t$时刻也还是这样,即(其中$hat(U)_t = e^(-i/hbar hat(H) t)$):
$
hat(A) hat(U)_t psi(x, 0) = A hat(U)_t psi(x, 0) = hat(U)_t A psi(x, 0) = hat(U)_t hat(A) psi(x, 0)
$
从而有:
$
hat(A) hat(U)_t = hat(U)_t hat(A)
$
对$t->0$可以推出:
$
[hat(A), hat(U)_t] = [hat(A), e^(-i/hbar hat(H) t)] = [hat(A), hat(H)] = 0
$
== 守恒量与能级简并
1.*如果系统有两个彼此不对易的守恒量,则系统能级一般简并*
设$hat(A)$和$hat(B)$是守恒量,则它们分别都和$hat(H)$对易。如果$psi$是$hat(H)$的对应于能量$E$的本征态,则$hat(A) psi$和$hat(B) psi$也都是属于$E$的本征态。如果$psi$是$hat(A)$和$hat(H)$的共同本征态:
$
hat(A) psi = A psi\
$
则一般$psi$不会是$hat(B)$的本征态(不对易力学量算符不能拥有共同完备本征函数集),也就是说
$
hat(B) psi != B psi = B/A hat(A) psi
$
也就是说$hat(A) psi$和$hat(B) psi$线性无关,即$E$能级是简并的。
例如$hat(L)_x$和$hat(L)_y$是守恒量,但它们不对易,所以氢原子的能级是简并的。
2.*如果体系有一个守恒量$A$和一个非简并的能级$E$,则此能级对应的本征态也是$hat(A)$的本征态*
这一能级$E$对应的本征态为$psi$,则因为守恒量$hat(A)$和哈密顿算符$hat(H)$对易,所以$hat(A) psi$也是$E$的本征态。又因为能级$E$无简并,所以$hat(A) psi$和$psi$线性相关,即$psi$是$hat(A)$的本征态。
例如一维线性谐振子能级无简并,宇称算符与$hat(H)$对易,所以谐振子的能量本征态必有确定的宇称
$
[hat(P), hat(H)] = 0\
hat(P) hat(H)(x) psi(x) = hat(H)(-x) psi(-x) = hat(H)(x) psi(-x) = hat(H)(x) hat(P) psi(x)
$
== 守恒量与定态
*守恒量是指任意态下平均值及其概率分布不随时间变化的力学量。*
*定态是指系统处于某一特定的能量本征态。*
- 如果力学量$A$是守恒量,那么不管系统处于定态与否,$A$都守恒。守恒量不一定取确定值。
- 如果$[hat(A),hat(H)]!=0$,则$A$的平均值一般会随时间变化,但在某些特殊态下也可能不变,例如一维谐振子基态的动量平均值。
- 如果系统处于定态,一切不显含时间的力学量都是守恒的。
- 如果$[hat(A),hat(H)]!=0$,而系统又处于非定态,则 A 的平均值一般随时间变化。
== 定态下力学量平均值——Virial定理
如果系统处于定态,则不显含时间的力学量都守恒。由于能量本征值单一,于是
$
macron(T) + macron(V) = macron(H) = E
$
其中$T$和$V$分别是哈密顿量中的动能和势能项,假设$V$仅仅是位置的函数。通过Virial定理,我们可以进一步定出$T$和$V$之间的关系。设$psi$为能级$E$的本征函数,则
$
(hat(T) + hat(V)) psi &= E psi\
sum_i hat(x)_i hat(p)_i (hat(T) + hat(V) - E) psi &= 0\
sum_i (hat(x)_i hat(T) hat(p)_i - hat(T) hat(x)_i hat(p)_i +hat(T) hat(x)_i hat(p)_i + hat(x)_i hat(p)_i hat(V) - hat(x)_i hat(V) hat(p)_i + hat(V) hat(x)_i hat(p)_i - E hat(x)_i hat(p)_i) psi &= 0\
sum_i ([hat(x)_i, hat(T)] hat(p)_i + hat(T) hat(x)_i hat(p)_i + hat(x)_i [hat(p)_i, hat(V)] + hat(V) hat(x)_i hat(p)_i - E hat(x)_i hat(p)_i) psi &= 0\
sum_i ([hat(x)_i, hat(T)] hat(p)_i + hat(x)_i [hat(p)_i, hat(V)] + (hat(T) + hat(V) - E) hat(x)_i hat(p)_i) psi &= 0\
$
第三步假设了$hat(V)$和$hat(p)_i$是对易的、$hat(T)$和$hat(x)_i$是对易的,利用:
$
[hat(x)_i, hat(T)] = i hbar hat(p)_i/m \
[hat(p)_i, hat(V)] = - i hbar (partial hat(V))/(partial x_i)
$
得到:
$
sum_i (i hbar hat(p)^2_i/m - i hbar hat(x)_i (partial hat(V))/(partial x_i) + (hat(T) + hat(V) - E) hat(x)_i hat(p)_i) psi &= 0\
(hat(p)^2/m - sum_i hat(x)_i (partial hat(V))/(partial x_i)) psi = (E - hat(T) - hat(V)) i/hbar sum_i hat(x)_i hat(p)_i psi\
integral psi^* (hat(p)^2/m - sum_i hat(x)_i (partial hat(V))/(partial x_i)) psi dd(tau) = integral psi^*(E - hat(T) - hat(V)) i/hbar sum_i hat(x)_i hat(p)_i psi dd(tau)\
macron(hat(p)^2/m) - macron(sum_i hat(x)_i (partial hat(V))/(partial x_i)) = (E - macron(T) - macron(V)) i/hbar macron(sum_i hat(x)_i hat(p)_i) = 0
$
最终得到*Virial定理*:
$
macron(T) = (1/2 macron(sum_i hat(x)_i partial/(partial x_i) hat(V)))
$
#newpara()
*一维谐振子利用Virial定理:*
$
V(x) = 1/2 m omega^2 x^2\
macron(T) = (1/2 macron(sum_i hat(x)_i partial/(partial x_i) hat(V))) = macron(V)
$
从而
$
macron(T) = macron(V) = 1/2 macron(H) = 1/2 E\
1/m macron(hat(p)^2) = m omega^2 macron(hat(x)^2) = E
$
对一维简谐振子定态
$
macron(hat(x)) = macron(hat(p)) = 0
$
有
$
1/m macron(Delta hat(p)^2) = m omega^2 macron(Delta hat(x)^2) = E\
1/m (Delta p)^2 = m omega^2 (Delta x)^2 = E\
Delta p = sqrt(m E), Delta x = sqrt(E/(m omega^2))\
Delta p Delta x = sqrt(m E) sqrt(E/(m omega^2)) = (n + 1/2) hbar
$
再一次印证了坐标-动量不确定关系,以及最小不确定态。
*氢原子利用Virial定理:*
对氢原子来说
$
V(arrow(r)) = - 1/(4 pi epsilon_0) e^2/arrow(r)
$
用Virial定理得到
$
macron(T) = (1/2 macron(sum_i hat(x)_i partial/(partial x_i) hat(V))) = - macron(V)
$
结合
$
macron(T) + macron(V) = macron(H) = E
$
得到
$
macron(V) = 2E , macron(T) = -E
$
这和Bohr轨道量子化计算结果一致。
== 波包的时间演化、Ehrenfest定理
知道了量子力学中力学量平均值随时间的变化规律,我们会问,这与经典力学中物体的运动规律有何不同?
在经典力学中,物体的运动规律体现于牛顿第二运动定律:
$
arrow(F) = m arrow(a) = dd(arrow(p))/dd(t)\
arrow(p) = m arrow(v) = m dd(arrow(r))/dd(t)
$
量子力学中哈密顿算符:
$
hat(H) = (hat(p)^2)/(2m) + V(hat(x))
$
于是有:
$
dd(arrow(r))/dd(t) = 1/(i hbar) macron([ hat(arrow(r)) , hat(H) ]) = 1/(i hbar) macron([hat(arrow(r)), hat(p)^2/(2m)]) = macron(arrow(p)/m)\
m dd(""^2 macron(arrow(r)))/dd(t)^2 = dd(macron(arrow(p)))/dd(t)\
dd(macron(arrow(p)))/dd(t) = 1/(i hbar) macron([hat(H), hat(arrow(p))]) = - macron(nabla V(arrow(r))) = macron(arrow(F) (arrow(r)))
$
于是得到Ehrenfest定理:
$
m dd(""^2 macron(arrow(r)))/dd(t)^2 = macron(arrow(F) (arrow(r)))
$
Ehrenfest定理与经典的牛顿方程极为相似。考虑一个波包的运动,如果其空间范围很窄,则方程右边可近似为
$
m dd(""^2 macron(arrow(r)))/dd(t)^2 = arrow(F) (macron(arrow(r)))
$
这是经典的结果。如果波包范围不是很窄,则与经典物理偏离较大。
=== 原子结构的探测
考虑$α$粒子被原子散射来探测原子结构,就需要:
- 在整个散射过程中$α$粒子的波包的大小远小于原子的尺度(1埃),粒子的德布罗意波长也要远小于原子的尺度
- 原子势场在波包大小的范围内变化不大,这样原子核对波包的平均作用力可以用原子核对波包中心的作用力代替
- 由于波包会随着时间扩散变大,所以由要求散射过程所需时间极短,使得在散射过程中波包本身大小变化不大
上述条件都满足的情况下,$α$粒子的散射就可以用经典力学的方法来处理(卢瑟福$α$粒子散射实验),或者说Ehrenfest定理适用,微观粒子波粒二象性中的粒子性性质占主导地位。
$
lambda = h/p = h/sqrt(2 m E)
$
=== 近似条件
在粒子波包足够窄的情况下,如果使定理的近似条件成立,还必须满足势场变化缓慢的条件。
$
F(x) = - (partial V(x))/(partial x) = - (partial V(macron(x)))/(partial macron(x)) - (partial^2 V(macron(x)))/(partial macron(x)^2) (x - macron(x)) + 1/2 (partial^3 V(macron(x)))/(partial macron(x)^3) (x - macron(x))^2 + ...
$
如果要满足
$
macron(F(x)) = F(macron(x))
$
则要求
$
1/2 abs((partial^3 V(macron(x)))/(partial macron(x)^3) (x - macron(x))^2) << abs((partial V(macron(x)))/(partial macron(x)))
$
如果势能函数最多包含坐标的二次幂(线性、谐振子势场),则这个条件是满足的。
#pagebreak(weak: true)
= ⼳正算符和体系对称性
== 幺正算符(酉算子)
如果线性算符$hat(U)$的逆算符$hat(U)^(-1)$存在,且对于任意两个波函数$psi$和$phi$,有
$
integral psi^* phi dd(tau) = integral (hat(U) psi)^* (hat(U) phi) dd(tau)
$
则称算符$hat(U)$为幺正算符(Unitary)。
幺正算符相当于对波函数做幺正变换,而不改变波函数的内积,保持了波函数的正交归一性(经典物理中坐标旋转变换)。
有性质:
$
hat(U)^dagger hat(U) = hat(U) hat(U)^dagger = I\
hat(U)^(-1) = hat(U)^dagger
$
- 若$hat(U)$幺正,则$hat(U)^dagger$也是幺正的。
- 若$hat(U)$和$hat(V)$都是幺正的,则$hat(U) hat(V)$也是幺正的。
== 生成元
幺正算符包括单位算符$I$,如果幺正算符依赖于一个连续变化的参量$epsilon$(如空间旋转、时间平移等),即$hat(U) = hat(U)(epsilon)$,有如下性质
$
hat(U)(0) &= I\
hat(U)(epsilon_1) hat(U)(epsilon_2) &= hat(U)(epsilon_1 + epsilon_2)\
$
则在$epsilon→0$时,$hat(U)$能展开为
$
hat(U)(epsilon) = I + i epsilon hat(F) + O(epsilon^2)
$
利用$hat(U)$的幺正性,可以得到$hat(F)$的厄密性:
$
hat(U)^dagger hat(U) = (I - i epsilon hat(F)^dagger) (I + i epsilon hat(F)) = I - i epsilon (hat(F) - hat(F)^dagger)= I\
hat(F) = hat(F)^dagger
$
称$hat(F)$为$hat(U)$的*生成元*。
如果$hat(U)$不是无限接近$I$的,我们可以通过$n$次无限小的幺正操作实现任意有限大小参量$a$的幺正变换:
$
hat(U)(a) = lim_(n→oo) (hat(U)(a/n))^n = lim_(n→oo) (I + i a/n hat(F))^n = e^(i a hat(F))
$
算符出现在指数上也可以通过泰勒展开式来理解:
$
hat(U) = e^(i a hat(F)) = sum_(n = 0)^oo (i a hat(F))^n/n!
$
#newpara()
例:时间演化算符就是一个幺正算符
$
hat(U)(t) = e^(-i/hbar hat(H) t), psi(arrow(r), t) = hat(U)(t) psi(arrow(r), 0)
$
通过幺正算符的性质,可以得到
$
hat(U)^dagger (t) = hat(U)^(-1) (t) = hat(U)(-t)
$
从而得到
$
integral psi^* (arrow(r), t) psi(arrow(r), t) dd(tau) &= integral (hat(U)(t) psi)^* (hat(U)(t) psi) dd(tau) \
&= integral psi^*(arrow(r), 0) hat(U)^dagger (t) hat(U)(t) psi(arrow(r), 0) dd(tau) \
&= integral psi^*(arrow(r), 0) psi(arrow(r), 0) dd(tau) \
&= 1
$
== 量子不可克隆原理
*不可能有这样一台设备,能够完美复制任意量子比特,而不对此量子比特产生干扰。*
证:设任意量子比特$A$的波函数为$psi(x)$,复制前某量子比特$B$的波函数为$phi(y)$,复制之后变为和$A$相同,即$psi(y)$。要改变$B$的量子状态,可以通过测量,或者调整系统哈密顿算符,使得经过时间演化后$B$和$A$的状态相等。测量可能会改变$A$的状态,所以我们使用时间演化算符$hat(U)(t)$ ,对系统$( A + B )$做一个幺正变换。
#grid(
columns: 3,
inset: 8pt,
[初态],[$U(U) (t)$],[末态],
[$psi(x) phi(y)$],[$->$],[$psi(x) psi(y)$],
[$psi'(x) phi(y)$],[$->$],[$psi'(x) psi'(y)$]
)
其中$psi(x)$和$psi'(x)$是$A$的两个任意量子态。两个初态波函数内积
$
integral integral psi^*(x) psi'(x) phi^*(y) phi(y) dd(x) dd(y) = integral psi^*(x) psi'(x) dd(x) = a
$
而末态内积为
$
integral integral psi^*(x) psi'(x) psi^*(y) psi'(y) dd(x) dd(y) = a^2
$
一般来说$a^2 != a$ ,除非$a = 0,1$,与$psi$和$psi'$的任意性相悖,于是证明了量子不可克隆。
== 幺正算符和幺正变换
用幺正算符实现的波函数和算符的变换称为幺正变换:
$
psi &-> &psi' = hat(U) psi\
hat(A) &-> &hat(A') = hat(U) hat(A) hat(U)^dagger
$
与经典物理中的坐标变换相似,幺正变换不改变系统的物理规律(算符方程、对易关系、平均值及概率):
$
hat(A) psi = phi => hat(A') psi' = phi'\
hat(A)' psi' = hat(U) hat(A) hat(U)^dagger hat(U) psi = hat(U) hat(A) psi = hat(U) phi = phi'
$
强调:这里的变换是*波函数和算符同时变换*,如果只变换其中一个,则量子系统的物理就有可能改变。
== Fourier变换
傅里叶变换也可以看作是一种幺正变换:
$
hat(U) psi(x) = 1/sqrt(2 pi hbar) integral dd(x) e^(-i/hbar p x) psi(x) = phi(p)\
hat(U)^dagger phi(p) = 1/sqrt(2 pi hbar) integral dd(p) e^(i/hbar p x) phi(p) = psi(x)
$
可以证明:
$
integral psi^*(x) phi(x) dd(x) = integral phi^*(p) phi(p) dd(p) = 1
$
_证明:_
$
hat(U) hat(U)^(-1) &= 1/sqrt(2 pi hbar) integral dd(x) e^(-i/hbar p x) 1/sqrt(2 pi hbar) integral dd(p') e^(i/hbar p' x)\
&= integral dd(p') 1/(2 pi hbar) integral dd(x) e^(i/hbar (p' - p) x)\
&= integral dd(p') delta(p' - p)\
&= 1_(p' -> p)
$
注意这事实上是两个算符分别操作,后面的$hat(U)^(-1)$中的变量是$p'$而不是$p$, $1_(p' -> p)$表示单位算符,但是要把自变量$p'$换为$p$。
傅里叶幺正变换对动量算符的变换:
$
hat(U) hat(p^2)/(2m) hat(U)^dagger &= 1/sqrt(2 pi hbar) integral dd(x) e^(-i/hbar p x) hat(p^2)/(2m) 1/sqrt(2 pi hbar) integral dd(p') e^(i/hbar p' x)\
&= 1/sqrt(2 pi hbar) integral dd(x) e^(-i/hbar p x) (-hbar^2)/(2m) dd("")^2/dd(x)^2 1/sqrt(2 pi hbar) integral dd(p') e^(i/hbar p' x)\
&= 1/sqrt(2 pi hbar) integral dd(x) e^(-i/hbar p x) 1/sqrt(2 pi hbar) integral dd(p') p'^2/(2m) e^(i/hbar p' x)\
&= integral dd(p') p'^2/(2m) 1/(2 pi hbar) integral dd(x) e^(i/hbar (p' - p) x)\
&= integral dd(p') p'^2/(2m) delta(p' - p)\
&= p^2/(2m) 1_(p' -> p)
$
#newpara()
傅里叶幺正变换对坐标算符的变换:
$
hat(U) hat(x) hat(U)^dagger &= 1/sqrt(2 pi hbar) integral dd(x) e^(-i/hbar p x) x 1/sqrt(2 pi hbar) integral dd(p') e^(i/hbar p' x)\
&= 1/sqrt(2 pi hbar) i hbar dd("")/dd(p) integral dd(x) e^(-i/hbar p x) 1/sqrt(2 pi hbar) integral dd(p') e^(i/hbar p' x)\
&= i hbar dd("")/dd(p) integral dd(p') delta(p' - p)\
&= i hbar dd("")/dd(p) 1_(p' -> p)
$
推广得到
$
hat(U) hat(x)^n hat(U)^dagger = (i hbar dd("")/dd(p))^n 1_(p' -> p)
$
#newpara()
傅里叶幺正变换对哈密顿算符的变换:
$
hat(U) hat(H) hat(U)^dagger &= hat(U) (hat(p)^2/(2m) + V(hat(x))) hat(U)^dagger\
&= p^2/(2m) + V(i hbar dd("")/dd(p))
$
也就是说,在*坐标表象*中,哈密顿算符形式为
$
hat(H) = - hbar^2/(2m) dd("")^2/dd(x)^2 + V(x)
$
幺正变换到*动量表象*中,哈密顿算符形式为
$
hat(H) = p^2/(2m) + V(i hbar dd("")/dd(p))
$
#newpara()
在坐标表象下算符替换为:
$
cases(
hat(p) -> - i hbar dd("")/dd(x),
hat(x) -> x
)
$
而在动量表象下算符替换为:
$
cases(
hat(p) -> p,
hat(x) -> i hbar dd("")/dd(p)
)
$
== 态和力学量的表象
在量子力学中,描写量子态和力学量算符的方式不是唯一的。一种具体的方式称为一种表象。
一维空间态的表象:
用$psi(x,t)$来描写量子态是坐标表象。按动量本征函数展开
$
psi(x,t) = integral c(p,t) phi_p (x) dd(p) , phi_p (x) = 1/sqrt(2 pi hbar) e^(i/hbar p x)
$
就变换到了动量表象,$c(p, t)$称为动量表象中的波函数
$
c(p,t) = integral psi^*_p (x) psi(x,t) dd(x), psi^*_p (x) = 1/sqrt(2 pi hbar) e^(-i/hbar p x)
$
#newpara()
坐标表象的优点:
- 容易根据具体的物理问题的要求写出波函数满足的边界条件,分束缚态和散射态;根据粒子的入射方向写出入射波、透射波和反射波
- 一些常见的势在坐标表象下是定域的
- 容易讨论量子力学和经典力学的关系
坐标表象中的定态薛定鄂方程:
$
(- hbar^2/(2m) dd("")^2/dd(x)^2 + V(x)) psi (x) = E psi (x)
$
动量表象中的定态薛定鄂方程:
$
(p^2/(2m) + V(i hbar dd("")/dd(p))) phi (p) = E phi (p)
$
*表象之间的变换是一种幺正变换*。
=== 简谐振子的傅里叶变换
一维简谐振子的哈密顿算符为
$
hat(H) = hat(p)^2/(2m) + 1/2 m omega^2 hat(x)^2
$
在坐标表象中,哈密顿算符形式为
$
hat(H) = - hbar^2/(2m) dd("")^2/dd(x)^2 + 1/2 m omega^2 x^2
$
幺正变换到动量表象中后,其形式为
$
hat(H) = p^2/(2m) + 1/2 m omega^2 (i hbar dd("")/dd(p))^2 = p^2/(2m) - 1/2 m omega^2 hbar^2 dd("")^2/dd(p)^2
$
=== 坐标表象和动量表象
#figure(
three-line-table[
| 符号| 坐标表象| 动量表象|
| --| --| --|
|$hat(x)$ | $x$ | $i hbar dd("")/dd(p)$|
|$hat(p)$ | $- i hbar dd("")/dd(x)$ | $p$|
| $hat(x)$本征态 | $delta(x - x')$| $1/sqrt(2 pi hbar) e^(i/hbar p x)$|
| $hat(p)$本征态 | $1/sqrt(2 pi hbar) e^(-i/hbar p x)$ | $delta(p - p')$|
],
caption: [
坐标表象和动量表象
],
kind: table
)
== 幺正变换与系统对称性
前面说过,对波函数和算符同时进行幺正变换,量子力学规律不变。但如果只变换波函数,则量子力学规律可能改变。
_把假设条件加强,如果只对波函数或算符二者其一进行幺正变换,而量子力学规律不变,会有什么物理结果?_
首先证明二者是等价的。薛定鄂方程:
$
i hbar partial/(partial t) psi = hat(H) psi
$
对$psi$进行幺正变换$psi -> psi' = hat(U) psi$,得到
$
i hbar partial/(partial t) psi' &= hat(H) psi'\
i hbar partial/(partial t) (hat(U) psi) &= hat(H) (hat(U) psi)\
$
用算符$hat(U)^(-1)$从左边作用于方程两边。因为我们一般考虑的幺正算符都是与时间无关的,所以$hat(U)^(-1)$可以越过时间偏导算符作用于右方
$
i hbar hat(U)^(-1) partial/(partial t) psi' &= hat(U)^(-1) hat(H) hat(U) psi\
$
与原薛定鄂方程作对比,同时注意到$psi$是薛定鄂方程的任意解,所以有
$
hat(H) = hat(U)^(-1) hat(H) hat(U)
$
也就是说,*只对波函数进行幺正变换而量子力学规律不变,可以等效为只对系统算符进行幺正变换而量子力学规律不变*。
哈密顿算符$hat(H)$幺正变换不变的意义:
$
hat(U) hat(H) hat(U)^(-1)= hat(H) \
[hat(U), hat(H)] = 0\
[1 + i epsilon hat(F), hat(H)] = 0\
[hat(F), hat(H)] = 0
$
也就是说,如果*哈密顿算符幺正变换不变,那么此幺正变换对应的生成元是守恒量*。
*Noether定理的量子版本*:每当量子系统存在一种对称性($hat(H)$幺正不变性),就相应的存在一个守恒律和守恒量。
=== 守恒和$hat(H)$幺正不变性
前面讲过,如果$hat(A)$是守恒量,则$[hat(A), hat(H)] = 0$。
#figure(
image("pic/2024-04-12-14-52-21.png", width: 80%),
caption: [
量子系统的对称性与守恒量
],
)
在以为生成元的幺正算符 Ü =的幺正变换下不变。和以为生成元的幺正算符 Ü = e “对易百和对易。时间演化算符 Ü =声每 IIÄ 对易。在时间演化算符 Ü = e [的幺正变换下不变。
=== 时间均匀性和能量守恒
设时间幺正算符把波函数时间平移(主动)$tau$:
$
hat(U) (tau) psi(x, t) = psi(x, t - tau)
$
对变化后的波函数做泰勒展开:
$
psi(x, t - tau) &= sum^oo_(n=0) 1/n! (- tau dd("")/dd(t))^n psi(x, t)\
&= sum^oo_(n=0) 1/n! ((i tau)/hbar hat(H))^n psi(x, t)\
&= e^(i/hbar tau hat(H)) psi(x, t)
$
用到了薛定鄂方程($hat(H)$不含时):
$
dd(psi)/dd(t) = hat(H)/(i hbar) psi\
(dd("")/dd(t))^n psi = (hat(H)/(i hbar))^n psi\
$
从而得到
$
psi(t - tau) = sum_(n=0)^oo (i/hbar tau hat(H))^n/n! psi(t) = e^(i/hbar tau hat(H)) psi(t)
$
得到时间平移算符:
$
hat(U) (tau) = e^(i/hbar tau hat(H))
$
另外时间演化算符和时间平移算符没有必然的联系,但是有时二者可以达到相同的效果。
设$t_1$时刻的波函数是能量本征态$psi(x,t_1) = phi_n(x) e^(-i E_n t_1/hbar)$,在这个态下测得$E_n$的概率为100%,在$t_2$时刻下:
$
psi(x, t_2) &=^"时间演化算符" e^(-i/hbar hat(H) (t_2 - t_1)) psi(x,t_1)\
&=^"时间平移算符" e^(i E_n (t_1 - t_2)/hbar) psi(x,t_1)\
&= psi(x, t_1 - (t_1 - t_2))\
&= psi(x,t_2)
$
根据$hat(A) psi = A psi$时,$f(hat(A)) psi = f(A) psi$,有
$
psi(x , t_2) = e^(i/hbar E_n (t_2 - t_1)) psi(x, t_1)
$
相当于乘了一个常数相位因子,所以在$psi(x,t_2)$下测得的能量$E_n$概率仍然是100%,系统能量守恒。
时间平移算符的生成元为$hat(H)$,它当然是与自身对易的,也就是说($hat(H)$不显含时间时)系统的能量是个守恒量。
*时间平移不变性等价于系统能量守恒。*
=== 空间均匀性和动量守恒
设空间幺正算符把波函数坐标平移(主动)$arrow(a)$:
$
hat(U) (arrow(a)) psi(arrow(r)) = psi(arrow(r) - arrow(a))
$
对变化后的波函数做泰勒展开:
$
psi(arrow(r) - arrow(a)) &= sum^oo_(n=0) 1/n! (- arrow(a) dot nabla)^n psi(arrow(r))\
&= e^(- i arrow(a) dot nabla) psi(arrow(r))\
&= e^(- i/hbar arrow(a) dot hat(arrow(p))) psi(arrow(r))
$
这里$hat(p)$是动量算符。得到空间平移算符:
$
hat(U) (arrow(a)) = e^(- i/hbar arrow(a) dot hat(arrow(p)))
$
空间平移算符的生成元为动量算符。
*空间平移不变性等价于系统动量守恒。*
平移不变不是数学上波函数不变,而是带入Schrodinger方程后,波函数的形式不变。
#figure(
image("pic/2024-04-17-13-46-55.png", width: 80%),
caption: [
空间均匀性和动量守恒
],
)
显然,一般情况下$hat(p)$和$hat(H)$算符并不对易(氢原子中的电子、一维谐振子),但如果考虑的是孤立系统,则系统总的$hat(p)$和$hat(H)$算符一定对易(自由粒子、电子+氢原子核总系统)。
自由粒子波包:平均动量守恒,动量的分布概率也守恒(也就是说$Δ p$不变),但不同动量平面波的传播速度不同,导致波包的$Δ x$随时间增大,形成波包的弥散(色散)。
相比之下,光在真空中传播则没有色散现象。
=== 空间各向同性和角动量守恒
设空间幺正算符把波函数绕$arrow(e)_n$旋转(主动)小角度$alpha$:
$
hat(U) (arrow(alpha)) psi(arrow(r)) = psi(arrow(r) - Delta arrow(r)), arrow(alpha) = alpha arrow(e)_n
$
对变化后的波函数做泰勒展开:
$
psi(arrow(r) - Delta arrow(r)) &= sum^oo_(n=0) 1/n! (- Delta arrow(r) dot nabla)^n psi(arrow(r))\
&= sum_(i=0)^oo 1/n! ( - (arrow(alpha) crossproduct arrow(r) ) dot nabla)^n psi(arrow(r))\
&= sum_(i=0)^oo 1/n! ( - arrow(alpha) dot (arrow(r) crossproduct nabla))^n psi(arrow(r))\
&= e^(- i/hbar arrow(alpha) dot hat(arrow(L)))psi(arrow(r))
$
这里$hat(L)$是角动量算符。得到空间旋转算符:
$
hat(U) (arrow(alpha)) = e^(- i/hbar arrow(alpha) dot hat(arrow(L)))
$
空间旋转算符的生成元为角动量算符。
*空间旋转不变性等价于系统角动量守恒。*
例:
$
e^(-i/hbar arrow(alpha) dot hat(arrow(L))) Y_(l m) (theta, phi) = sum_(m = -l)^l c_m Y_(l m) (theta, phi)
$
对于中心力场问题(氢原子),哈密顿算符在空间转动变换下不变,因而角动量的三个分量都是守恒量。
能量守恒、动量守恒、角动量守恒都是时空对称性的体现,这在经典物理学中都有。但是,量子物理学还有经典中没有的更丰富的对称性,如空间反射和全同粒子交换对称性等——系统内禀对称性。
=== 空间反射对称性和宇称守恒
宇称(parity)算符$hat(P)$
$
hat(P) psi(arrow(r)) = psi(- arrow(r))
$
则有
$
hat(P)^2 = I\
hat(P)^(-1) = hat(P)\
hat(P)^dagger = hat(P)
$
宇称算符是一个厄米算符也是幺正算符。
由于$hat(P)^2 = 1$,$hat(P)$只有两个本征值$plus.minus 1$,对应的本征函数分别是对称波函数和反对称波函数。
根据本征函数完备性,任一波函数都可以展开为$hat(P)$的本征函数的叠加(对称和反对称部分):
$
psi(arrow(r)) = psi_s(arrow(r)) + psi_a(arrow(r))
$
由于宇称是内禀的,所以没有经典对应力学量。
如果系统宇称守恒,且系统能级是非简并的,则系统能量本征态必有确定的宇称。从而一维束缚态势能对称情况下系统本征态必有确定的宇称宇称守恒的系统并不一定处于宇称的本征态。
对于多粒子系统,系统的总宇称是各部分相乘的,而能量等力学量的本征值是相加的。
对于核或粒子物理反应:
$
a + b -> c + d
$
系统初末态的总宇称为$P_a P_b P_(a b)$和$P_c P_d P_(c d)$,其中$P_a$为内禀宇称,而$P_(a b)$为轨道宇称。如果系统处于$Y_(l m)$态,则
$
P_(a b) = (-1)^l\
$
若反应过程宇称守恒(哈密顿量中相关势能项与宇称算符对易),则
$
P_a P_b (-1)^l = P_c P_d (-1)^l'
$
人们一般期待所有自界的基本相互作用力都是宇称不变的。但是在弱相互作用中,宇称守恒恰恰被彻底打破了。
*弱相互作用的宇称破坏*
$
arrow(r) ->^hat(P) - arrow(r)\
arrow(p) ->^hat(P) - arrow(p)\
arrow(L) ->^hat(P) arrow(L)\
arrow(mu) ->^hat(P) arrow(mu)
$
我们注意下面的几个命题。
系统处于$psi = c_1 phi_1 + c_2 phi_2 + c_3 phi_3 + ...$态,其中$phi_i$是$hat(P)$的本征态。那么系统处于$psi' = c'_1 phi_1 + c'_2 phi_2$态($|c'_1|^2 + |c'_2|^2 = 1$)的概率为
$
|c'_1^* c_1 + c'_2^* c_2|^2
$
证明可以用基变换,把$psi' = c'_1 phi_1 + c'_2 phi_2$变成第一维度的基矢量。
另外若系统处于$psi$态,则$t$时间后,系统处于$psi'$态的概率为
$
abs(integral psi'^* e^(- i/hbar hat(H) t) psi dd(tau))^2
$
#newpara()
在$beta$衰变过程发生的概率幅就是
$
A = integral psi_f^* e^(i/hbar hat(H) t) psi_i dd(tau)
$
如果宇称守恒则有$[hat(P), hat(H)] = 0$,也就是$hat(P) hat(H)^n hat(P) = hat(H)^n$,所以
$
hat(P) e^(i/hbar hat(H) t) hat(P) = e^(i/hbar hat(H) t)
$
从而
$
A' = integral (hat(P) psi_f)^* e^(i/hbar hat(H) t) (hat(P) psi_i )dd(tau) = integral psi_f^* e^(i/hbar hat(H) t) psi_i dd(tau) = A
$
其中$psi_i,psi_f$不必是本征态。从而$|A|^2 = |A'|^2$,是宇称守恒的必要条件。
#pagebreak(weak: true)
= 全同粒子体系
== 多粒子体系的描写
由$N$个离子组成的体系。体系的波函数应该和所有粒子的坐标以及时间有关:
$
psi(arrow(r)_1, arrow(r)_2, ..., arrow(r)_N, t)
$
“坐标”$q$包括粒子的空间坐标和自旋量子数(也许还有其它的“内部”量子数)。体系的Hamiltonian算符是:
$
hat(H) = sum_(i=1)^N (- hbar^2/(2m_i) nabla_i^2 + U_i(q_i)) + V(q_1, q_2, ..., q_N)
$
其中包括了各个粒子的动能之和,在外场中的势能$U$,以及粒子间的相互作用势能$V$,由此即可写出体系的Schrödinger方程。
== 全同粒子的不可区分性
假设多粒子体系中的 N 个粒子是全同粒子,即质量、电荷、总自旋等内在性质完全相同的粒子。全同粒子体系例如多电子原子中的电子、固体中的“公用"电子、原子核中的核子等在量子力学中,全同粒子体系与非全同粒子体系有更多的区别。
在经典力学中,即使两个粒子是全同的,它们也仍然是可区别的,因为它们各自有自己的轨道。
但是在量子力学中,粒子的状态用波函数描写,当两个粒子的波函数在空间中发生重叠的时候,我们无法区分哪个是“第一个”粒子,哪个是“第二个”粒子。所以在量子理论中有*全同粒子不可区别性原理*:当一个全同粒子体系中各粒子的波函数有重叠的时候,这些全同粒子是不可区别的。
== 波函数的交换对称性和粒子的统计性
粒子交换算符$hat(P)_(i j)$,交换粒子$i$和粒子$j$的坐标:
$
hat(P)_(i j) psi(arrow(r)_1, arrow(r)_2, ..., arrow(r)_N) = psi(arrow(r)_1, arrow(r)_2, ..., arrow(r)_j, ..., arrow(r)_i, ..., arrow(r)_N)
$
全同粒子的不可区别性告诉我们:这样交换以后的状态与原来的状态是不可区别的,所以,按照量子力学的基本原理,这两个状态应该是相同的,即
$
hat(P)_(i j) psi = C psi
$
得到$C = ±1$,这个$C$称为粒子的统计性。
- 如果$C = 1$,则称为玻色子,玻色子的波函数是对称的,满足波函数交换对称性。
- 如果$C = -1$,则称为费米子,费米子的波函数是反对称的,满足波函数交换对称性。
交换对称性或反对称性是全同粒子体系波函数的特殊的、固有的性质,因此也是(微观)粒子的特殊的、固有的性质。它决定了粒子所服从的统计规律。
- 自旋为整数的粒子,波函数是交换对称的,服从Bose-Einstein统计,称为玻色子。例如光子(自旋为1)、介子(自旋为0)
- 自旋为半整数的粒子,波函数是交换反对称的,服从Fermi-Dirac统计,称为费米子。例如电子、质子、中子(自旋都是ℏ/2)
原子核、原子、分子这样的粒子是由质子、中子、电子这些更“基本的”粒子组成的,我们把它们称为“复合粒子”。如果复合粒子的内部自由度是“冻结”的,我们也可以把它们看做是“基本”粒子。如果一个复合粒子包含偶数个费米子,那么它是玻色子;如果它包含奇数个费米子,那么它还是费米子。它所包含的玻色子的数目对此毫无影响。
事实上,这正是因为偶数个费米子的总自旋一定是整数,而奇数个费米子的总自旋一定是半整数,这一点可以由角动量的合成规则得到说明。
== 交换对称或反对称波函数的构成
一般地说,一个全同粒子体系的波函数是解 schrödinger 方程得到的,未必有确定的交换对称性。所以我们要对它进行“对称化”或“反对称化”。这里只考虑比较简单的情形:*无耦合体系*,即体系的总波函数是单个粒子波函数的乘积:
$
psi(q_1, ..., q_N) = psi_1 (q_1) psi_2 (q_2) ... psi_N (q_N)
$
这称为单粒子近似。
以二粒子体系为例,单粒子近似的波函数是:
$
psi(q_1, q_2) = psi_1(q_1) psi_2(q_2)
$
对称化的波函数是:
$
psi_s(q_1, q_2) = 1/sqrt(2) (psi_1(q_1) psi_2(q_2) + psi_2(q_1) psi_1(q_2))
$
反对称化的波函数是:
$
psi_a(q_1, q_2) = 1/sqrt(2) (psi_1(q_1) psi_2(q_2) - psi_2(q_1) psi_1(q_2))
$
对于可区别粒子(波函数$psi_1$或$psi_2$),我们可以说系统状态是“第一个粒子处于状态$psi_1$,第二个粒子处于状态$psi_2$”。但对于不可区别粒子(波函数$psi_S$或$psi_A$),我们只能说“有一个粒子处于状态$psi_1$,一个粒子处于状态$psi_2$”。
类似的做法可以推广到N个粒子的体系。特别是,一般的反对称化波函数是*Slater行列式:*
$
psi_a (q_1, q_2, ..., q_N) = 1/sqrt(N!) det mat(
psi_1 (q_1), psi_2 (q_1), ..., psi_N (q_1);
psi_1 (q_2), psi_2 (q_2), ..., psi_N (q_2);
dots.v, dots.v, dots.down, dots.v;
psi_1 (q_N), psi_2 (q_N), ..., psi_N (q_N)
)
$
在$psi_i$中有两个是相同的函数时:
$
psi_a (q_1, q_2, ..., q_N) = 0
$
*Pauli不相容原理*:不可能有两个或更多的费米子处于完全相同的量子状态中。这是量子力学基本公理之一,它在统计物理中起重要的作用。
例如,对于两个粒子经典中:
$
ket(<->)ket(arrow.t.b) , ket(arrow.t.b)ket(<->), ket(arrow.t.b)ket(arrow.t.b), ket(<->)ket(<->)
$
而在量子力学中的两个光子:
$
ket(<->)ket(arrow.t.b) + ket(arrow.t.b)ket(<->), ket(arrow.t.b)ket(arrow.t.b), ket(<->)ket(<->)
$
只有上面三种等概率的状态出现。
== 微观粒子波动性的表现
到目前为止,我们已经了解了量子力学的一系列与经典物理不同的表现:
- 粒子的运动由波函数决定,是几率性的,其动力学演化由薛定鄂方程决定
- 力学量测量值由波函数本征值决定,其平均值是相应力学量算符在波函数中的积分平均
- 力学量之间能否同时取确定值由力学量算符之间的对易关系决定;不能同时取确定值的情况导致不确定关系
这些特性都是粒子的波动性在*单粒子*身上的表现。*粒子的波动性反映在多粒子系统中就是全同性原理。*
正是由于全同性原理植根于波动性原理,它比其它原理(如系统反射对称性)显得更为基本。例:系统能量本征态不一定就是宇称本征态,但是任何多粒子系统不管处于什么态,在波函数叠加区域它一定处于全同粒子交换算符的本征态。
这个原理也可以带来超距作用的量子纠缠。
== 多粒子系统的算符
我们认为不同粒子的算符是对易的。
多粒子系统本身就带来了某些单粒子系统中没有的复杂性。例如对单粒子来说:
$
[hat(x), hat(p)] = i hbar
$
而对多粒子系统来说,由于不同粒子的坐标和动量是对易的,所以
$
[hat(x)_1 - hat(x)_2, hat(p)_1 + hat(p)_2] = 0
$
所以可以构造一个波函数,使得它是$hat(x)_1 - hat(x)_2$的本征函数,同时也是$hat(p)_1 + hat(p)_2$的本征函数。
在多粒子系统中,虽然属于不同粒子的力学量算符都相互对易,也就是说可以同时取确定的值,但是这些可能的测值之间却可以有某种关联(量子纠缠、非定域性、爱因斯坦之问),对这些问题的研究一直处于量子力学的前沿领域。
== Pauli不相容原理
最初不相容原理是Pauli综合反常塞曼效应、原子不同壳层电子数为偶数等现象归纳得到的,Pauli引入了电子自旋的概念来解释壳外电子的填充规律。
粒子物理后来发展中遇到了$Delta^(++)$粒子:
$
Delta^(++) = u u u
$
这个粒子由三个同样的顶夸克组成,电荷一样,自旋相同(同向),同时局限于一个狭小的空间之中(波函数重叠),似乎违背了Pauli不相容原理。
后来发现它们还有一个量子数不同-色电荷(color)。色是量子色动力学的基础,它有三种(不妨设为红、绿、蓝)。三个夸克拥有不同的色荷量子数,所以Pauli不相容原理没有被打破。
== 全同粒子的干涉效应
两个自由粒子的空间波函数:
1. 不考虑全同性(非全同粒子波函数)
$
psi(arrow(r)_1, arrow(r)_2) = 1/(2 pi)^3 e^(i arrow(k)_1 dot arrow(r)_1) e^(i arrow(k)_2 dot arrow(r)_2)
$
引入质心系坐标$arrow(R) = (arrow(r)_1 + arrow(r)_2)/2$和相对坐标$arrow(r) = arrow(r)_1 - arrow(r)_2$,总波矢$arrow(K) = arrow(k)_1 + arrow(k)_2$,相对波矢$arrow(k) = (arrow(k)_1 - arrow(k)_2)/2$,则
$
psi(arrow(R), arrow(r)) = 1/(2 pi)^3 e^(i arrow(K) dot arrow(R)) e^(i arrow(k) dot arrow(r))
$
在以一个粒子为中心,半径$r→r+dd(r)$的球壳内找到另一个粒子的几率密度为:
$
P(r) = integral |psi(arrow(R), arrow(r))|^2 dd(""^3arrow(R)) r^2 dd(omega) = A/(4 pi) r^2 integral dd(omega) = A r^2
$
2. 两个全同玻色子
$
psi_+ (arrow(r)_1, arrow(r)_2) = 1/sqrt(2) (psi(arrow(r)_1) psi(arrow(r)_2) + psi(arrow(r)_2) psi(arrow(r)_1))
$
从而
$
psi_+ (arrow(R), arrow(r)) = 1/(2 pi)^3 e^(i arrow(K) dot arrow(R))1/sqrt(2) (e^(i arrow(k) dot arrow(r)) + e^(i arrow(k) dot arrow(r))) = 1/(2 pi)^3 e^(i arrow(K) dot arrow(R)) sqrt(2) cos(arrow(k) dot arrow(r))
$
在以一个粒子为中心,半径$r→r+dd(r)$的球壳内找到另一个粒子的几率密度为:
$
P(r) = integral |psi_+ (arrow(R), arrow(r))|^2 dd(""^3arrow(R)) r^2 dd(omega) = A/(4 pi) r^2 integral 2 cos^2(k r cos theta)dd(omega) = A r^2 (1 + (sin 2 k r)/(2 k r))
$
3. 两个全同费米子
$
psi_- (arrow(r)_1, arrow(r)_2) = 1/sqrt(2) (psi(arrow(r)_1) psi(arrow(r)_2) - psi(arrow(r)_2) psi(arrow(r)_1))
$
从而
$
psi_- (arrow(R), arrow(r)) = 1/(2 pi)^3 e^(i arrow(K) dot arrow(R))1/sqrt(2) (e^(i arrow(k) dot arrow(r)) - e^(i arrow(k) dot arrow(r))) = 1/(2 pi)^3 e^(i arrow(K) dot arrow(R)) sqrt(2) sin(arrow(k) dot arrow(r))
$
在以一个粒子为中心,半径$r→r+dd(r)$的球壳内找到另一个粒子的几率密度为:
$
P(r) = integral |psi_- (arrow(R), arrow(r))|^2 dd(""^3arrow(R)) r^2 dd(omega) = A/(4 pi) r^2 integral 2 sin^2(k r cos theta)dd(omega) = A r^2 (1 - (sin 2 k r)/(2 k r))
$
#figure(
image("pic/2024-04-19-14-29-51.png", width: 80%),
caption: [
全同粒子的干涉效应
],
)
- 对称空间波函数 → 两粒子相互靠近的几率增大
- 反对称空间波函数 → 两粒子相互排斥的几率增大
似乎在全同粒子间存在一种作用力,对玻色子来说是吸引力,对费米子来说是排斥力。这种力称为交换力,它不是一种真正意义上的力,无施力者。在$r→∞$时,这种交换力消失。
== 全同粒子系统的量子特性
- 全同*玻色子*系统在低温下呈现*超流*效应——具有量子特性的宏观物体(玻色-爱因斯坦凝聚)
- 全同*费米子*系统在低温下呈现*超导*效应——电子之间两两结成*库派对*(复合玻色子)
- Pauli不相容原理使全同费米子体系无法聚集——导致日常物体占有的空间尺度
- 电子在白矮星内部提供简并压力抵抗重力崩塌,但当其质量大于1.4倍太阳质量时电子被压入质子内部形成中子星,中子星内部压强改由中子的简并提供
=== BSC理论
核心:电子与晶格振动的相互作用(电声子耦合)
- 两个动量相等、方向和自旋相反的电子,通过晶格振动的相互作用产生吸引,形成电子对的束缚态
- 电子对也受散射,但是成对出现的散射不改变总动量
- 温度$T$升高,或电流$I$增大,超过电子对的束缚能:变为正常态
#pagebreak(weak: true)
= 量子力学的矩阵形式与狄拉克(Dirac)符号
== 波函数的矩阵表示
力学量$hat(Q)$,设它的本征值是离散的,本征值集为${q_n}$本征函数系(不含时)为$u_n (x)$。
假设所有本征值都非简并,这个本征函数系的正交归一性就是:
$
(u_m, u_n) = delta_(m n)
$
如果是连续本征值系统,就是
$
(u_q ,u_q') = delta(q - q')
$
在$hat(Q)$表象中,态函数$ψ$可表示为态展开系数的列矩阵形式
$
psi = mat(
a_1; a_2; dots.v; a_n; dots.v
)
$
它称为$hat(Q)$表象中的*态矢量*或*表示*。这就是系统在$hat(Q)$表象中的波函数。
也可以加入时间因子:
$
psi(t) = mat(
a_1 (t) ; a_2 (t) ; dots.v ; a_n (t) ; dots.v
)
$
厄密共轭态矢量排成行矩阵的形式:
$
psi^dagger = mat(
a_1^* , a_2^* , dots , a_n^* , dots
)
$
内积则可定义为:
$
(psi, phi) = psi^dagger phi = sum_n a_n^* b_n
$
我们称:
- $psi$为态矢量
- $u$为表象的基底或基矢
- $a$是态矢量的分量或投影
== 算符矩阵表示
坐标表象中算符表示为
$
hat(F) (x, - i hbar partial/(partial x))
$
算符作用式$phi(x) = hat(F) psi(x)$变换到$hat(Q)$表象中为
$
psi(x ,t )= sum_n a_n (t) u_n (x)\
phi(x ,t )= sum_n b_n (t) u_n (x)
$
带入上面的方程有:
$
sum_n b_n (t) u_n (x) = sum_n a_n (t) hat(F) u_n (x)
$
左乘$u_m^* (x)$再做内积
$
b_m (t) = sum_n a_n (t) (u_m^* , hat(F) u_n)
$
记
$
F_(m n) = (u_m^* , hat(F) u_n)
$
则有
$
b_m (t) = sum_n F_(m n) a_n (t)
$
写成矩阵形式有
$
mat(
b_1; b_2; dots.v
)
= mat(
F_(1 1), F_(1 2), dots.v;
F_(2 1), F_(2 2), dots.v;
dots.v, dots.v, dots.down;
)
mat(
a_1; a_2; dots.v
)
$
即
$
phi = F psi
$
这就是算符$hat(F)$在$hat(Q)$表象中的矩阵表示。
算符的Hermitian性质要求
$
F_(m n)^* = (u_n , hat(F) u_m) = (hat(F) u_m , u_n) = F_(n m) = F_(m n)^TT
$
即:
$
F^* = F^TT , F^dagger = F
$
这就是说,*算符$hat(F)$在$hat(Q)$表象中的矩阵是厄密的*。
恒等算符在$hat(Q)$表象中的矩阵表示是单位矩阵。
_$hat(L)_x$在动量表象中的矩阵元_
在坐标表象下,考虑$hat(L)_x$的矩阵元,将其作用于$hat(p)$的本征函数$psi_arrow(p) = e^(i arrow(p) dot arrow(r))$上:
$
(L_x)_(arrow(p') arrow(p)) &= integral psi_(arrow(p'))^* hat(L)_x psi_(arrow(p)) dd(arrow(r))\
&= integral psi_(arrow(p'))^* (y hat(p)_z - z hat(p)_y) psi_(arrow(p)) dd(arrow(r))\
&= 1/(2 pi hbar)^3 integral e^(-i/hbar arrow(p') dot arrow(r)) (y (- i hbar partial/(partial z)) - z (- i hbar partial/(partial y))) e^(i/hbar arrow(p) dot arrow(r)) dd(arrow(r))\
&= p_z (-i hbar partial/(partial p_y)) integral e^(-i/hbar arrow(p') dot arrow(r)) e^(i/hbar arrow(p) dot arrow(r)) dd(arrow(r)) - p_y (-i hbar partial/(partial p_z)) integral e^(-i/hbar arrow(p') dot arrow(r)) e^(i/hbar arrow(p) dot arrow(r)) dd(arrow(r))\
&= - i hbar (p_z partial/(partial p_y) - p_y partial/(partial p_z)) delta(arrow(p') - arrow(p))\
&= i hbar (p'_z partial/(partial p'_y) - p'_y partial/(partial p'_z)) delta(arrow(p') - arrow(p))
$
当然,我们可以考虑直接在动量表象下计算$hat(L)_x$的矩阵元,动量表现下的$hat(arrow(p))$的本征函数是$psi_arrow(p) = delta(arrow(p) - arrow(p'))$,所以
$
(L_x)_(arrow(p') arrow(p)) &= integral delta(arrow(tilde(p)) - arrow(p')) i hbar (tilde(p)_z partial/(partial tilde(p)_y) - tilde(p)_y partial/(partial tilde(p)_z)) delta(arrow(tilde(p)) - arrow(p)) dd(arrow(tilde(p))) \
&= i hbar (p'_z partial/(partial p'_y) - p'_y partial/(partial p'_z)) delta(arrow(p') - arrow(p))
$
虽然计算的是动量表象的矩阵元,计算公式中算符和波函数的表象可以任意选择,最终结果也不依赖于这些选择。
== 表象变换
仍以一维情形为例。
设我们再取另一个与算符$hat(Q)$函数独立的算符$hat(R)$,求出它的本征值集${r_n}$和本征函数系${u'_n (x)}$,我们就构造了$hat(R)$表象。
原来的基底${u_n (x)}$也可以用新的基底${u'_n (x)}$来展开:
$
mat(
u_1, u_2, ...
)
=
mat(
u'_1, u'_2, ...
)
mat(
S_(1 1), S_(1 2), ...;
S_(2 1), S_(2 2), ...;
dots.v, dots.v, dots.down;
)
$
其中
$
S_(m n) = (u'_m , u_n)
$
如果一个态矢量$psi$在$hat(Q)$表象中的分量为${a_n}$,在$hat(R)$表象中的分量为${a'_n}$ ,则有
$
psi = sum_n a_n u_n = sum_n sum_m a_m u'_m S_(m n) = sum_m (sum_n a_m S_(m n)) u'_m = sum_m a'_m u'_m
$
所以有
$
a'_m = sum_n S_(m n) a_n
$
写成矩阵有
$
mat(
a'_1; a'_2; dots.v;
)
=
mat(
S_(1 1), S_(1 2), ...;
S_(2 1), S_(2 2), ...;
dots.v, dots.v, dots.down;
)
mat(
a_1; a_2; dots.v;
)
$
即
$
psi' = S psi
$
注意*基底变换是行矩阵的形式,而态矢量是列矩阵的形式*。
下面讨论$S$应该满足的条件。
考虑到*态矢量*的模方为可观测量,应该要求其*内积*在表象变换下保持不变。
矢量$psi$和$phi$在$hat(Q)$表象中的分量分别是${a_n}$和${b_n}$,在$hat(R)$表象中的分量分别是${a'_n}$和${b'_n}$,则有
$
(psi, phi ) = sum_n a_n^* b_n = sum_m sum_j sum_k S^*_(m j) a_j^* S_(m k) b_k = sum_j sum_k (sum_m S^*_(m j) S_(m k)) a_j^* b_k
$
又因为
$
(psi, phi ) = sum_k a_k^* b_k = sum_j sum_k delta_(j k) a_j^* b_k
$
对比得到
$
sum_m S^*_(m j) S_(m k) = delta_(j k)
$
或者
$
sum_m S_(j m)^dagger S_(m k) = (S^dagger S)_(j k) = delta_(j k)
$
即
$
S^dagger S = I
$
这就是说,*表象变换矩阵$S$是幺正的*。
也可以得到
$
mat(
u'_1; u'_2; dots.v;
)
=
mat(
S_(1 1), S_(1 2), ...;
S_(2 1), S_(2 2), ...;
dots.v, dots.v, dots.down;
)^*
mat(
u_1; u_2; dots.v;
)
$
即
$
u'_m = sum_n S_(m n)^* u_n\
u_m = sum_n S_(n m)^TT u'_n\
a'_m = sum_n S_(m n) a_n\
a_m = sum_n S_(n m)^dagger a'_n
$
其中
$
S_(m n) = (u'_m , u_n)
$
注意:*基底的变换矩阵和态矢的变换矩阵互为复共轭或转置。*
在表象变换下,一个算符所对应的矩阵的变换是
$
F' = S F S^dagger = S F S^(-1)
$
幺正变换不改变任何量了力学方程。即,如果$phi = F psi$,则$phi' =S phi = S F psi = F' psi'$。
== 量子力学的矩阵形式
坐标表象与离散表象的关系和对比如下表
#figure(
three-line-table[
|| 坐标表象 | 离散表象|
|--|---|---|
|态| 波函数$psi(x,t)$ 复共轭波函数$psi^*(x,t)$ | 行矢量$ket(psi)$ 列矢量$bra(psi)$ |
|算符| $hat(F)(x, - i hbar partial_x)$ | 矩阵$F = (F_(m n))$ |
|算符作用到态| $hat(F) psi(x,t)$ | $F ket(psi)$ |
|态的内积| $(psi, phi) = integral psi^* phi dd(x)$ | $bra(psi) ket(phi)$ |
],
caption: [
坐标表象与离散表象的关系和对比
],
kind: table
)
1. 态的归一:$psi^dagger psi=1$, 两态正交:$phi^dagger psi=0$
2. 力学量的平均值(若 $psi$ 已归一):$ macron(F) = psi^dagger F psi$
3. 本征方程:$hat(F) psi = lambda psi$
4. 含时间的薛定鄂方程:$i hbar partial/(partial t) psi = H psi$
=== 离散表象中的本征方程的解法
设
$
psi = mat(
a_1; a_2; dots.v;
)
$
$
F = mat(
F_(1 1), F_(1 2), dots.v;
F_(2 1), F_(2 2), dots.v;
dots.v, dots.v, dots.down;
)
$
本征方程:
$
F psi = lambda psi\
(F - lambda I) psi = 0
$
这是一个齐次线性方程组,它有非零解的充要条件是:
$
det(F - lambda I) = 0
$
即*久期方程*。
如果$F$是$n×n$矩阵,则是关于$lambda$的$n$次多项式方程。根据“代数基本定理”,在复数域内,$n$次代数方程一定有$n$个根,这些根就是本征值。另外,矩阵$F$的的厄密性保证了这些根都是实数。
把这些本征值记为${lambda_i}$, 再代回方程,假设没有重根
$
mat(
F_(1 1) - lambda_1, F_(1 2), dots.v;
F_(2 1), F_(2 2) - lambda_1, dots.v;
dots.v, dots.v, dots.down;
)
mat(
a_1; a_2; dots.v;
)
= 0
$
就可以对各个本征值求出${a_i}$,但有一个整体的常数因子未定,再利用归一化条件把它定出,就得到了完全归一化的本征态矢量。
【补充,对角化矩阵的一些性质】
我们已经求出了属于本征值${lambda_i}$的本征态矢量${psi_i}$,把他们排成一个矩阵
$
S = mat(
psi_1, psi_2, dots;
)
$
它的Hermitian共轭矩阵$S^dagger$是
$
S^dagger = mat(
psi_1^dagger;
psi_2^dagger;
dots.v;
)
$
则有
$
S^dagger S = mat(
psi_1^dagger psi_1, psi_1^dagger psi_2, dots;
psi_2^dagger psi_1, psi_2^dagger psi_2, dots;
dots.v, dots.v, dots.down;
)
= mat(
1, 0, dots;
0, 1, dots;
dots.v, dots.v, dots.down;
) = I
$
即$S$是幺正矩阵。
对$F$做幺正变换:
$
S^dagger F S = mat(
psi_1^dagger;
psi_2^dagger;
dots.v;
)
F mat(
psi_1, psi_2, dots;
)
= mat(
psi_1^dagger;
psi_2^dagger;
dots.v;
)
mat(
lambda_1 psi_1, lambda_2 psi_2, dots;
)
\
= mat(
lambda_1 psi_1^dagger psi_1, lambda_2 psi_1^dagger psi_2, dots;
lambda_1 psi_2^dagger psi_1, lambda_2 psi_2^dagger psi_2, dots;
dots.v, dots.v, dots.down;
)
= mat(
lambda_1, 0, dots;
0, lambda_2, dots;
dots.v, dots.v, dots.down;
)
$
求$F$本征值问题归结为寻找一个幺正变换把$F$从某个表象变换到其自身表象,使$F$的矩阵表示对角化。
幺正变换不改变矩阵F的秩、迹和行列式。
== Dirac符号
不同的量子力学表象所表达的物理内容是完全相同的,但是从表面上看来,不同表象中的算符和量子态具体表达式却可能很不一样。为了避免不同表象带来的形式上的差异,Dirac引入了一种与表象无关的符号体系,被称为Dirac符号。
=== 态
量子体系的状态用态矢量表示。*态矢量*有
- 左矢 bra $bra(psi)$
- 右矢 ket $ket(psi)$
有关系
$
bra(psi) = ket(psi)^dagger, ket(psi) = bra(psi)^dagger
$
这里可把$dagger$看成一种“形式运算符号”,即矩阵力学中的转置加复共轭。
两个态的*内积*(即过去定义的$(psi, phi)$)用
$
braket(psi,phi)
$
是一个数,满足关系
$
braket(psi,phi)^* = braket(phi,psi)^dagger = braket(psi,phi)
$
互为共轭复数。所以内积的性质可以写成:
$
braket(psi,psi) >= 0
$
等号成立当且仅当$ket(psi) = 0$。并且,态的归一是
$
braket(psi,psi) = 1
$
态的正交是
$
braket(psi,phi) = 0
$
=== 算符
算符(例如$hat(F)$)对右矢的作用直接写为
$
hat(F) ket(psi) = ket(phi)
$
结果还是一个右矢。对左矢的作用写为
$
bra(psi) hat(F) = ((bra(psi) hat(F))^dagger)^dagger = (hat(F)^dagger ket(psi))^dagger = bra(phi)
$
结果还是一个左矢。其中$hat(F)^dagger$是$hat(F)$的Hermitian共轭,满足
$
(bra(psi) hat(F) ket(phi))^dagger = bra(phi) hat(F)^dagger ket(psi)
$
对于任意的态矢量$ket(psi)$和$ket(phi)$成立。
而
$
ket(phi) bra(psi)
$
是一个算符。
如果有
$
hat(F) ket(psi) = ket(phi)
$
则有
$
bra(psi) hat(F)^dagger = bra(phi)
$
#newpara()
算符乘积的Hermitian共轭是
$
(hat(F) hat(G))^dagger = hat(G)^dagger hat(F)^dagger
$
如果算符$hat(F)$具有性质
$
hat(F) = hat(F)^dagger
$
则称$hat(F)$是Hermitian算符。
对于Hermitian算符,有
$
(bra(phi) hat(F) ket(psi) )^dagger = (bra(phi) hat(F) ket(psi) )^* = bra(psi) hat(F) ket(phi)
$
从而力学量的平均值
$
macron(F) = (bra(psi) hat(F) ket(psi)) / (braket(psi,psi))
$
是实数。
基底集合$\{ket(n)\}$是正交归一的,即
$
braket(m,n) = delta_(m n)
$
完备性可以写为
$
sum_n ket(n) bra(n) = I
$
上面中的一项被称作*投影算符*:
$
P_n = ket(n) bra(n)
$
称为处于态$ket(n)$的投影算符。有性质
$
P_n^2 = P_n
$
对于连续谱,狄拉克态矢的正交归一表示为
$
braket(lambda_1, lambda_2) = delta(lambda_1 - lambda_2)
$
比如坐标算符$x$的本征方程为:
$
x delta(x - x_0) = x_0 delta(x - x_0)
$
狄拉克符号表示
$
x ket(x_0) = x_0 ket(x_0)
$
有:
$
braket(x_0, x_1) = delta(x_0 - x_1)
$
#newpara()
一个抽象的态$ket(n)$在坐标表象中的函数表示
$
braket(x, n) = psi_n (x)
$
_例:动量为$p'$的平面波在坐标和动量表象的函数表示为_
$
braket(x, p') = 1/(2 pi hbar) e^(i p' x / hbar)\
braket(p, p') = delta(p - p')
$
#newpara()
基底完备性条件用狄拉克符号的表达:
$
sum_n ket(n) bra(n) = I
$
== 态矢量在具体表象中的表示
在$F$表象中(基矢量$ket(k)$),任何一个态矢量$ket(psi)$都可以用基矢量展开:
$
ket(psi) = sum_k ket(k) braket(k, psi) = sum_k a_k ket(k)
$
其中$a_k = braket(k, psi)$是态矢量在$ket(k)$表象中的分量。
${a_k} = {braket(k, psi)}$是态矢量$ket(psi)$在$ket(k)$表象中的表示
$
mat(
a_1; a_2; dots.v;
)=
mat(
braket(1, psi); braket(2, psi); dots.v;
)
$
在基底的量子数为连续谱时,完备性关系表示为
$
integral dd(x) ket(x) bra(x) = I\
integral dd(p) ket(p) bra(p) = I
$
在具体的$F$表象下,态矢量展开为:
$
ket(psi) = sum_k a_k ket(k) = sum_k braket(k, psi) ket(k)\
ket(phi) = sum_j b_j ket(j) = sum_j braket(j, phi) ket(j)
$
态矢量的内积为
$
braket(phi, psi) = sum_k braket(phi, k) braket(k, psi) = sum_k b_k^* a_k
$
== 算符在具体表象下的表示
算符代表着对态的一种运算:
$
hat(L) ket(psi) = ket(phi)
$
在$F$表象中,
$
bra(j) hat(L) ket(psi) = sum_k bra(j) hat(L) ket(k) braket(k, psi) = braket(j, phi)
$
即:
$
sum_k L_(j k) a_k = b_j
$
其中
$
L_(j k) = bra(j) hat(L) ket(k)
$
就是算符$hat(L)$在$F$表象中的矩阵元。
算符$hat(L)$的狄拉克符号表示为:
$
hat(L) = sum_(j k) L_(j k) ket(j) bra(k) = sum_(j k) ket(j) bra(j) hat(L) ket(k) bra(k)
$
算符$hat(F)$在其自身$F$表象中的矩阵元和狄拉克符号表示为:
$
F_(m n) = bra(m) hat(F) ket(n) = bra(m) f_n ket(n) = f_n delta_(m n)\
hat(F) = sum_n f_n ket(n) bra(n)
$
其中$f_n$是$hat(F)$在$ket(n)$表象中的本征值。*任何算符在其自身表象中自然就是对角化的*。
= 中心力场中的运动和氢原子
== 牛顿力学中心力场问题
中心力场中运动的粒子角动量守恒:
$
dd("")/dd(t) arrow(L) &= dd("")/dd(t) (arrow(r) crossproduct arrow(p))\
&= (dd("")/dd(t) arrow(r)) crossproduct arrow(p) + arrow(r) crossproduct (dd("")/dd(t) arrow(p))\
&= arrow(v) crossproduct arrow(p) + arrow(r) crossproduct arrow(F)\
&= arrow(r) crossproduct arrow(F)\
$
在中心力场中,力$arrow(F)$与$arrow(r)$同向(排斥力)或反向(吸引力),所以叉乘结果为0,即
$
U(arrow(r)) = U(r) => arrow(F) = -nabla U(r) = F hat(r) => dd("")/dd(t) arrow(L) = 0
$
又由于$r × L = 0$,所以粒子运动平面恒垂直于$arrow(L)$,即粒子在中心力场中的运动是平面运动。
== 中心力场两体问题化为单体问题
中心力场中两体问题的定态薛定谔方程:
$
(-hbar^2/(2 m_1) nabla^2_1 -hbar^2/(2 m_2) nabla^2_2+ U(abs(arrow(r)_1 - arrow(r)_2))) Psi(arrow(r)_1, arrow(r)_2) = E_"tot" Psi(arrow(r)_1, arrow(r)_2)
$
两体问题系统总能量$E_"tot"$可分为整体*平动*动能和*相对运动*能量(相对动能+势能)两部分。为了进行这种分解,把两粒子坐标进行转化:
$
arrow(R) = (m_1 arrow(r)_1 + m_2 arrow(r)_2)/(m_1 + m_2) "(质心系坐标)"\
arrow(r) = arrow(r)_1 - arrow(r)_2 "(相对坐标)"
$
质心系坐标满足:
$
M = m_1 + m_2\
M dd(""^2)/dd(t^2) arrow(R) = m_1 dd(""^2)/dd(t^2) arrow(r)_1 + m_2 dd(""^2)/dd(t^2) arrow(r)_2\
$
进行坐标转化:
$
arrow(r)_1 , arrow(r)_2 => arrow(R), arrow(r)\
x_1 , x_2 => X, x\
y_1, y_2 => Y, y\
z_1, z_2 => Z, z
$
就有
$
partial/(partial x_1) = (partial X)/(partial x_1) partial/(partial X) + (partial x)/(partial x_1) partial/(partial x) = m_1 /M partial/(partial X) + partial/(partial x)\
partial^2/(partial x_1^2) = (m_1 /M partial/(partial X) + partial/(partial x))(m_1 /M partial/(partial X) + partial/(partial x)) = m_1^2 /M^2 partial^2/(partial X^2) + 2 m_1 /M partial^2/(partial X partial x) + partial^2/(partial x^2)
$
同理有:
$
partial/(partial x_2) = (partial X)/(partial x_2) partial/(partial X) + (partial x)/(partial x_2) partial/(partial x) = m_2 /M partial/(partial X) - partial/(partial x)\
partial^2/(partial x_2^2) = (m_2 /M partial/(partial X) - partial/(partial x))(m_2 /M partial/(partial X) - partial/(partial x)) = m_2^2 /M^2 partial^2/(partial X^2) - 2 m_2 /M partial^2/(partial X partial x) + partial^2/(partial x^2)
$
于是:
$
1/m_1 partial^2/(partial x_1^2) + 1/m_2 partial^2/(partial x_2^2) &= 1/m_1 m_1^2 /M^2 partial^2/(partial X^2) + 1/m_2 m_2^2 /M^2 partial^2/(partial X^2) + 1/m_1 partial^2/(partial x^2) + 1/m_2 partial^2/(partial x^2) \
&= 1/M partial^2/(partial X^2) + 1/((m_1 m_2)/M) partial^2/(partial x^2) \
&= 1/M partial^2/(partial X^2) + 1/mu partial^2/(partial x^2)
$
其中$mu = (m_1 m_2) /M$是约化质量。三维的情况则是:
$
1/m_1 nabla^2_1 + 1/m_2 nabla^2_2 = 1/M nabla^2_R + 1/mu nabla^2_r
$
于是定态薛定谔方程转换为:
$
(-hbar^2/(2 M) nabla^2_R - hbar^2/(2 mu) nabla^2_r + U(r)) psi(arrow(R), arrow(r)) = E_"tot" psi(arrow(R), arrow(r))
$
分离变量求特解:
$
psi(arrow(R), arrow(r)) = phi(arrow(R)) psi(arrow(r))
$
代入原方程得:
$
- hbar^2/(2 M) nabla^2_R phi(arrow(R)) = E_"cm" phi(arrow(R))\
(- hbar^2/(2 mu) nabla^2_r + U(r)) psi(arrow(r)) = (E_"tot" - E_"cm") psi(arrow(r))
$
其中$E_"cm"$是质心运动的能量,$E = E_"tot" - E_"cm"$是相对运动的能量。
第一个方程的解即自由粒子平面波:
$
phi(arrow(R)) = c_1 e^(i/hbar arrow(P) dot arrow(R)) + c_2 e^(-i/hbar arrow(P) dot arrow(R))
$
其中$P = sqrt(2 M E_"cm")$是质心动量。第二个方程的解才是我们关心的中心势场问题的解,其中能量$E$表示相对运动的总能量(相对运动动能+势能):
$
(- hbar^2/(2 mu) nabla^2_r + U(r)) psi(arrow(r)) = E psi(arrow(r))
$
如果$U(r -> oo) > E$,那么这个方程的能量本征值是分立的。
- 对于氢原子来说$U(r) tilde - 1/r$,也就说如果电子处于原子核库伦势吸引下的束缚态,则相对运动总能量$E<0$
- 对于库伦散射来说$U(r) tilde ± 1/r$,也就说如果带电粒子处于散射态,则相对运动总能量$E>0$
- 对于三维无限深球势阱:
$
U(r) = cases(
0 (r < R),
oo (r > R)
)
$
其能级为正,并且分立
- 对于三维各向同性谐振子$U(r) tilde r^2$其能级为正,且将一定处于束缚态(能级分立)
== 中心力场中的运动
=== 中心力场中Schrödinger方程的约化
$
(-hbar^2/(2 mu) nabla^2_r + U(r)) psi(arrow(r)) = E psi(arrow(r))
$
中心力场的势能函数与方向无关:
$
U(arrow(r)) = U(r)
$
在球坐标系中,
$
nabla^2_r = 1/r^2 partial/(partial r) (r^2 partial/(partial r)) + 1/(r^2 sin(theta)) partial/(partial theta) (sin(theta) partial/(partial theta)) + 1/(r^2 sin^2(theta)) partial^2/(partial phi^2)\
- hbar^2/(2 mu) nabla^2 = - hbar^2/(2 mu r^2) partial/(partial r) (r^2 partial/(partial r)) + 1/(2 mu r^2) hat(L)^2
$
其中$hat(L)^2$是角动量平方算符。方程化为
$
(- hbar^2/(2 mu r^2) partial/(partial r) (r^2 partial/(partial r)) + 1/(2 mu r^2) hat(L)^2 + U(r)) psi(arrow(r)) = E psi(arrow(r))
$
第一项是径向动能$hat(p)^2_r/(2 mu)$,$hat(p)_r = - i hbar (partial/(partial r) + 1/r)$,第二项是离心势能,角动量越大,离心势能就越大。
在球坐标系中分离变量:
$
psi(arrow(r)) = R(r) Y(theta, phi)\
hat(L)^2 Y_(l m) (theta, phi) = l (l + 1) hbar^2 Y_(l m) (theta, phi)
$
径向方程:
$
(- hbar^2/(2 mu r^2) dd("")/(dd(r)) (r^2 dd("")/(dd(r))) + l (l + 1) hbar^2/(2 mu r^2) + U(r)) R_l (r) = E R_l (r)
$
设$R(r) = u(r)/r$,则有
$
- hbar^2 / (2 mu) dd(""^2u) /dd(r^2) + ((l (l + 1) hbar^2) / (2 mu r^2) + U(r)) u = E u
$
它很像是一维的方程,但是有$2l+1$重简并。有两点讨论:
1. “势能”是
$
U_"eff" (r) = U(r) + (l (l + 1) hbar^2) / (2 mu r^2)
$
它称为有效势能,包括*库伦势能*和*离心势能*。
2. 自变量区间是$0 <= r < +oo$而且波函数满足边界条件:
$
lim_(r -> 0) r R_l (r) = lim_(r ->0) u(r) = 0
$
下面解释这个边界条件的物理意义。
首先,在原点附近,$U(r) → ∞$的速度不能比$1/r^2$更快,即当$r→0$时,$r^2 U(r) -> 0$。通常碰到的中心力场都满足这个条件。例如
- 谐振子势:$U(r) prop r^2$
- 线性中心势:$U(r) prop r$
- 无限深球势阱
- coulomb势:$U(r) prop 1/r$
- 汤川势:$U(r) prop e^(-alpha r)/r$
径向方程:
$
dd(""^2R)/dd(r^2) + 2/r dd(R)/dd(r) + ((2 mu) / hbar^2 (E - U(r)) - (l(l+1))/r^2 )R= 0
$
当$r→0$时,上式的渐进式是:
$
dd(""^2R)/dd(r^2) + 2/r dd(R)/dd(r) - (l(l+1))/r^2 R= 0
$
在正则奇点$r=0$的邻域内,设$R∝ r^s$,代入后得
$
s(s-1) r^(s-2) + 2 s r^(s-1) - l(l+1) r^(s-2) = 0
$
称为指标方程(characteristic equation),根为
$
s = l, -l-1
$
后者发散,从而而当$l = 0$时
$
R prop r^l
$
因此要求在求解径向方程时,解满足边界条件:
$
u(r) = r R(r) prop r^(l + 1)
$
在散射问题中,入射$lambda$相对于势场$U(r)$的作用范围很大时,$l=0$的贡献最大,只考虑$l=0$的S波(即正碰)就行了。
=== 氢原子和类氢离子的能级和波函数
氢原子或类氢离子的核电荷是$Z e$($Z$是原子序数),核外有一个电子,所以势能是:
$
U(r) = - 1/(4 pi epsilon_0) (Z e^2) / r
$
约化质量是
$
mu = (m_e m_N) / (m_e + m_N)
$
分离变量后径向方程是:
$
- hbar^2 / (2 mu) dd(""^2u) /dd(r^2) + ((l (l + 1) hbar^2) / (2 mu r^2) - k_1 (Z e^2) / r) u = E u\
dd(""^2 u)/dd(r^2) + ((2 mu) / hbar^2( E + k_1 (Z e^2) / r )- (l (l + 1)) / (r^2)) u = 0
$
对于束缚态,$E<0$。定义一个无量纲的新变量
$
rho = alpha r , alpha = sqrt(8 mu abs(E)) / (hbar)
$
以及一个无量纲的新参数
$
beta = (2 mu k_1 Z e^2)/(alpha hbar^2) = (k_1 Z e^2) / hbar sqrt(mu/(2 abs(E)))
$
于是方程化为:
$
dd(""^2 u)/dd(rho^2) + (- 1/4 + beta/rho - (l (l + 1)) / rho^2 ) u = 0
$
讨论两种极限情形:
1. $rho -> oo$
$
dd(""^2 u)/dd(rho^2) - 1/4 u = 0
$
有解
$
u(rho) -> e^(-rho/2)
$
正指数舍去。
2. $rho -> 0$
$
dd(""^2 u)/dd(rho^2) - (l (l + 1)) / rho^2 u = 0
$
有解
$
u(rho) -> rho^(l+1)
$
#figure(
image("pic/2024-05-20-20-56-40.png", width: 80%),
numbering: none
)
得到量子化的能级是:
$
E_n = (mu k_1^2 Z^2 e^4)/(2 hbar^2 n^2)
$
能量本征态由量子数组合$(n, l, m)$表征,它们的意义是:
- 主量子数$n = 1, 2, 3, ...$,能级数$E = E_n$
- 角量子数$l = 0, 1, 2, ..., n-1$,角动量量子数$L^2 = l (l + 1) hbar^2$
- 磁量子数$m = -l, -l+1, ..., l-1, l$,$L_z = m hbar$
能级$E_n$只和$n$有关,所以对$l$和$m$是简并的,简并度是:
$
g_n = sum_(l=0)^(n-1) (2l + 1) = n^2
$
对应的波函数是:
$
psi_(n l m) (r, theta, phi) = R_(n l) (r) Y_(l m) (theta, phi)\
R_(n l) (r) = (u_(n l) (r))/r
$
#figure(
image("pic/2024-05-20-21-00-03.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-20-21-00-26.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-20-21-03-06.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-20-21-03-24.png", width: 80%),
numbering: none
)
=== 碱金属(正1价金属)原子的能谱
氢原子的能级只和量子数$n$有关而和$l$无关,这是Coulomb势场所特有的结果。碱金属中的价电子是在原子实(即原子核加上内壳层电子)的作用下运动,它受到的势场就不再是Coulomb势场,所以碱金属原子的能级实际上与$n, l$都有关:
$
E = E_(n l)
$
举例来说,在钠(Na)原子中,$n=1,2$的轨道都被内壳层电子填满,所以价电子的最小主量子数是$n=3$。对于这些状态,能量的高低顺序是$E_(3S)<E_(3P)<E_(3D)$。只要原子没有受到外磁场的作用,它的能量总是和量子数$m$无关的。
== 径向位置概率分布
利用径向波函数,可以求得电子的径向位置分布概率,即不管方向如何,找到电子在$(r, r+dd(r) )$球壳中的概率为:
$
r^2 dd(r) integral sin theta dd(theta) dd(phi) |psi(r, theta, phi)|^2\
= |R_(n l) (r)|^2 r^2 dd(r)\
= |u_(n l) (r)|^2 dd(r)
$
在量子力学中,电子没有严格的轨道概念,只能研究其位置分布概率。$|u_(n l) (r)|^2$的极大值位置称为*最可几半径*。
== 概率密度随角度的变化
电子在$(theta , phi)$方向的立体角$dd(Omega) = sin theta dd(theta) dd(phi)$中的概率密度是:
$
|Y_(l m) (theta, phi)|^2 dd(Omega) prop | P_l^m (cos theta) |^2 dd(Omega)
$
和$phi$角无关。
== 粒子流密度和磁矩
设氢原子中电子处于$psi_(n l m)$态,则其粒子概率流密度为:
$
(i hbar)/(2 mu) (psi grad psi^* - psi^* grad psi)
$
乘以电子电荷($-e$)得到电流密度:
$
arrow(j) = - e (i hbar)/(2 mu) (psi grad psi^* - psi^* grad psi)
$
而
$
psi_(n l m) tilde R_(n l) (r) P^m_l (cos theta) e^(i m phi)
$
其中$R,P$是实函数,从而$j_r = j_theta =0$。
$
j_phi &= (i e hbar)/(2 mu) 1/(r sin theta) (psi^* partial/(partial phi) psi - psi partial/(partial phi) psi^*)\
&= (i e hbar)/(2 mu) (2 i m)/(r sin theta) abs(psi)^2\
&= - (e hbar m)/(mu r sin theta) |R_(n l) (r) P^m_l (cos theta)|^2
$
电流密度$j_phi$对应的磁矩为:
$
arrow(M) = 1/2 integral arrow(r) crossproduct arrow(j) dd(V)
$
$
M_z = 1/2 integral r sin theta j_phi dd(V) = - (e hbar m)/(2 mu) |R_(n l) (r) P^m_l (cos theta)|^2 dd(r) dd(theta) dd(phi) = - (e hbar m)/(2 mu)
$
定义Bohr磁子:
$
mu_B = (e hbar) / (2 mu)
$
则氢原子磁矩为:
$
M_z = - mu_B m
$
所以也把$m$称为磁量子数。定义回转磁比值:
$
g = M_z / L_z = (- m mu_B)/(m hbar) = - e/(2 mu)
$
= 中心力场问题——三维各向同性谐振子
三维各向同性谐振子的势能函数
$
V(r) = 1/2 mu omega^2 r^2 = 1/2 mu omega^2 (x^2 + y^2 + z^2)
$
哈密顿量可写为:
$
H = sum_i H_i , H_i = - hbar^2/(2 mu) nabla_i^2 + 1/2 mu omega^2 r_i^2
$
类似多粒子系统,系统波函数分离变量:
$
psi(x, y, z) = psi_(n_x) (x) psi_(n_y) (y) psi_(n_z) (z)
$
其中$psi_n$为*一维谐振子*与量子数$n$的本征函数。
系统能级为:
$
E = (n_x + n_y + n_z + 3/2) hbar omega = (N + 3/2) hbar omega
$
其中$N = n_x + n_y + n_z$是量子数。
Virial定理仍然成立:
$
macron(T) = macron(V) = 1/2 macron(E)
$
对于给定的能级量子力学数$N$,其简并度为
$
((N + 1)(N + 2))/2
$
#newpara()
在球坐标系中,定态薛定鄂方程的径向部分:
$
(1/r^2 dd("")/dd(r) (r^2 dd("")/dd(r)) + (2 mu) / hbar^2 (E - 1/2 mu omega^2 r^2) -( l (l + 1)) / r^2) R_l (r) = 0
$
若令$R(r) = u(r)/r$,则有
$
(dd("")/dd(r) + (2 mu)/hbar^2 (E - 1/2 mu omega^2 r^2) -( l (l + 1) hbar )/(2 mu r^2)) u = 0
$
在$l=0$时,可以看到$u$的方程和一维谐振子方程非常相像,但是又有本质不同:$u(r)$的自变量定义在$0≤r<∞$范围内,而一维谐振子范围是$-∞<x<∞$,这直接导致了它们的基态能量也不相同。
引入无量纲常量$ρ、λ$:
$
rho = alpha r, alpha = sqrt(mu omega / hbar)\
lambda = 2 E / (hbar omega)
$
则径向方程化为:
$
dd("")/dd(rho) R + 2/rho dd(R)/dd(rho) + (lambda - rho^2 - (l (l + 1)) / rho^2) R = 0
$
在$rho -> 0$时,$R(rho) -> rho^l$;在$rho -> ∞$时,$R(rho) -> e^(-rho^2/2)$。得到渐近形式后可设:
$
R(rho) = e^(-rho^2/2) rho^l v(rho)
$
代入原方程后,再做变量代换$ξ = ρ^2$得到*合流超几何方程*:
$
dd(""^2v)/dd(ξ^2) + ((2l + 3)/(2 ξ) - 1) dd(v)/dd(ξ) + (lambda - 2l -3)/(4 eta) v = 0
$
和氢原子的合流超几何方程做对比
$
dd(""^2v)/dd(rho^2) + ((2(l + 1))/(rho) - 1) dd(v)/dd(ξ) + (beta - l -1)/(rho) v = 0
$
类似于氢原子方程有解条件
$
n_r = beta - l - 1 = 0, 1, 2, ...
$
当前方程的有解条件为
$
n_r = (lambda - 2l - 3)/4 = 0, 1, 2, ...
$
解得
$
lambda = 2N + 3 (N = 2n_r + l)
$
代入λ表达式
$
E_N = (N + 3/2) hbar omega
$
在$N$给定以后,$l$可以取值
$
l = N , N - 2, ..., 0"或"1
$
最后系统径向波函数为
$
R(r) = C L_(n_r)^(l+1/2) (rho^2) rho^l e^(-rho^2/2) (rho = sqrt((mu omega) / hbar) r)
$
其中$L_(n_r)^(l+1/2)$是缔合Laguerre多项式。
#figure(
image("pic/2024-05-24-00-57-38.png", width: 80%),
numbering: none
)
实质上说,对于同一个$N$,直角坐标系中的的波函数$psi_(n_x) (x) psi_(n_y) (y) psi_(n_z) (z)$和球坐标系中的波函数$R(r) Y_(l m) (theta, phi)$(不同对易力学量完全集的基底)可以通过幺正变换互相联系,这是*表象变换*的一个实际例子。
#figure(
image("pic/2024-05-24-00-59-09.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-24-01-08-16.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-24-01-14-46.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-24-01-16-13.png", width: 80%),
numbering: none
)
下面求$hat(L)_z$在$(hat(H), hat(L)^2, hat(L)_z)$和$(hat(H)_x, hat(H)_y, hat(H)_z)$表象下的矩阵表示:
#figure(
image("pic/2024-05-24-01-22-14.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-24-01-25-11.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-24-01-25-35.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-24-01-29-04.png", width: 80%),
numbering: none
)
= 带电粒子在电磁场中的运动
== 薛定鄂方程的幺正变换
一般量子力学问题的薛定鄂方程:
$
(- hbar^2/(2 mu) nabla^2 + U(r)) psi(arrow(r)) = i hbar partial/(partial t) psi(arrow(r))
$
对于库仑势能来说:
$
U(r) = q Phi(arrow(r))
$
其中$Phi(arrow(r))$为外界电场力所对应的静电势(注意不一定是中心势,如恒定均匀外场势),q为粒子电荷。对氢原子(中心势场)中的电子来说
$
q = - e\
Phi(arrow(r)) = k_1 e / r
$
加入磁场后,经典哈密顿量变为(参考分析力学):
$
H = 1/(2 m) (arrow(p) - q arrow(A))^2 + q Phi(arrow(r))
$
磁力不是保守力,不像库仑力那样有一个标量势能项。但是我们知道*电磁场是包含动量的*,电荷$q$产生的$arrow(E)$与外磁场$arrow(B)$结合产生动量密度$epsilon_0 arrow(E) crossproduct arrow(B)$,这反映在动量的改变量中。$arrow(p)$是*正则动量*,而$arrow(pi) = arrow(p) - q arrow(A)$是*机械动量*。
相应的,带电粒子在外电磁场作用下的哈密顿算符:
$
hat(H) = 1/(2 mu) (hat(p) - q hat(A))^2 + q Phi(arrow(r))
$
同氢原子问题(只有$q Phi$项)一样,这个算符对应的薛定鄂方程的适用范围是低速运动的粒子。对于高能问题,需对波函数和电磁场进行量子化(所谓二次量子化)。
对任意势场,对方程做幺正变换:
$
psi -> psi' = e^(i theta) psi\
hat(H) -> hat(H)' = e^(i theta) hat(H) e^(- i theta)
$
其中$theta = theta(arrow(r))$为不显含时间的任意实函数,显然这一变换是幺正变换,也不改变薛定鄂方程:
$
hat(H)' psi' &= e^(i theta) hat(H) e^(- i theta) e^(i theta) psi = e^(i theta) hat(H) psi\
&= i hbar partial/(partial t) psi'\
$
现在
$
hat(H) = 1/(2 mu) (- i hbar grad - q arrow(A))^2 + q Phi(arrow(r))
$
幺正变换的结果是:
#figure(
image("pic/2024-05-24-01-48-06.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-24-01-49-56.png", width: 80%),
numbering: none
)
$
arrow(A) -> arrow(A)' = arrow(A) + hbar/q grad theta\
$
根据幺正变换的性质,在量子力学中,这一代换不会引起任何物理上的变化。
在经典力学中:
$
arrow(B) = nabla crossproduct arrow(A) = nabla crossproduct arrow(A)' = nabla crossproduct (arrow(A) + hbar/q grad theta)
$
也就是说,这一代换在经典电磁学中同样不会产生任何物理上的不同。
以上考虑的是静电场和静磁场的情况,在变化的电磁场中,哈密顿量显含时间,相应的幺正变换则为
$
psi -> psi' = e^(i theta) psi\
hat(A) -> hat(A)' = hat(A) + hbar/q grad theta\
Phi -> Phi' = Phi - hbar/q (partial theta) / (partial t)
$
这一套变换又称为规范(gauge)变换。规范变换不改变系统物理学性质——系统具有规范不变性。
== 规范不变性与Yang-Mills理论
在量子场论中,初等量子力学中的波函数演变为经典场进入到哈密顿量中,与经典电磁场一起进行二次量子化。
在这种情况下,规范变换就不像初等量子力学那样对波函数和算符同时变换,而是仅对哈密顿量(或拉格郎日量)进行变换-这就体现为系统的一种对称不变性。
根据Noether定理,每一种对称性的背后都有一个守恒量。在量子场论中,如果系统规范不变,将带来深刻的物理结果,比如:
- 系统电荷守恒(诸如$e -> nu gamma$不可能发生)
- 光子质量为0
- 光子自旋投影只能是$±hbar$,没有0分量
#figure(
image("pic/2024-05-24-01-56-05.png", width: 80%),
numbering: none
)
规范不变对系统的拉格郎日量(或哈密度量)的形式做出了强烈的限制,基于规范不变思想的量子场论最早由Pauli提出(1953),可惜没有正式发表。
Yang、Mills二人发展了这一思想,把规范不变的公设从电磁U(1)相互作用延伸到了SU(N)相互作用,对SU(N)相互作用的形式作出了限定。美中不足的是,规范不变性成立的前提是所有基本粒子质量为0,这显然与实验不符,这也是Pauli没有发表他早期研究的原因。
后来希格斯等提出了基于自发性对称破缺的机制来解释为什么粒子质量不为0。2012年希格斯粒子的发现,使得基于规范不变和希格斯质量机制这两大支柱的粒子物理“标准模型”得以最终确立。
= 塞曼效应和郎道能级
== 在外场中的原子
带电粒子在外场中的定态薛定鄂方程:
$
(1/ (2m) (- i hbar grad - q arrow(A))^2 + q Phi(arrow(r))) psi(arrow(r)) =E psi(arrow(r))\
1/(2m) (-hbar^2 nabla^2 psi + i hbar q (grad dot (arrow(A) psi) + arrow(A) dot grad psi) + q^2 arrow(A)^2 psi) = (E - q Phi) psi\
1/(2m) (-hbar^2 nabla^2 psi + i hbar q ((grad dot arrow(A)) psi +2 arrow(A) dot grad psi) + q^2 arrow(A)^2 psi) = (E - q Phi) psi\
$
取*库仑规范*:
$
div arrow(A) = 0
$
则有
$
1/(2m) (-hbar^2 nabla^2 psi + 2i hbar q (arrow(A) dot grad psi) + q^2 arrow(A)^2 psi) = (E - q Phi) psi
$
利用Stokes定理:
$
integral.double_(S) (curl arrow(A)) dd(arrow(S)) = integral.cont arrow(A) dot dd(arrow(l))
$
对恒定静磁场$arrow(B)$来说:
$
B pi r^2 = A 2 pi r\
arrow(A) = 1/2 arrow(B) crossproduct arrow(r)
$
*库伦规范*就是:
$
div arrow(A) = 1/2 div (arrow(B) crossproduct arrow(r)) = 0
$
代入原式
$
1/(2m) (-hbar^2 nabla^2 psi + i hbar q (arrow(B) crossproduct arrow(r)) dot grad psi + 1/4q^2 (arrow(B) crossproduct arrow(r))^2 psi) = (E - q Phi) psi\
1/(2m) (-hbar^2 nabla^2 psi + i hbar q arrow(B) dot (arrow(r) crossproduct grad psi) + 1/4q^2 (r^2B^2 - (arrow(r)dot arrow(B))^2) psi) = (E - q Phi) psi
$
#figure(
image("pic/2024-05-24-02-08-07.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-24-02-08-25.png", width: 80%),
numbering: none
)
所以相对第二项(的变化量)来说,第三项可以忽略不计。于是:
$
(- hbar^2/(2m) nabla^2 - q arrow(B) dot hat(arrow(L)) + q Phi) psi = E psi
$
如果选择$z$轴的方向为$arrow(B)$的方向,则
$
(- hbar^2/(2m) nabla^2 - (q B)/(2 m) hat(L)_z + q Phi) psi = E psi
$
电子电荷$q = - e$,所以
$
(- hbar^2/(2 mu) nabla^2 + (e B)/(2 mu) hat(L)_z - e Phi) psi = E psi
$
设已求得未加磁场$(B=0)$时碱金属原子的能级与波函数
$
E_(n l) , psi_(n l) (r, theta, phi) = R_(n l) (r) Y_(l m) (theta, phi)
$
每一个能级是$(2l+1)$度简并的。那么加上外磁场后(相当于$hat(H)' = hat(H) + (e B)/(2 mu)hat(L)_z$),本征波函数不变,本征值发生改变,简并将被打破。
$
E_(n l m) = E_(n l) + (e B)/(2 mu)hbar m
$
其中$m$为磁量子数。而波函数的形式仍旧不变
#figure(
image("pic/2024-05-24-13-41-40.png", width: 80%),
caption: [
塞曼效应
],
)
*碱金属原子的能级在强磁场中分裂的现象称为正常塞曼(Zeeman)效应。*
== 自由粒子在磁场中运动
在*对称规范*中,我们约定均匀磁场$arrow(B)$的矢势为
$
arrow(A) = 1/2 arrow(B) crossproduct arrow(r)
$
如果取$B$沿z轴方向,则:
$
arrow(A) = vec(-1/2 B y, 1/2 B x, 0)
$
进行规范变换(规范变换不改变$arrow(B)$),新的磁矢势仍满足库伦规范
$
arrow(A) -> arrow(A)' = arrow(A) + grad f , f = 1/2 B x y
$
这时磁矢势变为(此即*朗道规范*)
$
arrow(A)' = vec(0, B x, 0)
$
取电子电荷$-e$,则在均匀磁场中运动电子的定态薛定鄂方程为
$
1/(2m) (hat(arrow(p)) + e arrow(A))^2 psi = E psi
$
设$arrow(B)$沿$z$轴方向,电子运动限制在$x-y$平面内(二维电子气模型),则在朗道规范下方程为
$
1/(2 m) (hat(p)_x^2 + (hat(p)_y + e B x)^2) psi = E psi
$
易见
$
[hat(p)_y, hat(H)] = 0
$
分离变量求特解:
$
psi(x, y) = e^(i k_y y) phi(x)
$
代入原方程得:
$
(- hbar^2/(2 m) dd(""^2)/dd(x^2) + 1/2 m omega_c^2 (x + x_0)^2 ) phi(x) = E phi(x)
$
其中
$
omega_c = (e B) / m, x_0 = k_y l_c^2 , l_c = sqrt(hbar /(m omega_c)) = 1/alpha , alpha^2 = (e B) / hbar
$
$ω_c$是回旋角频率,$l_c$是最小回旋半径
$
(m v)/R = e B\
T = (2 pi R)/v = (2 pi m) / (e B)\
omega_c = (2 pi) / T = (e B)/m
$
$
2 pi l_c = lambda = h/p\
e B = p/l_c\
=> l_c = sqrt(hbar / (e B)) = sqrt(hbar / (m omega_c))
$
这个方程的解即是一维谐振子方程的解,只是坐标平移了$x_0$:
$
phi(x) = phi_n (x+x_0), psi(x, y) = e^(i k_y y) phi_n (x+x_0)\
E_n = (n + 1/2) hbar omega_c "朗道能级"
$
量子观点:粒子在$x-y$平面内绕$z$轴转动。*粒子能量就是这种转动产生的磁矩*与磁场的相互作用能
$
E = (n + 1/2) hbar omega_c = (n + 1/2) (e hbar) / m B = -mu_z B
$
则
$
mu_z = - (e hbar) / (2 m) = - mu_B
$
即磁矩方向与磁场方向相反——*朗道抗磁性*。朗道抗磁性与电荷正负无关,是自由粒子在磁场中运动的量子效应。
朗道能级$n$对应的波函数$e^(i k_y y) phi_n (x+x_0)$是一种平面波和谐振子波函数的乘积,简并度是无穷大的:对于每个能级$E_n$,对应波函数中的$k_y$可以任意取值。
考虑电子气局限于$L_x$宽的长条中,则必须有
$
0 < x_0 < L_x => 0 < k_y < L_x alpha^2
$
考虑$y$轴方向周期性边界条件:长条内每$L_y$长度内有一个电子(即一维箱归一化),得
$
k_y = (2 pi N)/L_y , N = 0, 1, 2, ...
$
所以
$
0 < N < (L_x L_y alpha^2)/(2 pi) = (e B L_x L_y) / (h)
$
于是*单位面积内的能级简并度为*
$
g = (e B) / (h)
$
这是一个重要的结果,对于理解量子霍尔效应很有用。
如果使用对称规范,则电子绕$z$轴转动的物理图像更加一目了然。但是物理结论不依赖于规范选择(如同三维谐振子在直角坐标和球坐标系表象中的解一样),这个问题中两个不同规范对应的波函数解可以通过幺正变换联系起来。
== 量子霍尔效应
= 电子自旋及其描述
== 角动量
轨道角动量算符$hat(arrow(L))$的各个分量满足对易关系
$
[hat(L)_i, hat(L)_j] = i hbar epsilon_(i j k) hat(L)_k
$
其中$epsilon_(i j k)$是三维Levi-Civita符号,即三阶完全反对称张量。只有
角标$i,j,k$各不相同时,$epsilon_(i j k)$才不为0,否则为0。约定$epsilon_(1 2 3) = 1$,再任意排列的情况下,$epsilon_(i j k)$的值由排列的奇偶性决定。
这些对易关系是*角动量算符的定义以及量子力学基本对易关系*($[hat(x) , hat(p)] = i hbar$)所导致的结果。
可以把它们推广为量子力学中的一般角动量应该满足的对易关系,也就是说,我们假设若 $hat(arrow(J))$是一个角动量算符,那么它的各个分量算符要满足
$
[hat(J)_i, hat(J)_j] = i hbar epsilon_(i j k) hat(J)_k
$
在量子力学里,上式可以看作是*角动量算符的一般定义*。
$
[hat(J)^2 , hat(J)_i] = 0, hat(J)^2 = hat(J)_x^2 + hat(J)_y^2 + hat(J)_z^2
$
*角动量本征态*是$hat(J)^2$和$hat(J)_z$的共同本征态,本征值分别是$eta hbar^2$和$m hbar$,其中$j$是角动量量子数,$m$是磁量子数。
$
hat(J)^2 ket(eta"," m) = eta hbar^2 ket(eta"," m)\
hat(J)_z ket(eta"," m) = m hbar ket(eta"," m)
$
注意,在Dirac符号的形式下,我们只是说存在满足角动量对易关系的力学量算符和它们的本征态,但是并不需要把它们写成任何具体的函数形式。
== 阶梯算符
引进*阶梯算符*:
$
hat(J)_(plus.minus) = hat(J)_x ± i hat(J)_y
$
不难证明
$
[hat(J)_z , hat(J)_(plus.minus)] = [hat(J)_z, hat(J)_x] ± i [hat(J)_z, hat(J)_y] = ± hbar hat(J)_(plus.minus)
$
从而
$
hat(J)_z hat(J)_(plus.minus) = hat(J)_(plus.minus) hat(J)_z ± hbar hat(J)_(plus.minus)\
hat(J)_z hat(J)_(plus.minus) ket(eta"," m) = hat(J)_(plus.minus) hat(J)_z ket(eta"," m) ± hbar hat(J)_(plus.minus) ket(eta"," m)\
hat(J)_z hat(J)_(plus.minus) ket(eta"," m) = (m ± 1) hbar hat(J)_(plus.minus) ket(eta"," m)
$
从而
$
hat(J)_(plus.minus) ket(eta"," m) prop ket(eta'"," m ± 1)
$
设
$
hat(J)_(plus.minus) ket(eta"," m) = c ket(eta'"," m ± 1)
$
再利用
$
[hat(J)^2 , hat(J)_(plus.minus)] = [hat(J)^2 , hat(J)_x] ± i [hat(J)^2 , hat(J)_y] = 0
$
令$hat(J)^2$作用于等式的左端:
$
hat(J)^2 hat(J)_(plus.minus) ket(eta"," m) = hat(J)_(plus.minus) hat(J)^2 ket(eta"," m) = eta hbar^2 hat(J)_(plus.minus) ket(eta"," m)
$
作用于右端:
$
hat(J)^2 c ket(eta'"," m ± 1) = c eta' hbar^2 ket(eta'"," m ± 1)
$
就有
$
eta = eta', hat(J)_(plus.minus) ket(eta"," m) = c ket(eta"," m ± 1)
$
这就是*阶梯算符*的含义(只改变m,不改变$eta$)。
可以证明,若$m$的极大值为$j$,则$eta=j(j+1)$。于是我们用$ket(j "," m)$来表示一个角动量本征态,而不再用$ket(eta "," m)$。有
$
hat(J)_(plus.minus) ket(j "," m) = hbar sqrt(j(j+1) - m(m ± 1)) ket(j "," m ± 1)
$
同时可证,$j$的可能取值为非负半整数或整数,即
$
j = 1/2 , 3/2 , 5/2 ... 或 0 , 1 , 2 ...
$
这是从角动量算符对易关系得出的一般结果,与中心力场问题求解过程中得到的$(hat(L)^2, hat(J)_z)$的本征值和本征函数(即球谐函数)间的关系是完全一致的。但是,这里用的代数解法更加普适,把$j$为半整数的情形也推导出来了,这恰恰就是电子自旋的情况,球谐函数是无能为力的。
#figure(
image("pic/2024-05-27-00-48-10.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-27-19-08-50.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-27-19-10-08.png", width: 80%),
numbering: none
)
非相对论量子力学在解释许多实验现象上都获得了成功,例如氢原子的能谱结构,但是更进一步的实验发现,还有许多实验现象,例如光谱线在磁场下的分裂、光谱线的精细结构,用前面讲述的理论无法解释,原因在于,以前的理论只涉及到轨道角动量。而新的实验表明,电子还具有自旋角动量。
在非相对论量子力学中,自旋是作为一个新的附加的量子数引入的,只是在薛定鄂方程中加入自旋。
在相对论量子力学中,电子的自旋将自然地包含在相对论的波动方程Dirac方程中。
== 电子自旋的发现
碱金属元素有特征光谱的双线结构。
*Stern-Gerlach*实验(1922):测量银原子的磁矩。
#figure(
image("pic/2024-05-27-19-26-50.png", width: 60%),
caption: [
Stern-Gerlach实验
],
)
让银原子通过不均匀的磁场
$
arrow(B) = B(z) arrow(e)_z
$
根据银原子的磁矩$arrow(mu)$在这个磁场中的势能:
$
U = - arrow(mu) dot arrow(B) = - mu_z B(z)
$
受力
$
arrow(F) = - grad U = - mu_z (partial B(z))/(partial z) arrow(e)_z
$
这个力使它的飞行轨迹发生偏转,*偏转大小和原子磁矩在磁场方向上的投影$mu_z$成正比*。实验结果是
$
mu_z = ± mu_B, mu_B = (e hbar) / (2 m) "Bohr磁子"
$
电子有磁矩,其投影是量子化的。推论:*电子有自旋(内禀角动量),其投影也是量子化的*。
Uhlenbeck-Goudsmit假设(1925):*电子有自旋角动量*,其投影只能取两个值:
$
S_z = ± hbar/2
$
不能将电子的自旋按照经典的图像看作是带电的小球绕自身轴的自转。要达到实验观测到的磁矩,小球表面的线速度将超过光速。
== 电子自旋的描述
自旋这个新的自由度的特点:
- 是个内禀的物理量,不能用坐标、动量、时间等变量表示
- 完全是一种量子效应,没有经典的对应:$hbar -> 0$时,自旋角动量消失
- 是角动量,满足角动量算符的最一般的对易关系
- 电子自旋在空间任何方向上的投影只取
$
plus.minus hbar/2
$
$hat(S)_x, hat(S)_y, hat(S)_z$的本征值是$± hbar/2$,
$
hat(S)_x^2 = hat(S)_y^2 = hat(S)_z^2 = (hbar/2)^2\
hat(S)^2 = hat(S)_x^2 + hat(S)_y^2 + hat(S)_z^2 = (3/4) hbar^2
$
- 一般总自旋为$j$的粒子,自旋算符要用$(2j + 1)times(2j + 1)$维矩阵表示。对于电子,$j = 1/2$,自旋算符是$2times 2$矩阵。
自旋角动量又导致电子有*自旋磁矩*,其$z$轴投影为
$
mu_z / S_z = - e/m_e , mu_z = minus.plus mu_B
$
*自旋角动量算符*记为$hat(arrow(S))$,*自旋磁矩算符*记为$hat(arrow(mu))$,它们之间的关系是
$
hat(arrow(mu)) = - e /m_e hat(arrow(S))
$
$hat(S)_x, hat(S)_y, hat(S)_z$都是2×2的矩阵,通常选择$hat(S)_z$为对角阵,即在$(hat(S)^2, hat(S)_z)$表象下,$hat(S)_z$的矩阵形式为
$
hat(S)_z = hbar/2 mat(
1,0;
0,-1
)
$
根据递推关系
$
hat(S)_plus.minus ket(m) = hbar sqrt(3/4 - m(m ± 1)) ket(m ± 1)
$
可以求其他算符的矩阵形式
$
hat(S)_plus mat(0;1) = hbar mat(1;0), hat(S)_plus mat(1;0) = 0 => hat(S)_plus = hbar mat(0,1;0,0)
$
同理有:
$
hat(S)_minus = hbar mat(0,0;1,0)
$
从而$hat(S)_x, hat(S)_y$的矩阵形式为
$
hat(S)_x = hbar/2 mat(
0,1;
1,0
), hat(S)_y = hbar/2 mat(
0,-i;
i,0
)
$
我们记Pauli矩阵
$
sigma_x = mat(
0,1;
1,0
), sigma_y = mat(
0,-i;
i,0
), sigma_z = mat(
1,0;
0,-1
)
$
则
$
hat(S)_x = hbar/2 sigma_x, hat(S)_y = hbar/2 sigma_y, hat(S)_z = hbar/2 sigma_z\
hat(arrow(S)) = hbar/2 hat(arrow(sigma))
$
这就是电子自旋的描述。
$hat(S)_z$对应的本征值$± hbar/2$,对应的本征态是
$
ket(hbar/2) = mat(1;0), ket(-hbar/2) = mat(0;1)
$
电子的任何自旋态$v$可以表示成
$
ket(v) = c_1 ket(hbar/2) + c_2 ket(-hbar/2) = mat(c_1;c_2)
$
其中$c_1$是某自旋态下$S_z$取$+hbar/2$的概率,$c_2$是某自旋态下$S_z$取$-hbar/2$的概率。自旋波函数归一化的条件:
$
v^dagger v = 1 => |c_1|^2 + |c_2|^2 = 1
$
== Pauli矩阵的主要性质
Pauli矩阵的主要性质:
- Pauli矩阵是厄密矩阵
- $i != j $时满足:
$
sigma_i sigma_j = - sigma_j sigma_i = i epsilon_(i j k) sigma_k
$
Pauli矩阵是彼此反对易的,满足对易关系
$
[sigma_i, sigma_j] = i epsilon_(i j k) sigma_k
$
- 满足
$
sigma_i^2 = I
$
其中$I$是单位矩阵,Pauli矩阵是*幺正矩阵*。
上面两个式子可以合并为
$
sigma_i sigma_j = delta_(i j) I + i epsilon_(i j k) sigma_k
$
具有这类关系的矩阵称为*Clifford代数*。
- 满足:
$
(arrow(a) dot arrow(sigma)) (arrow(b) dot arrow(sigma)) = arrow(a) dot arrow(b) I + i arrow(a) crossproduct arrow(b) dot arrow(sigma)
$
== 带有自旋的电子波函数和算符
现在电子的波函数应该同时描写它的自旋状态。由叠加原理
$
Psi(arrow(r), t) = Psi_1 (arrow(r), t) v_+ + Psi_2 (arrow(r), t) v_- = mat(Psi_1 (arrow(r), t); Psi_2 (arrow(r), t))
$
这称为电子的*二分量波函数*,又称为*二分量旋量*。其中
$
Psi_1 (arrow(r), t) = Psi(arrow(r) , t, S_z = hbar/2), Psi_2 (arrow(r), t) = Psi(arrow(r) , t, S_z = -hbar/2)
$
如果$Ψ_1$和$Ψ_2$不具有固定比例(即轨道和自旋波函数不能分离变量),则粒子处于轨道和自旋的*耦合态*。
粒子轨道和自旋无耦合时,粒子的总波函数可以写为空间部分$psi(x)$和自旋部分$ket(chi)$的直积态:
$
Psi(arrow(r), t) = psi(arrow(r), t) ket(chi)
$
设$ket(chi) = c_1 ket(arrow.t) + c_2 ket(arrow.b) = mat(c_1; c_2)$,其中$ket(arrow.t)$和$ket(arrow.b)$是自旋向上和向下的本征态,$c_1$和$c_2$是自旋向上和向下的概率振幅。则在空间任意位置$x$找到粒子自旋向上和向下概率之比不依赖于$x$:
$
abs(psi braket(arrow.t , chi))^2/abs(psi braket(arrow.b , chi))^2 = abs(c_1)^2/abs(c_2)^2
$
相反的,如果这个比值依赖于$x$,则说明轨道和自旋耦合:
$
psi_1 ket(arrow.t) + psi_2 ket(arrow.b) = psi_1 mat(1;0) + psi_2 mat(0;1) = mat(psi_1; psi_2)
$
对于这样的波函数和算符,原先的公式需要稍加修正
- 波函数的归一化是:
$
integral Psi^dagger Psi dd(arrow(r)) = integral (abs(Psi_1)^2 + abs(Psi_2)^2) dd(arrow(r)) = 1
$
- 电子的空间几率密度是:
$
W(arrow(r)) = Psi^dagger(arrow(r)) Psi(arrow(r)) = abs(Psi_1)^2 + abs(Psi_2)^2
$
- 电子的两种自旋状态的几率是:
$
W_arrow.t (arrow(r)) = abs(Psi_1)^2, W_arrow.b (arrow(r)) = abs(Psi_2)^2
$
如果自旋和轨道*非耦合*(即没有自旋-轨道相互作用)的状态,此时$Psi_1$和$Psi_2$函数形式呈固定比例:
$
Psi(arrow(r), t) = Psi_0 (arrow(r), t) mat(a; b)
$
其中$Psi_0$是轨道波函数,$a$和$b$是常数,$|a|^2 + |b|^2 = 1$。自然界的电子当然是带有自旋的,但是我们以前不考虑电子自旋也做过许多计算,在实质上,那等于是假设了电子是处在上述的自旋和轨道非耦合的状态下,所以电子的自旋自由度不带来可观察到的影响。
- 算符的平均值是:
$
macron(A) = integral Psi^dagger hat(A) Psi dd(arrow(r)) = integral (mat(Psi_1^*, Psi_2^*) hat(A) mat(Psi_1; Psi_2)) dd(arrow(r))
$
$Psi^dagger hat(A) Psi$在一般情况下既包括坐标函数的运算又包括矩阵运算。
如果算符$hat(A)$和自旋无关($hat(A)$不作用在自旋态$ket(chi)$上,如动量算符等),则$hat(A)$在自旋表象中的矩阵表示是对角化的:
$
A_(1 1) = braket(arrow.t , hat(A) , arrow.t) = hat(A) braket(arrow.t) = hat(A)\
hat(A) = mat(
hat(A), 0;
0, hat(A)
)
$
== 静磁场中电子的自旋
自旋角动量与磁场耦合能对应的算符:
$
- hat(arrow(mu)) dot arrow(B) = - g hat(arrow(S)) dot arrow(B)
$
如果不考虑粒子空间运动,只考虑内禀自旋运动,那么:
$
hat(H) = - g hat(arrow(S)) dot arrow(B) = - (g hbar B)/2 arrow(sigma) dot arrow(e)_B
$
$arrow(sigma) dot arrow(e)_B$的本征值是$±1$。
$
omega_L = - g B
$
为*拉莫频率*。
== 自旋量子态的时间演化与量子跃迁
设粒子在$t=0$时处于自旋量子态$ket(chi)$,则其在后续任意时刻$t$的自旋波函数可表示为
$
ket(chi(t)) &= e^(- i/hbar t hat(H)) ket(chi(0))\
&= e^(- i (w_L t)/2 arrow(sigma) dot arrow(e)_B) mat(a_0; b_0) sigma_z"表象"\
&= (cos(w_L/2 t) - i sin(w_L/2 t) arrow(sigma) dot arrow(e)_B ) mat(a_0; b_0)\
$
如果时间演化算符具有非0非对角矩阵元,则有可能出现自旋向上和向下的部分相互“*跃迁*”。
例:取$arrow(B)$沿$x$轴方向,$ket(chi(0))$为自旋向上的$sigma_z$本征态,则
$
ket(chi(t)) &= (cos(w_L/2 t) - i sin(w_L/2 t) sigma_x) mat(1;0)\
&= mat(
cos(w_L/2 t), - i sin(w_L/2 t);
- i sin(w_L/2 t), cos(w_L/2 t)
) mat(1;0)\
&= mat(
cos(w_L/2 t);
- i sin(w_L/2 t)
)
$
这种系统周期性地在两种不同量子态间来回跃迁又称为*振荡*(oscillation)。粒子自旋出现振荡现象的原因是:$sigma_z$和哈密顿算符不对易,自旋态$ket(chi)$不是定态。
相反,如果$arrow(e)_B$沿$z$轴方向,则$hat(H) = 1/2 hbar omega_L sigma_z$和$sigma_z$对易,那么就不存在两个自旋量子态之间的跃迁,这时$ket(chi)$可为任意自旋态
$
ket(chi(t)) = ( cos(omega_L t/2) - i sin(omega_L t/2) sigma_z ) ket(chi(0)) = mat(e^(- i omega_L t/2) a_0 ; e^(i omega_L t/2) b_0)
$
这时候自旋态的概率就不发生震荡了。
= 角动量的合成、角动量耦合表象、反常塞曼效应(Bell基)
== 角动量的合成
=== 角动量合成的一般规则
设$hat(arrow(J))_1$和$hat(arrow(J))_2$是两个互相独立的角动量,它们的分量分别满足角动量算符的对易关系($[hat(J)_i, hat(J)_j] = i hbar epsilon_(i j k) hat(J)_k$),而它们互相之间是对易的:$hat(arrow(J))_1$和$hat(arrow(J))_2$是对易的,即$[hat(J)_(1 i), hat(J)_(2 j)] = 0$。
矢量和$arrow(J) = arrow(J)_1 + arrow(J)_2$也就是各个分量对应相加:
$
hat(J)_i = hat(J)_(1 i) + hat(J)_(2 i)
$
得到的$hat(arrow(J))$也是角动量算符,满足角动量算符的对易关系。
从*未耦合(也就是和还未相加)*的角度看来,这个体系的对易可观测量完全集CSCO是
$
hat(J)_1^2, hat(J)_2^2, hat(J)_1^2, hat(J)_2^2
$
共同本征态是
$
ket(j_1","m_1","j_2","m_2) = ket(j_1","m_1) ket(j_2","m_2)
$
是态的直积,并矢。Hilbert空间的总维数是$(2j_1 + 1)(2j_2 + 1)$。
而*角动量耦合*以后,体系的CSCO变成了
$
hat(J)^2, hat(J)_z, hat(J)_1^2, hat(J)_2^2
$
它们是两两对易的,把耦合以后的共同本征态记做
$
ket(j","m";"j_1","j_2)
$
根据态叠加原理和本征函数完备性:
$
ket(j","m";"j_1","j_2) = sum_(m_1,m_2) C(j ,m; j_1, m_1, j_2, m_2) ket(j_1","m_1) ket(j_2","m_2)
$
用$hat(J)_z = hat(J)_(1z) + hat(J)_(2z)$的本征态展开:
$
m ket(j m j_1 j_2) = sum_(m_1,m_2) (m_1 + m_2) C(j ,m; j_1, m_1, j_2, m_2) m_1 ket(j_1 m_1) ket(j_2 m_2)
$
得到
$
sum_(m_1,m_2) (m - m_1 -m_2) C(j ,m; j_1, m_1, j_2, m_2) ket(j_1 m_1) ket(j_2 m_2) = 0
$
其中$ket(j_1 m_1) ket(j_2 m_2)$两两正交,所以有
$
(m - m_1 - m_2) C(j ,m; j_1, m_1, j_2, m_2) = 0
$
只有在
$
m = m_1 + m_2
$
才可能有
$
C(j ,m; j_1, m_1, j_2, m_2) != 0
$
于是
$
ket(j","m";"j_1","j_2) = sum_(m = m_1 + m_2) C(j ,m; j_1, m_1, j_2, m_2) ket(j_1","m_1) ket(j_2","m_2)
$
#newpara()
在一个特殊的状态下,直积的本征态和耦合的本征态是相同的,那就是“最大投影态”$ket(j_1 j_1) ket(j_2 j_2)$。$m_1 = j_1, m_2 = j_2$,$m = j_1 + j_2$为其最大值。$m$的最大值显然也是$j$的最大值。注意到:
$
hat(J)^2 = (hat(arrow(J))_1 + hat(arrow(J))_2)^2 = hat(arrow(J))_1^2 + hat(arrow(J))_2^2 + 2 hat(arrow(J))_1 dot hat(arrow(J))_2 = hat(arrow(J))_1^2 + hat(arrow(J))_2^2 + hat(J)_(1 +) hat(J)_(2 -) + hat(J)_(1 -) hat(J)_(2 +) + 2 hat(J)_(1 z) hat(J)_(2 z)
$
作用到最大投影态上:
$
hat(J)^2 ket(j_1 j_1) ket(j_2 j_2) &= hat(arrow(J))_1^2 + hat(arrow(J))_2^2 + hat(J)_(1 +) hat(J)_(2 -) + hat(J)_(1 -) hat(J)_(2 +) + 2 hat(J)_(1 z) hat(J)_(2 z) ket(j_1 j_1) ket(j_2 j_2)\
&= (j_1(j_1 + 1) + j_2(j_2 + 1) + 2 j_1 j_2) ket(j_1 j_1) ket(j_2 j_2)\
&= (j_1 + j_2)(j_1 + j_2 + 1) ket(j_1 j_1) ket(j_2 j_2)
$
即
$
ket(j_1 j_1) ket(j_2 j_2) = ket(j = j_1 + j_2","m = j_1 + j_2","j_1","j_2)
$
对于态$j = j_1 +j_2$,它是$j$的最大可能值
$
j_max = j_1 + j_2
$
让$m_1$或$m_2$减小1,未耦合的本征态就是$ket(j_1 j_1 -1)ket(j_2 j_2)$或$ket(j_1 j_1)ket(j_2 j_2 -1)$,耦合以后的本征态就是$ket(j = j_1 + j_2","m = j_1 + j_2 - 1","j_1","j_2)$或$ket(j = j_1 + j_2-1","m = j_1 + j_2 - 1","j_1","j_2)$。所以$j$的下一个可能值是
$
j = j_1 + j_2 - 1
$
至于说$j$的最小可能值$j_min$,我们可以通过总自由度的分析得出。从未耦合的角度来看,体系的总自由度(即CSCO表象基底的个数)是$(2j_1 + 1)(2j_2 + 1)$,而从耦合表象的角度来看,总自由度是
$
sum_(j = j_min)^(j_max) (2j + 1) = (2j_1 + 1)(2j_2 + 1)
$
得到$j_min = |j_1 - j_2|$。
所以,最后结论是
$
j = |j_1 - j_2|, |j_1 - j_2| + 1, ..., j_1 + j_2
$
或者记为
$
abs(j_1 - j_2) <= j <= j_1 + j_2
$
以及
$
m = m_1 + m_2
$
这个合成法则是量子力学中的重要法则。在直观上,这是矢量相加的三角形法则的结果,上述关系又称为*三角形关系*。
== 合成角动量的本征态
我们还需要知道角动量合成以后的本征态是什么,也就是说,要找出在式子
$
ket( j","m";"j_1","j_2) = sum_(m = m_1 + m_2) C(j ,m; j_1, m_1, j_2, m_2) ket(j_1","m_1) ket(j_2","m_2)
$
中的系数$C(j ,m; j_1, m_1, j_2, m_2)$被称为*Clebsch-Gordan*(克莱布希-戈尔丹)系数(CG系数)
首先,从前面的分析中知道:只有在
$
j = j_1 + j_2, j_1 + j_2 - 1, ..., |j_1 - j_2|
$
和
$
m = m_1 + m_2
$
才有$C(j ,m; j_1, m_1, j_2, m_2) != 0$:
$
ket(j","m";"j_1","j_2) = sum_(m = m_1 + m_2) C(j ,m; j_1, m_1, j_2, m_2) ket(j_1","m_1) ket(j_2","m_2)
$
#newpara()
其次,求CG系数的基本出发点就是让各量子态满足
$
hat(J)^2 ket(j","m";"j_1","j_2) = j(j + 1) hbar^2 ket(j","m";"j_1","j_2)\
hat(J)_z ket(j","m";"j_1","j_2) = m hbar ket(j","m";"j_1","j_2)\
hat(J)_1^2 ket(j_1","m_1) = j_1(j_1 + 1) hbar^2 ket(j_1","m_1)\
hat(J)_(1 z) ket(j_1","m_1) = m_1 hbar ket(j_1","m_1)\
hat(J)_2^2 ket(j_2","m_2) = j_2(j_2 + 1) hbar^2 ket(j_2","m_2)\
hat(J)_(2 z) ket(j_2","m_2) = m_2 hbar ket(j_2","m_2)
$
求出CG系数的一般表达式是一件相当困难的工作,其结果也相当复杂。我们只在下面给出两个具体的(也是很重要的)例子。
=== 电子的旋-轨耦合总角动量
子的总角动量就是它的轨道角动量和自旋角动量之和:
$
hat(arrow(J)) = hat(arrow(L)) + hat(arrow(S))
$
其中
$
j_1 = l = 0, 1, 2, ...\
j_2 = s = 1/2
$
所以
$
j = l+1/2 或 l-1/2
$
从而$j$一定是半整数。
轨道角动量的本征态是球谐函数$Y_(l m)$,而电子自旋本征态是$v_+$和$v_-$,,所以电子总角动量的本征态应该写成如下的形式:
$
ket(j","m) = c_1 ket(l","m-1/2) ket(1/2","1/2) + c_2 ket(l","m+1/2) ket(1/2","-1/2)
$
或者等价地写为二分量旋量的形式:
$
psi_(j m) = c_1 Y_(l,m-1/2) v_+ + c_2 Y_(l,m+1/2) v_- = mat(
c_1 Y_(l,m-1/2);
c_2 Y_(l,m+1/2)
)
$
#figure(
image("pic/2024-05-28-14-07-29.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-28-14-07-55.png", width: 80%),
numbering: none
)
从而对于$j = l + 1/2$来说:
$
ket(l + 1/2","m) = sqrt((j + m)/(2l+1)) ket(l","m-1/2) ket(1/2","1/2) + sqrt((j - m)/(2l+1)) ket(l","m+1/2) ket(1/2","-1/2)
$
*CG系数的特点及符号约定*:CG系数都为*实数*,同时在$m=j,m_1=j_1$时,系数为*非负实数*。
把这两组本征态用幺正变换联系起来就是:
$
mat(
ket(l + 1/2","m);
ket(l - 1/2","m)
) = 1/sqrt(2l + 1)
mat(
sqrt(l + 1/2 + m), sqrt(l + 1/2 - m);
- sqrt(l + 1/2 + m), sqrt(l + 1/2 - m)
)
mat(
ket(l","m - 1/2) ket(1/2","1/2);
ket(l","m + 1/2) ket(1/2","-1/2)
)
$
其逆变换:
$
mat(
ket(l","m - 1/2) ket(1/2","1/2);
ket(l","m + 1/2) ket(1/2","-1/2)
) = 1/sqrt(2l + 1)
mat(
sqrt(l + 1/2 + m), - sqrt(l + 1/2 + m);
sqrt(l + 1/2 - m), sqrt(l + 1/2 - m)
)
mat(
ket(l + 1/2","m);
ket(l - 1/2","m)
)
$
下面通过几个例题来研究耦合表象$(j m j_1 j_2)$的一些性质。
_L-S耦合表象本征态是否也是算符$hat(S)_z$的本征态?如果不是求其在L-S平行耦合态下的平均值。_
考虑到$hat(S)_z$与$hat(J)_z, hat(L)^2, hat(S)^2$对易,但对于$hat(J)^2$:
$
[hat(J)^2, hat(S)_z] &= [hat(L)^2 + hat(S)^2 + hat(L)_+ hat(S)_- + hat(L)_- hat(S)_+ + 2 hat(L)_z hat(S)_z, hat(S)_z] \
& = hat(L)_+ [ hat(S)_-, hat(S)_z] + hat(L)_- [ hat(S)_+, hat(S)_z]\
& =^([hat(J)_plus.minus , hat(J)_z] = minus.plus hbar hat(J)_plus.minus) hbar( hat(L)_+ hat(S)_- - hat(L)_- hat(S)_+)\
&!= 0
$
从而L-S耦合表象本征态不是$hat(S)_z$的本征态。我们可以求出其平均值:
$
macron(S)_z = braket(j m , hat(S)_z , j m )
$
方法1:对平行耦合态(j=l+1/2),量子态表示为二分量旋量形式
$
ket(j m) = 1/sqrt(2l + 1) mat(
sqrt(j + m) Y_(l,m-1/2);
sqrt(j - m) Y_(l,m+1/2)
)
$
从而
$
macron(S)_z &= hbar/(2(2l+1)) integral mat(
sqrt(j + m) Y_(l,m-1/2);
sqrt(j - m) Y_(l,m+1/2)
)^dagger sigma_z mat(
sqrt(j + m) Y_(l,m-1/2);
sqrt(j - m) Y_(l,m+1/2)
) dd(tau)\
&= hbar/(2(2l+1)) integral mat(
sqrt(j + m) Y_(l,m-1/2);
sqrt(j - m) Y_(l,m+1/2)
)^dagger mat(
sqrt(j + m) Y_(l,m-1/2);
- sqrt(j - m) Y_(l,m+1/2)
) dd(tau)\
&= (m hbar)/(2l+1)
$
方法2:直接分解到本征态的形式
$
ket(j m) = C_1 ket(l m - 1/2) ket(1/2 1/2) + C_2 ket(l m + 1/2) ket(1/2 -1/2)
$
从而
$
macron(S)_z &= abs(C_1)^2 hbar/2 - abs(C_2)^2 hbar/2\
&= ((j+m)/(2l+1) - (j-m)/(2l+1)) hbar/2\
&= (m hbar)/(2l+1)
$
#newpara()
_例(2):求下面算符$hat(S)_z$作用在耦合表象基底上的展开式_
$
hat(S)_z ket(j m l 1/2)
$
首先由$hat(S)_z$与$hat(J)_z, hat(L)^2, hat(S)^2$对易,展开式中$m,l,1/2$量子数固定不变。而$hat(S)_z$与$hat(J)^2$不对易,用$hat(S)_z$的本征态展开:
$
hat(S)_z ket(j m l 1/2) &= C_(l + 1/2) ket(l+1/2","m","l","1/2) + C_(l - 1/2) ket(l-1/2","m","l","1/2)
$
其实这是一个表象变换的问题,在旧基底(非耦合表象)中,$hat(S)_z$是对角化的。即在基底
$
mat(
ket(l","m-1/2) ket(1/2","1/2);
ket(l","m+1/2) ket(1/2","-1/2)
)
$
下,$hat(S)_z$的矩阵形式是
$
hbar/2 mat(
1, 0;
0, -1
)
$
而新基底(耦合表象)用旧基底表示的展开式是
$
mat(
ket(l + 1/2","m);
ket(l - 1/2","m)
) &= 1/sqrt(2l + 1)
mat(
sqrt(l + 1/2 + m), sqrt(l + 1/2 - m);
- sqrt(l+ 1/2 + m), sqrt(l + 1/2 - m)
)
mat(
ket(l","m - 1/2) ket(1/2","1/2);
ket(l","m + 1/2) ket(1/2","-1/2)
)\
& = U^* mat(
ket(l","m - 1/2) ket(1/2","1/2);
ket(l","m + 1/2) ket(1/2","-1/2)
)
$
于是$hat(S)_z$在新基底的矩阵形式是
$
U hbar/2 mat(
1, 0;
0, -1
) U^dagger &= hbar/(2(2l + 1)) mat(
sqrt(l + 1/2 + m), sqrt(l + 1/2 - m);
- sqrt(l + 1/2 + m), sqrt(l + 1/2 - m)
) mat(
1, 0;
0, -1
) mat(
sqrt(l + 1/2 + m), - sqrt(l + 1/2 + m);
sqrt(l + 1/2 - m), sqrt(l + 1/2 - m)
)\
&= hbar/(2(2l+1)) mat(
2m,-sqrt((2l+1)^2 - 4m^2);
-sqrt((2l+1)^2 - 4m^2), -2m
)
$
也就是说
$
hat(S)_z mat(
ket(l + 1/2","m);
ket(l - 1/2","m)
) &= hbar/(2(2l+1)) mat(
2m,-sqrt((2l+1)^2 - 4m^2);
-sqrt((2l+1)^2 - 4m^2), -2m
) mat(
ket(l + 1/2","m);
ket(l - 1/2","m)
)\
$
即有
$
braket(l plus.minus 1/2 "," m "," l "," 1/2 , hat(S)_z , l plus.minus 1/2 "," m "," l "," 1/2) = plus.minus (hbar m)/(2l+1)
$
这就是例1的结果。
方法二:先让$hat(S)_z$作用于直积态基底,然后把直积态基底转换为耦合态基底
#figure(
image("pic/2024-05-30-16-46-15.png", width: 80%),
numbering: none
)
#figure(
image("pic/2024-05-30-16-47-05.png", width: 80%),
numbering: none
)
_例(3):算符$hat(arrow(L)) dot hat(arrow(S))$的本征态是非耦合表象的基底,还是L-S耦合表象的基底?_
$
hat(arrow(L)) dot hat(arrow(S)) = 1/2(hat(J)^2 - hat(L)^2 - hat(S)^2)
$
所以$hat(arrow(L)) dot hat(arrow(S))$和$hat(J)^2, hat(L)^2, hat(S)^2$对易,同时
$
[hat(J)^2, hat(S)_z] != 0, [hat(J)^2, hat(L)_z] != 0
$
所以$hat(arrow(L)) dot hat(arrow(S))$的本征态*是L-S耦合表象的基底*。
=== 碱金属原子光谱双线结构
电子轨道角动量产生磁场必定与电子本身自旋产生的磁距发生相互作用,从而改变原子能级,使光谱线产生分裂。
电子绕原子核旋转,在电子静止坐标系中看,等效于原子核$(+Z e)$绕电子旋转。把原子核绕电子转动想象成一个半径为$a$的电流环,则电流环圆心处磁感应强度$B$及环电流$I$为
$
B = (mu_0 I)/(2 a), I = (Z e v)/(2 pi a)\
B = (mu_0 Z e v)/(4 pi a^2), arrow(B) = (mu_0 Z e)/(4 pi a^3) arrow(a) crossproduct arrow(v)
$
于是电子旋-轨耦合能量为
$
- arrow(mu) dot arrow(B) = - ((-e)/m) arrow(S) dot (mu_0 Z e)/(4 pi a^3) arrow(a) crossproduct arrow(v) = 1/(m^2 c^2) 1/(4 pi epsilon_0) (Z e^2)/a^3 arrow(S) dot (arrow(a) crossproduct arrow(p)) = 1/(m^2 c^2) 1/a dd(V)/dd(a) arrow(S) dot arrow(L)
$
其中
$
c= 1/sqrt(epsilon_0 mu_0),V= - (Z e^2)/(4 pi epsilon_0 a), dd(V)/dd(a) = (Z e^2)/(4 pi epsilon_0 a^2) >0
$
正确的表达式还应加入Thomas进动修正(相对论修正,1926),所以最后(用$r$代替$a$)
$
- arrow(mu) dot arrow(B) = 1/(2 m^2 c^2) 1/r dd(V)/dd(r) arrow(S) dot arrow(L)
$
这一结果也可由狄拉克方程在非相对论极限下给出。由此看出,当旋-轨角动量平行时,耦合能量为正,反之为负。考虑到*旋-轨耦合*后的哈密顿算符为:
$
hat(H) = hat(p)^2/(2 mu) + V(r) + xi(r) arrow(L) dot arrow(S)
$
其中
$
xi(r) = 1/(2 m^2 c^2) dd(V)/dd(r)
$
这里$V(r)$应理解为库仑屏蔽势(碱金属原子内层电子对核有屏蔽作用)。由于有$hat(arrow(L))dot hat(arrow(S))$项,所以能级一般与量子数$n,l, j$都有关系:
$
hat(arrow(L)) dot hat(arrow(S)) = 1/2(hat(J)^2 - hat(L)^2 - hat(S)^2)
$
不考虑微扰项$xi(r) arrow(L) dot arrow(S)$,系统本征量子态的角度部分为(取L-S耦合表象)$ket(j","m_j","l","1/2)$,空间径向部分为$ket(n","l)$,整体就是
$
ket(n","j","m_j","l","1/2) = ket(n","l) ket(j","m_j","l","1/2)
$
如果把耦合项看作微扰,则耦合项引起的附加能量近似为
$
Delta E &= braket(n","j","m_j","l","1/2 , xi(r) arrow(L) dot arrow(S) , n","j","m_j","l","1/2) \
&= braket(n l, xi(r), n l) braket(j","m_j","l","1/2 , arrow(L) dot arrow(S) , j","m_j","l","1/2)\
&= xi_(n l) hbar^2/2 (j(j+1) - l(l+1) - 3/4) = cases(
1/2 hbar^2 xi_(n l) 当(j= l+1/2) , - (l + 1)/2 hbar^2 xi_(n l)当 (j= l-1/2)
)
$
其中$xi_(n l) = braket(n l, xi(r), n l)$,所以由于旋-轨耦合作用使原来的每条能级分裂成了两条。
钠黄线的双线分裂:
#figure(
image("pic/2024-05-30-17-17-05.png", width: 80%),
caption: [
钠黄线的双线分裂
],
)
在考虑旋-轨耦合作用后,钠原子$3P$能级分裂为$3P_(3/2)$和$3P_(1/2)$。其中前者的简并度为4,后者的简并度为2。
=== 反常塞曼效应
前面我们讲到了由于*旋-轨耦合*$xi(r) arrow(L) dot arrow(S)$产生的*碱金属原子的双线结构*。
由于*磁-轨耦合*$(e B)/(2 mu)hat(L)_z$产生的*正常塞曼效应*,以及*电子在外磁场中的能量*$(e B)/(mu)hat(S)_z$。
现在考虑*旋-轨耦合*和*磁-轨耦合*的共同作用,即*反常塞曼效应*。同时外加磁场$B$较弱,后两项与旋-轨耦合能量相当的情况。这时哈密顿算符的形式为
$
hat(H) &= hat(p)^2/(2 mu) + V(r) + xi(r) arrow(L) dot arrow(S) + (e B)/(2 mu) (hat(L)_z + 2 hat(S)_z)\
&= hat(p)^2/(2 mu) + V(r) + xi(r)/2 (hat(J)^2 - hat(L)^2 - hat(S)^2) + (e B)/(2 mu) hat(J)_z + (e B)/(2 mu) hat(S)_z
$
如果没有最后一项$(e B)/(2 mu) hat(S)_z$,根据前面的讨论,可以使用旋-轨耦合表象来表示系统的本征态。
设无外磁场时系统本征能量和本征态为
$
E_(n l j) , ket(n "," j "," m_j "," l "," 1/2)
$
每条能级是$(2j+1)$重简并。现在考虑加入$(e B)/(2 mu) hat(J)_z$项,则因为这一项与原哈密顿算符对易,系统量子态不变,但能级会多出一项变为:
$
E_(n l j m_j) = E_(n l j) + (e B)/(2 mu) m_j hbar
$
这样$(2j+1)$重简并就被完全消除了。
现在再考虑加入最后一项$(e B)/(2 mu) hat(S)_z$,由于这一项与原哈密顿算符不对易,所以新的本征态函数很难求出。但是如果仍沿用原有的波函数态$ket(n "," j "," m_j "," l "," 1/2)$,同时把最后一项看作*微扰*,则其对原能级的微扰修正为
$
Delta E = braket(n "," j "," m_j "," l "," 1/2 , (e B)/(2 mu) hat(S)_z , n "," j "," m_j "," l "," 1/2)
$
根据前面例2的计算,其结果为
$
Delta E = plus.minus (e B hbar)/(2 mu (2l + 1) ) m_j
$
于是最后修正后的能级为
$
E = cases(
E_(n l j) + (e B)/(2 mu) (1 + 1/(2l + 1)) hbar m_j 当(j = l + 1/2) , E_(n l j) + (e B)/(2 mu) (1 - 1/(2l + 1)) hbar m_j 当(j = l - 1/2)
)
$
钠双黄线在弱磁场下的分裂:
#figure(
image("pic/2024-06-07-12-47-42.png", width: 80%),
caption: [
钠双黄线在弱磁场下的分裂
],
)
与正常塞曼效应相比,反常塞曼效应是光谱线分裂为*偶数条*。
== 两个电子自旋的合成
设$hat(arrow(S))_1$和$hat(arrow(S))_2$是两个电子自旋,它们的和是
$
hat(arrow(S)) = hat(arrow(S))_1 + hat(arrow(S))_2
$
现在$j_1 = j_2 = 1/2$,所以
$
S = 1 , 0
$
当两个电子的自旋互相平行的时候$S=1$,而当它们是反平行的时候$S=0$。
$S=1$是三重态因为$m = 1,0,-1$,$S=0$是单态。
设
$
nu_+ = ket(arrow.t) , nu_- = ket(arrow.b)
$
于是
$
S_z ket(arrow.t) = hbar/2 ket(arrow.t) , S_z ket(arrow.b) = - hbar/2 ket(arrow.b)
$
还有
$
S_+ ket(arrow.t) = 0 , S_+ ket(arrow.b) = hbar ket(arrow.t)\
S_- ket(arrow.t) = hbar ket(arrow.b) , S_- ket(arrow.b) = 0
$
和
$
S^2 ket(arrow.t) = 3/4 hbar^2 ket(arrow.t) , S^2 ket(arrow.b) = 3/4 hbar^2 ket(arrow.b)
$
对于两个自旋$hat(arrow(S))_1$和$hat(arrow(S))_2$未耦合的本征态,在$(sigma_(z 1), sigma_(z 2))$表象记为
$
nu_(1 +) nu_(2 +) = ket(arrow.t "," arrow.t), nu_(1 +) nu_(2 -) = ket(arrow.t "," arrow.b), nu_(1 -) nu_(2 +) = ket(arrow.b "," arrow.t), nu_(1 -) nu_(2 -) = ket(arrow.b "," arrow.b)
$
而耦合后的本征态记为$ket(S","m)$,取
$
ket(1","1) , ket(1","0) , ket(1","-1) , ket(0","0)
$
对于$S=1$的情形,当$m=1,-1$时,耦合的本征态也就是未耦合的本征态$m = m_1 + m_2$,即
$
ket(1","1) = ket(arrow.t "," arrow.t) , ket(1","-1) = ket(arrow.b "," arrow.b)
$
但是$m=0$应该是线性组合,即
$
ket(1","0) = C_1 ket(arrow.t "," arrow.b) + C_2 ket(arrow.b "," arrow.t)
$
从最大投影态出发$ket(1","1) = ket(arrow.t "," arrow.t)$,两边作用$S_-$:
$
S_- ket(1","1) &= S_(1-) ket(arrow.t "," arrow.t) + S_(2-) ket(arrow.t "," arrow.t)\
sqrt(2) ket(1","0) &= ket(arrow.b "," arrow.t) + ket(arrow.t "," arrow.b)\
ket(1","0) &= 1/sqrt(2) (ket(arrow.b "," arrow.t) + ket(arrow.t "," arrow.b))
$
两边再作用一次降算符:
$
S_- ket(1","0) &= S_(1-) ket(arrow.b "," arrow.t) + S_(2-) ket(arrow.t "," arrow.b)\
sqrt(2) ket(1","-1) &= 1/sqrt(2)(ket(arrow.b "," arrow.b) + ket(arrow.b "," arrow.b))\
ket(1","-1) &= ket(arrow.b "," arrow.b)
$
同理可以得到$S=0$的情形:
$
ket(0","0) = 1/sqrt(2) (ket(arrow.b "," arrow.t) - ket(arrow.t "," arrow.b))
$
交换两电⼦的自旋后(设自旋交换算符为$hat(P)_(12)$):
$
hat(P)_(12) ket(1","0) = ket(1","0) , hat(P)_(12) ket(0","0) = - ket(0","-0)
$
#newpara()
得到基底转换矩阵:
$
mat(
ket(1","1);
ket(1","-1);
ket(1","0);
ket(0","0)
) = mat(
1,0 ,0 ,0 ;
0,1 ,0 ,0 ;
0 ,0 , 1/sqrt(2), 1/sqrt(2);
0 ,0 , 1/sqrt(2), -1/sqrt(2)
)
mat(
ket(arrow.t "," arrow.t);
ket(arrow.b "," arrow.b);
ket(arrow.t "," arrow.b);
ket(arrow.b "," arrow.t);
)
$
即
$
U^* = mat(
1,0 ,0 ,0 ;
0,1 ,0 ,0 ;
0 ,0 , 1/sqrt(2), 1/sqrt(2);
0 ,0 , 1/sqrt(2), -1/sqrt(2)
)
$
算符$hat(S)_+ = hat(S)_(1+) + hat(S)_(2+)$在旧表象$mat(
ket(arrow.t "," arrow.t);
ket(arrow.b "," arrow.b);
ket(arrow.t "," arrow.b);
ket(arrow.b "," arrow.t);
)$下的矩阵形式是
$
mat(
0, 0, hbar, hbar;
0, 0, 0, 0;
0, hbar, 0, 0;
0, hbar, 0, 0
)
$
在新表象$mat(
ket(1","1);
ket(1","-1);
ket(1","0);
ket(0","0)
)$下的矩阵形式是
$
S_+ = U mat(
0, 0, hbar, hbar;
0, 0, 0, 0;
0, hbar, 0, 0;
0, hbar, 0, 0
) U^dagger = hbar mat(
0, 0, sqrt(2), 0;
0, 0, 0, 0;
0, sqrt(2), 0, 0;
0, 0, 0, 0
)
$
算符$hat(S)_x,hat(S)_y,hat(S)_z$在新表象中的表示是模块对角化的,也就是说具有如下形式
$
mat(
F_11,F_12,F_13,0;
F_21,F_22,F_23,0;
F_31,F_32,F_33,0;
0,0,0,F_44
)
$
从非耦合表象转换到耦合表象,就是把角动量算符的矩阵表示转变为*模块对角化(block diagonal)*的形式。
算符模块对角化的意义:每一个模块形成一个独立的子空间,不同子空间内的态矢量在转动变换下不会相互转化,只在各自所属子空间内部相互转化。如:双电子自旋三重态矢量通过角动量算符作用只在三重态内相互转换,而不会转化为单态。
#figure(
image("pic/2024-06-14-13-11-38.png", width: 80%),
numbering: none,
)
#figure(
image("pic/2024-06-14-13-12-19.png", width: 80%),
numbering: none,
)
#figure(
image("pic/2024-06-14-13-16-27.png", width: 80%),
numbering: none,
)
#figure(
image("pic/2024-06-14-13-16-41.png", width: 80%),
numbering: none,
)
= 定态微扰论
== 非简并情形
可以精确求解的量子力学问题是不多的,所以近似方法有重要的作用。微扰论是主要的近似方法之一(其它还有变分法、WKB法等)。
零级定态薛定鄂方程:
$
hat(H)^((0)) psi_n^((0)) = E_n^((0)) psi_n^((0))
$
其中$hat(H)^((0))$是容易解出的哈密顿算符,如氢原子系统、自由粒子
假设加入微扰能$hat(H)^'$,则薛定鄂方程形式应该为:
$
hat(H) psi_n = E_n psi_n, hat(H) = hat(H)^((0)) + hat(H)^'
$
$hat(H)^'$是$hat(H)^((0))$的小修正,方程的解可以用级数形式逐级展开:
$
hat(H)^' << hat(H)^((0))\
E_n = E_n^((0)) + E_n^((1)) + E_n^((2)) + ...\
psi_n = psi_n^((0)) + psi_n^((1)) + psi_n^((2)) + ...
$
其中$E_n^((0) )$和$psi_n^((0))$与$hat(H)^'$无关,而$E_n^((1))$和$psi_n^((1))$是一级微扰,和$hat(H)^'$的一次方成正比,$E_n^((2))$和$psi_n^((2))$是二级微扰......一般情况下,越高次的项越小,所以可以只保留最低的几阶,便有足够的精度。
把上述展开式代入原方程,得:
$
(hat(H)^((0)) + hat(H)^') (psi_n^((0)) + psi_n^((1)) + psi_n^((2)) + ...) = (E_n^((0)) + E_n^((1)) + E_n^((2)) + ...) (psi_n^((0)) + psi_n^((1)) + psi_n^((2)) + ...)\
(hat(H)^((0)) - E_n^((0)) + H' - E_n^((1)) - E_n^((2)) + ...) (psi_n^((0)) + psi_n^((1)) + psi_n^((2)) + ...) = 0
$
逐级比较方程两端就得到一系列方程,解出能量修正及本征函数修正。
零级方程就是无微扰时$hat(H)^((0))$的本征方程
$
(hat(H)^((0)) - E_n^((0))) psi_n^((0)) = 0
$
一级方程是
$
(hat(H)^((0)) - E_n^((0))) psi_n^((1)) = (E_n^((1)) - hat(H)^') psi_n^((0))
$
先处理非简并情形,即$hat(H)^((0))$的属于$E_n^((0))$的本征态只有一个。把$psi_n^((1))$按$hat(H)^((0))$表象的基底$psi_n^((0))$展开:
$
psi_n^((1)) = sum_m a_(n m)^((1)) psi_m^((0)), "其中" sum_m abs(a_(n m)^((1)))^2 != 1
$
再代入方程中得:
$
sum_m a_(n m)^((1)) (hat(H)^((0)) - E_n^((0))) psi_m^((0)) = - (hat(H)^' - E_n^((1))) psi_n^((0))\
sum_m a_(n m)^((1)) (E_m^((0)) - E_n^((0))) psi_m^((0)) = - (hat(H)^' - E_n^((1))) psi_n^((0))
$
利用$psi_m^((0))$的正交性,得到
$
a_(n m )^((1)) (E_m^((0)) - E_n^((0)) )= - braket(psi_m^((0)) , hat(H)^' , psi_n^((0))) + E_n^((1)) delta_(m n)
$
由于$m$的任意性,取$m=n$,得到
$
E_n^((1)) = braket(psi_n^((0)) , hat(H)^' , psi_n^((0))) = H_(n n)^'
$
其中$H_(n n)^'$就是$hat(H)'$在$hat(H)^((0))$表象中的对角矩阵元,或者说在$psi_n^((0))$中的平均值。
考虑$m != n$的情况,可以求出系数$a_(n m)^((1))$:
$
a_(n m)^((1)) = - braket(psi_m^((0)) , hat(H)^' , psi_n^((0))) / (E_m^((0)) - E_n^((0))) = H_(m n)^' / (E_n^((0)) - E_m^((0)))
$
一级微扰波函数:
$
psi_n^((1)) = sum_(m != n) H_(m n)^' / (E_n^((0)) - E_m^((0))) psi_m^((0))
$
由此,我们发现微扰论适用的条件是:
$
abs(H_(m n)^' / (E_n^((0)) - E_m^((0)))) << 1
$
利用波函数归一化:
$
braket(psi_n) = braket(psi_n^((0)) + psi_n^((1)) + psi_n^((2)) + ...) = 1
$
已知
$
braket(psi_n^((0))) = 1
$
所以逐级比较可得
$
braket(psi_n^((0)), psi_n^((1))) + braket(psi_n^((1)), psi_n^((0))) = 0\
braket(psi_n^((0)), psi_n^((2))) + braket(psi_n^((1)), psi_n^((1))) + braket(psi_n^((2)), psi_n^((0))) = 0
$
其中
$
psi_n^((1)) = sum_m a_(n m)^((1)) psi_m^((0))\
$
对$psi_n^((1))$来说,这就要求
$
a_(n n)^((1)) + a_(n n)^((1)*) = 0
$
有
$
a_(n n)^((1)) = i a_n^((1))
$
其中$a_n^((1))$是实数,且数量级与其它$a_(m n)^((1))$一致。
也能得到
$
a_(m n)^((1)) + a_(n m)^((1)*) = 0
$
而
$
a_(m n)^((1)) = H_(m n)^' / (E_n^((0)) - E_m^((0)))
$
所以
$
H' = H'^dagger
$
于是,展开到一级修正的波函数为(其中$O(a^((2)))$代表所有$a$的二次项及更高次项的集合,在每行等式里此项不一定相同)
$
psi_n &= psi_n^((0)) + i a_n^((1)) psi_n^((0)) + sum_(m != n) H_(m n)^' / (E_n^((0)) - E_m^((0))) psi_m^((0)) + O(a^((2)))\
&= e^(i a_n^((1))) psi_n^((0)) + e^(i a_n^((1))) sum_(m != n) H_(m n)^' / (E_n^((0)) - E_m^((0))) psi_m^((0)) + O(a^((2)))\
&= e^(i a_n^((1))) (psi_n^((0)) + sum_(m != n) H_(m n)^' / (E_n^((0)) - E_m^((0))) psi_m^((0)) ) + O(a^((2)))
$
可见$a_n^((1))$的效果就是给波函数乘上一个相位因子,波函数所包含的物理信息不变,不妨设$a_n^((1)) = 0$。
二级微扰方程是:
$
(hat(H)^((0)) - E_n^((0))) psi_n^((2)) = - (hat(H)^' - E_n^((1))) psi_n^((1)) + E_n^((2)) psi_n^((0))
$
将$psi_n^((1))$代入,得
$
(hat(H)^((0)) - E_n^((0))) psi_n^((2)) = - (hat(H)^' - E_n^((1))) sum_(m != n) H_(m n)^' / (E_n^((0)) - E_m^((0))) psi_m^((0)) + E_n^((2)) psi_n^((0))
$
然后方程两边左乘以$psi_n^((0))$并积分,左边为0,右边第二项为0,可以得到二阶修正能量$E_n^((2))$:
$
E_n^((2)) = sum_(m != n) H_(m n)^' / (E_n^((0)) - E_m^((0))) braket(psi_n^((0)) , hat(H)' ,psi_m^((0))) = sum_(m != n) (H_(m n)^' H_(m n)^')/ (E_n^((0)) - E_m^((0))) = sum_(m != n) abs(H_(m n)^')^2 / (E_n^((0)) - E_m^((0)))
$
最终可以得到修正的波函数和能量:
$
psi_n = psi_n^((0)) + sum_(m != n) H_(m n)^' / (E_n^((0)) - E_m^((0))) psi_m^((0)) + ...\
E_n = E_n^((0)) + H_(n n)^' + sum_(m != n) abs(H_(m n)^')^2 / (E_n^((0)) - E_m^((0))) + ...
$
=== 在静电场中的一维谐振子
假设一维谐振子还带有电荷$q$,并处在外加恒定电场$E$(沿$x$轴正向)中,那么哈密顿量是
$
hat(H) = hat(H)^((0)) + hat(H)^'\
hat(H)^((0)) = hat(p)^2/(2 mu) + 1/2 mu omega^2 hat(x)^2\
hat(H)^' = - q E hat(x)
$
一级微扰能是
$
E_n^((1)) = braket(psi_n^((0)) , hat(H)^' , psi_n^((0)) )= - q E braket(psi_n^((0)) , hat(x) , psi_n^((0))) = 0
$
继续检查能级的二阶修正:
$
H'_(m n) = - q E braket(psi_m^((0)) , hat(x) , psi_n^((0)))
$
可利用递推关系:
$
hat(x) psi_n^((0)) = sqrt(hbar/(2 mu omega)) (sqrt(n+1) psi_(n+1)^((0)) + sqrt(n) psi_(n-1)^((0)))
$
于是
$
H'_(m n) &= - q E sqrt(hbar/(2 mu omega)) (sqrt(n+1) braket(psi_m^((0)) , psi_(n+1)^((0)) ) + sqrt(n) braket(psi_m^((0)) , psi_(n-1)^((0)) ))\
& = - q E sqrt(hbar/(2 mu omega)) (sqrt(n+1) delta_(m , n+1) + sqrt(n) delta_(m , n-1))
$
所以二级微扰能是
$
E_n^((2)) &= sum_(m != n) abs(H_(m n)^')^2 / (E_n^((0)) - E_m^((0)) ) = abs(H'_(n-1 ,n))^2 / (E_n^((0)) - E_(n-1)^((0)) ) + abs(H'_(n+1 ,n))^2 / (E_n^((0)) - E_(n+1)^((0)) )\
&= q^2 E^2 hbar / (2 mu omega) (n + 1) / (hbar omega n - hbar omega (n+1)) + q^2 E^2 hbar / (2 mu omega) n / (hbar omega n - hbar omega (n-1))\
&= - (q^2 E^2) / (2 mu omega^2)
$
所以微扰以后的能级是(准确到二级微扰)
$
E_n = (n + 1/2) hbar omega - (q^2 E^2) / (2 mu omega^2)
$
这个微扰能与$n$无关。实际上,这个问题是有精确解的
$
V(x) &= 1/2 mu omega^2 x^2 - q E x\
&= 1/2 mu omega^2 (x - (q E) / (mu omega^2))^2 -( q^2 E^2) / (2 mu omega^2)
$
它的第一项只不过是把原来的谐振子势能平移了一段距离,这个移动不会影响谐振子的能级,而它的第二项正是前面求出的与$n$无关的能级修正。
== 简并情形
一级微扰能和零级波函数:
$
E_n = E_n^((0)) + E_n^((1)) + ...\
psi_n = psi_n^((0)) + psi_n^((1)) + ...\
hat(H)^((0)) psi_n^((0)) = E_n^((0)) psi_n^((0))
$
$E_n^((0))$有$k$度简并,本征波函数为
$
psi_(n 1)^((0)) , psi_(n 2)^((0)) , ... , psi_(n k)^((0))\
hat(H)^((0)) psi_(n i)^((0)) = E_n^((0)) psi_(n i)^((0)) , i = 1,2,...,k
$
其中不同的本征态之间正交。在引入微扰后应设:
$
psi_n^((0)) = sum_i c_(n i) psi_(n i)^((0))
$
代入一级微扰方程
$
(hat(H)^((0)) - E_n^((0))) psi_n^((1)) = (E_n^((1)) - hat(H)^') psi_n^((0))
$
得:
$
(hat(H)^((0)) - E_n^((0))) psi_(n)^((1)) = (E_n^((1)) - hat(H)^') sum_i c_(n i)^((0)) psi_(n i)^((0))
$
两端左乘以$psi_(n j)^((0)*)$并积分,得:
$
sum_i c_(n i)^((0)) ( braket(psi_(n j)^((0)) , hat(H)^' , psi_(n i)^((0))) - E_n^((1)) braket(psi_(n j)^((0)) , psi_(n i)^((0))) ) = 0\
sum_i c_(n i)^((0)) ( H_(j i)^' - E_n^((1)) delta_(j i) ) = 0
$
这里的$H_(j i)^' = braket(psi_(n j)^((0)) , hat(H)^' , psi_(n i)^((0)) )$注意这里$n$是固定的。这和矩阵形式的本征方程完全一样,$c_(n i)^((0))$有非0解的条件是
$
det(H' - E_n^((1))I) = 0
$
久期方程
$
det
mat(
H_(1 1)^' - E_n^((1)) , H_(1 2)^' , ... , H_(1 k)^' ;
H_(2 1)^' , H_(2 2)^' - E_n^((1)) , ... , H_(2 k)^' ;
dots.v, dots.v, dots.down, dots.v ;
H_(k 1)^' , H_(k 2)^' , ... , H_(k k)^' - E_n^((1))
) = 0
$
从中可以解出$E_n^((1))$和对应的展开系数$c_(n i)^((0))$。这就决定了一级微扰能和零级波函数。
一般来说$E_n^((1))$不仅和对角线元素$H_(i i)^'$有关,也和非对角线元素$H_(i j)^'$有关,但总有$k$个解。
假如$E_n^((1))$的$k$个解各不相同(方程没有重根),则$E_n^((0))$的简并度被完全消除,否则只可能是部分被消除。
== 原子能级在静电场中的分裂
原子能级在静电场中的分裂称为*Stark效应*。作为例子,让我们考虑氢原子。
设均匀外静电场$E$沿着正$z$轴方向,那么氢原子就受到了如下的附加势能:
$
hat(H)^' = e E z = e E r cos theta
$
在未加微扰时,氢原子的能级是
$
E_n^((0)) = - (m k_1^2 e^4)/(2 hbar^2 n^2) = -(k_1 e^2)/(2 a_0 n^2)
$
对应波函数是
$
psi_n^((0)) = R_(n l) Y_(l m)
$
能级$n$的简并度为$n^2$,对$n=2$来说是4度简并(不考虑自旋)
能级$n=2$的简并态量子数$l, m$可以取值00、10、11、1-1,并依次简记为第1、2、3、4个态。于是要计算
$
H' = braket(psi_(2 l' m')^((0)), hat(H)^', psi_(2 l m)^((0))) = e E integral r^2 R_(2 l') R_(2 l) Y_(l' m') Y_(l m) r cos theta r^2 sin theta dd(theta) dd(phi) dd(r)
$
#figure(
image("pic/2024-06-19-12-15-30.png", width: 80%),
numbering: none,
)
#figure(
image("pic/2024-06-15-01-22-21.png", width: 80%),
numbering: none,
)
我们要求出下面这个久期方程从而得到$E_2^((1))$
$
det
mat(
- E_2^((1)) , -3e E a_0, 0 , 0 ;
-3e E a_0 , - E_2^((1)) , 0 ,0;
0 , 0 , - E_2^((1)) , 0 ;
0 , 0, 0 , - E_2^((1))
)
= 0
$
得到
$
E_2^((1)) = 0, plus.minus 3 e E a_0
$
这就是说,原来简并在$n=2$上的$4$个能级,现在有一个向上移动了$3 e E a_0$,一个向下移动了$3 e E a_0$,还有两个没有移动,简并是部分地消除了。
#figure(
image("pic/2024-06-19-13-39-48.png", width: 80%),
caption: [
在电场中氢原子能级的分裂
],
)
钠双黄线问题中所用微扰近似:简并微扰
#figure(
image("pic/2024-06-19-13-40-49.png", width: 80%),
numbering: none,
)
#figure(
image("pic/2024-06-19-13-44-51.png", width: 80%),
numbering: none,
)
#figure(
image("pic/2024-06-19-13-47-30.png", width: 80%),
numbering: none,
)
#figure(
image("pic/2024-06-19-13-47-44.png", width: 80%),
numbering: none,
)
= 散射理论
== 散射波函数
如果入射波是波矢为$arrow(k)$的三维平面波,散射势能中心在原点,可以证明在$r→∞$时,散射波具有球面波的形式,综合起来:
$
lim_(r->oo) psi_(arrow(r)) = e^(i arrow(k) dot arrow(r)) + f(theta, phi) e^(i arrow(k) dot arrow(r))/r
$
类似一维散射问题,这里只关心散射部分相对入射部分的概率,所以不必关心平面波的正交归一化系数(这里直接设为1)。
入射波概率流密度:
$
arrow(J)_i = rho arrow(v) = abs(psi_i)^2 (hbar arrow(k)) /m = (hbar arrow(k)) /m
$
散射波概率流密度:
$
arrow(J)_s = (i hbar)/(2 m) (psi_s grad psi_s^* - psi_s^* grad psi_s) = (hbar k)/( r^2 m) |f(theta, phi)|^2 arrow(e)_r
$
== 散射截面
散射相对入射的大小:
$
J_s/J_i = abs(f(theta, phi))^2/r^2
$
依赖于$r$。应该考虑在$(theta, phi)$附近立体角内的概率密度流,应计算的比例关系是
$
(J_s r^2 dd(Omega))/J_i = abs(f(theta, phi))^2 dd(Omega)
$
上式计算的是散射后*单位时间*内通过立体角$dd(Omega)$对应的球面微元$r^2 dd(Omega)$的*概率*,相对入射波*单位时间*内通过*单位横截面积*的概率的大小。可惜这两个量的量纲又不同。
解决方案:设入射波通过横截面微元$dd(sigma)$的概率,经散射后全部通过立体角$dd(Omega)$对应的球面微元$r^2 dd(Omega)$流出,则有
$
J_s r^2 dd(Omega) = J_i dd(sigma)
$
于是:
$
dd(sigma) = (J_s r^2)/J_i dd(Omega) = abs(f(theta, phi))^2dd(Omega) = sigma(theta, phi) dd(Omega)
$
其中$sigma(theta, phi) = abs(f(theta, phi))^2$称为称为*微分散射横截面积*(其中$f(theta,phi)$为*微分散射振幅*),它的积分给出*总散射截面*:
$
sigma_"tot" = integral sigma(theta, phi) dd(Omega)
$
跟一维问题不同,在三维散射问题中,我们用*散射截面来作为散射发生强烈程度的度量*。散射势场对入射波的散射越强烈,散射截面就越大,即在入射波概率流密度保持不变的情况下,有更高的概率被势场散射。单位时间内入射波被散射的总概率为
$
J_i sigma_"tot" ("总散射速率")
$
单位时间内入射波被散射到$(theta, phi)$附近单位立体角内的概率为
$
J_i sigma(theta, phi) ("微分散射速率")
$
#newpara()
设无散射微扰势能$V$时系统定态方程(自由粒子)为:
$
hat(H)_0 ket(psi_0) = E ket(psi_0)
$
加上微扰$V$后:
$
(hat(H)_0 + hat(V)) ket(psi) = E ket(psi)\
cases(
(E - hat(H)_0) ket(psi_0) = 0,
(E - hat(H)_0) ket(psi) = hat(V) ket(psi)
)
$
两式相减得:
$
(E - hat(H)_0) (ket(psi) - ket(psi_0)) = hat(V) ket(psi)
$
可以形式解出$ket(psi)$*(Lippman-Schwinger方程)*:
$
ket(psi) = ket(psi_0) + (E - hat(H)_0)^(-1) V ket(psi) = ket(psi_0) + hat(G) V ket(psi)
$
其中$hat(G) = (E - hat(H)_0)^(-1)$是*Green函数*。
第一项$ket(psi_0)$代表无微扰时的0级波函数,第二项$hat(G) V ket(psi)$代表微扰修正,$hat(G) = (E - hat(H)_0)^(-1)$为与传播子相关的*格林算符*。
可以用迭代法求级数解,即方程右边的$ket(psi)$用0级近似$ket(psi_0)$代替,求得$ket(psi)$后再代入方程的右边,如此循环往复得:
$
ket(psi) &= ket(psi_0) + hat(G) V ket(psi_0) + hat(G) V hat(G) V ket(psi_0) + ...\
&= (1 + hat(G)hat(T)_s) ket(psi_0), hat(T)_s = V + V hat(G) V + ...
$
如果$hat(T)_s$取1级近似(*波恩近似*),则
$
ket(psi) = (1 + hat(G) V) ket(psi_0)
$
$
braket(arrow(r),psi) = braket(arrow(r),psi_0) + braket(arrow(r),hat(G) V, psi_0) = braket(arrow(r),psi_0) + integral dd(""^3 r') braket(arrow(r),hat(G), arrow(r')) braket(arrow(r'),V, psi_0)
$
其中$braket(arrow(r'),V, psi_0)$表示粒子在$arrow(r)'$处被散射,Green函数$braket(arrow(r),hat(G), arrow(r'))$表示粒子从$arrow(r')$传播到$arrow(r)$。下面求坐标表象中的格林函数:
$
braket(arrow(r),hat(G), arrow(r')) = integral dd(""^3 k') braket(arrow(r),1/(E-hat(H)_0), arrow(k')) braket(arrow(k'), arrow(r')) = 1/(2 pi)^3 integral dd(""^3 k') e^(i arrow(k') dot (arrow(r) - arrow(r'))) / (E - (hbar^2 k'^2) /( 2 m))
$
$
braket(arrow(r),hat(G), arrow(r')) = - (2m)/((2 pi)^3 hbar^2) integral dd(""^3 k') 1 / ((k' + k)(k' - k)) e^(i arrow(k') dot (arrow(r) - arrow(r')))
$
其中定义
$
E = (hbar^2 k^2) /(2 m)
$
$k$为入射粒子的波矢。因为被积函数在$k = k'$处有奇点,利用留数定理,可以得到
$
braket(arrow(r),hat(G), arrow(r')) = - (m)/(2 pi^2 hbar^2) 1/abs(arrow(r) - arrow(r') )e^(i k abs(arrow(r) - arrow(r')))
$
在这里还要做一个近似:因为观察点离开散射中心的距离$r$通常远大于散射势场本身的尺度$r'$(即$r >> r'$),所以
$
1/abs(arrow(r) - arrow(r')) approx 1/r \
abs(arrow(r) - arrow(r')) = sqrt(r^2 - 2 r arrow(e)_r dot arrow(r') + r'^2) approx r sqrt(1 - 2 arrow(e)_r dot arrow(r')/r ) approx r (1 - arrow(e)_r dot arrow(r')/r) = r - arrow(e)_r dot arrow(r')
$
于是
$
braket(arrow(r),hat(G), arrow(r')) = - (m)/(2 pi^2 hbar^2) e^(i k e)/r e^(-i k arrow(e)_r dot arrow(r')) = - (m)/(2 pi^2 hbar^2)e^(i k e)/r e^(- i arrow(k') dot arrow(r')), arrow(k') = k arrow(e)_r
$
另外:
$
braket(arrow(r'),V(hat(arrow(r))), psi_0) = V(r') braket(arrow(r'), psi_0) = V(r') e^(i arrow(k) dot arrow(r'))
$
于是$braket(arrow(r),psi) = braket(arrow(r),psi_0) + integral dd(""^3 r') braket(arrow(r),hat(G), arrow(r')) braket(arrow(r'),V, psi_0)$就是:
$
psi(arrow(r)) = e^(i arrow(k) dot arrow(r)) - (m)/(2 pi^2 hbar^2) e^(i k e)/r integral dd(""^3 r') e^(- i arrow(k') dot arrow(r')) V(arrow(r')) e^(i arrow(k) dot arrow(r'))
$
对比可知
$
f(theta, phi) = - m/(2 pi^2 hbar^2) integral dd(""^3 r) e^(- i arrow(k') dot arrow(r)) V(arrow(r)) e^(i arrow(k) dot arrow(r))
$
物理含义:微分散射振幅$f$正比于粒子在$V$的作用下从波矢为$arrow(k)$的平面波散射为波矢为$arrow(k')$的平面波的*跃迁矩阵元*($abs(arrow(k)) = abs(arrow(k'))$)。
#figure(
image("pic/2024-06-19-16-17-41.png", width: 20%),
numbering: none,
)
如果$V$为中心势场:$V(arrow(r)) = V(r)$,则积分可以简化$arrow(q) = arrow(k')- arrow(k)$
$
integral e^( - i arrow(q) dot arrow(r)) V(r) dd(""^3x) &= integral e^(-i q r cos theta) V(r) r^2 dd(r) sin theta dd(theta) dd(phi)\
&= integral 2 pi (2 sin (q r) )/(q r) V(r) r^2 dd(r)\
&= (4 pi)/q integral_0^oo r V(r) sin(q r) dd(r)
$
于是
$
sigma(theta ) = (4 m^2)/(hbar^4 q^2) abs(integral_0^oo r V(r) sin(q r) dd(r))^2
$
== 散射问题定态解渐进形式的讨论
$
psi(arrow(r)) = e^(i arrow(k) dot arrow(r)) + f(theta, phi) e^(i arrow(k) dot arrow(r))/r
$
渐近形式解的几点讨论:
1. 只在$r >> r'$时有意义。
2. 此形式不是自由粒子波函数的精确解,只是近似解。
3. 如果选定z轴正向沿$arrow(k)$的方向,则一般说来$f$和$phi$无关(见后面讨论)。
4. 粒子概率流密度守恒对$f(theta, phi)$的形式作出了限制:光学定理。作为光学定理的推论,在$θ=0$的方向入射和散射这两部分的波有相消干涉。
== 卢瑟福散射的波恩近似
卢瑟福散射即α离子轰击中性原子,原子核受内层电子遮挡产生屏蔽势
$
V(r) = (Z Z' e_s^2)/r e^(- r/a), e_s = e/sqrt(4 pi epsilon_0)
$
其中$a$为原子半径,$Z'e$为入射粒子电量,代入中心力场情况下微分截面的波恩近似公式
$
sigma(theta) &= (4 m^2)/(hbar^4 q^2) abs(integral_0^oo r V(r) sin(q r) dd(r))^2\
&= (4 m^2 Z^2 Z'^2 e_s^4)/(hbar^4 q^2) abs(integral_0^oo e^(- r/a) sin(q r) dd(r))^2\
&= (4 m^2 Z^2 Z'^2 e_s^4)/(hbar^4 (q^2 + 1/a^2)^2)\
$
如果入射粒子能量很高,其德布罗意波长远小于散射势场半径(这里即原子半径$a$),同时散射角$θ$不是特别小的情况下,我们有
$
q a = 2 k a sin theta/2 >> 1
$
这时散射截面就是
$
sigma(theta) approx (4 m^2 Z^2 Z'^2 e_s^4)/(hbar^4 q^2) = (Z^2 Z'^2 e_s^4)/(4 m^2 v^4 sin^4 theta/2)
$
这就是卢瑟福微分散射截面公式,由卢瑟福不考虑屏蔽作用(公式中不出现$a$)的情况下用经典力学方法计算库仑势散射得出。在高能情况下粒子的粒子性较强,波动性较弱,把其当作经典粒子进行处理是适合的(公式中不出现$hbar$)
== 散射问题中的角动量守恒
中心力场问题(束缚或非束缚)的定态薛定鄂方程为
$
(- hbar^2/(2 mu r^2) partial/(partial r) (r^2 partial/(partial r)) +V(r) + hat(L)^2/(2 mu r^2)) psi = E psi
$
在势场$V$与时间和角度(中心力场)无关的情况下,可分离变量求解,其中径向波函数满足
$
(1/r^2 dd("")/dd(r) (r^2 dd("")/dd(r)) + (2 mu)/(hbar^2) (E- V(r) - (l(l+1)hbar^2)/(2 mu r^2)) ) R(r) = 0
$
同时,其角度部分波函数解即是球谐函数$Y_(l m) (theta, phi)$ ,而且角动量算符和哈密顿对易:
$
[hat(L)^2, hat(H)] = 0, [hat(L)_z, hat(H)] = 0
$
这也就意味着*角动量在散射过程中是守恒量*。如果把散射看成含时微扰,比如初态是$l=1$态,那么散射过后末态也必为$l=1$态。
设入射粒子沿$z$轴正向,于是其角动量$arrow(L) = arrow(r) crossproduct arrow(p)$没有$z$方向分量,只有$x、y$方向的分量,也即意味着球谐函数的磁量子数$m=0$,于是被散射粒子的角度分布不显含$φ$(但可以是不同$l$的球谐函数的叠加)。所以对于中心力场,如果设入射粒子沿z轴正向,则散射问题解的渐近形式为
$
lim_(r -> oo) psi_k (r, theta) = e^(i k z) + f(theta) e^(i k z)/r
$
其中微分散射振幅不再与$φ$有关系,而只与$θ$有关。
== 全同粒子散射
不考虑全同性时双粒子平面波:
$
psi(arrow(r)_1, arrow(r)_2) = 1/(2 pi)^3 e^(i (arrow(k)_1 dot arrow(r)_1 + arrow(k)_2 dot arrow(r)_2))
$
引入质心系坐标$arrow(R) = (arrow(r)_1 + arrow(r)_2)/2$和相对坐标$arrow(r) = arrow(r)_1 - arrow(r)_2$,总波矢$arrow(K) = arrow(k)_1 + arrow(k)_2$,相对波矢$arrow(k) = arrow(k)_1 - arrow(k)_2$,则
$
psi(arrow(R), arrow(r)) = 1/(2 pi)^3 e^(i (arrow(K) dot arrow(R) + arrow(k) dot arrow(r)))
$
对称化或反对称化之后的波函数:
$
psi_(plus.minus) (arrow(R), arrow(r)) = 1/(2 pi)^3 e^(i arrow(K) dot arrow(R)) 1/sqrt(2) (e^(i arrow(k) dot arrow(r)) plus.minus e^(- i arrow(k) dot arrow(r)))
$
#newpara()
对于单粒子在固定势场中的散射,散射问题定态方程的解为
$
psi(arrow(r)) = e^(i arrow(k) dot arrow(r)) + f(theta, phi) e^(i arrow(k) dot arrow(r))/r
$
如果是双粒子散射,则考虑二者的质心坐标系,约化质量和相对坐标。这时相对坐标为
$
arrow(r) = arrow(r)_1 - arrow(r)_2
$
但是对于全同双粒子散射,$psi(arrow(r))$需要进行对称或反对称化:
$
psi(arrow(r)) = e^(i arrow(k) dot arrow(r)) plus.minus e^(- i arrow(k) dot arrow(r)) + (f(theta, phi) plus.minus f(pi - theta, phi + pi)) e^(i arrow(k) dot arrow(r))/r
$
如果两个粒子分别沿正负z轴方向入射,则
$
psi(arrow(r)) = e^(i arrow(k) dot arrow(r)) plus.minus e^(- i arrow(k) dot arrow(r)) + (f(theta) plus.minus f(pi - theta)) e^(i arrow(k) dot arrow(r))/r
$
注意这里没有因子$1/sqrt(2)$,因为我们仍旧只关心散射部分相对一个入射波的大小,同时两个粒子的散射都观测,有截面增大的效果。
#figure(
image("pic/2024-06-19-17-15-55.png", width: 80%),
numbering: none,
)
这时系统的微分散射截面为
$
sigma(theta) = abs(f(theta) plus.minus f(pi - theta))^2 = abs(f(theta))^2 + abs(f(pi - theta))^2 plus.minus 2 Re(f^*(theta) f(pi - theta))
$
其中最后一项为干涉项,是基于全同性原理的量子力学效应。
如果是非全同粒子,则在$θ$方向观测到两种粒子*任意一个*的总散射截面,应该是这样的非相干叠加:
$
sigma(theta) =abs(f(theta))^2 + abs(f(pi - theta))^2
$
#figure(
image("pic/2024-06-19-17-19-11.png", width: 80%),
numbering: none,
)
设电子空间散射不翻转自旋,两个自旋态为$ket(↑↑)$的电子的微分散射截面是
$
abs(f(theta) - f(pi - theta))^2
$
这是因为Feimi子是交换反对称的,但是自旋部分交换对称,所以空间部分是反对称的,因此散射截面也满足反对称性。两个自旋态为$ket(00)$的电子的微分散射截面是
$
abs(f(theta) + f(pi - theta))^2
$
这是因为$ket(00) = 1/sqrt(2) (ket(↑↓) - ket(↓↑))$,自旋部分交换反对称,所以空间部分是对称的,因此散射截面也满足对称性。两个自旋态为$ket(↑↓)$的电子的微分散射截面是
$
abs(f(theta))^2 + abs(f(pi - theta))^2
$
这是因为$ket(↑↓)$,没有交换对称性,不是全同粒子,所以散射截面是两个单独的散射截面之和。
- 如果粒子波函数里还包括自旋分量、偏振这些分立的指标,在做全同粒子波函数对称化或反对称化操作时,这些指标要随粒子坐标一起进行交换。
- 如果在一个物理过程中两个全同粒子有一个不相同的量子数(比如$S_z$),同时此量子数在过程中守恒,则原则上可以用这个量子数来区分这两个粒子,它们不再是全同的。
- 在上述情况下,是否对此量子数做对称化或反对称化的操作,物理结果是相同的(即不存在全同粒子交换效应)
_例:两个处于下列叠加态的电子散射,求微分散射截面。_
$
psi = 1/sqrt(2) (ket(1","0) + ket(0","0))
$
_方法一:根据角动量守恒_,自旋$ket(1","0)$态散射后仍为$ket(1","0)$态,自旋$ket(0","0)$态散射后仍为$ket(0","0)$态,所以散射截面可以分别计算后相加
- $ket(1","0)$态自旋对称,所以空间部分反对称,这部分微分散射截面为
$
1/2 abs(f(theta) - f(pi - theta))^2
$
- $ket(0","0)$态自旋对称,所以空间部分对称,这部分微分散射截面为
$
1/2 abs(f(theta) + f(pi - theta))^2
$
于是总微分散射截面为
$
sigma(theta) = 1/2 abs(f(theta) - f(pi - theta))^2 + 1/2 abs(f(theta) + f(pi - theta))^2 = abs(f(theta))^2 + abs(f(pi - theta))^2
$
_方法二:从耦合表象换为非耦合表象_
$
psi = 1/sqrt(2) (ket(1","0) + ket(0","0)) = ket(arrow.t arrow.b)
$
也就是说两个电子处于不同的自旋本征态上,是非全同粒子,在$θ$方向上观察到任意电子的总截面应是两个分截面的非相干叠加:
$
sigma(theta) = abs(f(theta))^2 + abs(f(pi - theta))^2
$
#newpara()
_例:求两个总自旋为1的全同粒子散射的非极化微分散射截面_
极化的意思:一个粒子的总自旋量子数$>0$,则在其任意自旋态下,总能在空间中找到一个方向,该粒子在此方向上自旋投影的平均值为最大值且非$0$。此量子态是一个*纯态*。
非极化的意思:非极化是这样一种量子态,粒子自旋在空间任意方向投影的平均值为$0$。如果粒子总自旋非$0$,那么在纯态量子空间是找不到这种态的,而只能在*混合态*中找。比如给定一组全同粒子,一半自旋向上,一半自旋向下。这种几率混合不同于量子力学中的几率振幅的叠加,而就是一种纯粹*统计上*的纯量子态的混合,混合结果是该组粒子平均自旋为$0$。
两个粒子的总自旋$S$为$0、1、2$(单位为$hbar$),分别是一、三、五重态。根据CG系数的公式:
$
ket(j m j_1 j_2) = sum_(m_1+m_2=m) C(j m ";"j_1 j_2 m_1 m_2) ket(j_1 m_1) ket(j_2 m_2), (j_1 = j_2 =1)\
C(j m";"j_1 j_2 m_1 m_2) = braket(j_1 m_1 j_2 m_2, j m) = (-1)^(j_1 - j_2 + j) braket(j_2 m_2 j_1 m_1, j m)
$
即交换两个粒子后,自旋部分波函数的符号变为
$
(-1)^(j_1 - j_2 + j) = (-1)^(2 - j)
$
对$S=1$三重态来说此符号为负,其它态为正。
所以三重态自旋波函数反对称,所以空间部分也应该反对称(玻色子总体对称),相应的微分散射截面为
$
abs(f(theta) - f(pi - theta))^2
$
$S=0$和$S=2$的自旋态自旋波函数对称,所以空间部分也应该对称,相应的微分散射截面为
$
abs(f(theta) + f(pi - theta))^2
$
因为总自旋非极化,所以是混合态,粒子在这$9$个纯态上的统计概率都是$1/9$,所以最后的总微分截面为
$
sigma(theta) &= 3/9 abs(f(theta) - f(pi - theta))^2 + 6/9 abs(f(theta) + f(pi - theta))^2 \
&= abs(f(theta))^2 + abs(f(pi - theta))^2 + 2/3 Re(f^*(theta) f(pi - theta))
$
#newpara()
_例:两个电子散射,求非极化的微分散射截面_
#figure(
image("pic/2024-06-19-23-57-24.png", width: 80%),
numbering: none,
)
= 含时微扰
== 量子态跃迁
无微扰时系统从初态$ket(phi_i)$经时间$t$后跃迁到末态$ket(phi_f)$的*概率幅*为
$
A_(f i) = braket(phi_f, e^(- i/hbar hat(H) t), phi_i) = e^(- i/hbar E_i t)braket(phi_f, phi_i) = e^(- i/hbar E_i t) delta_(f i)
$
如果定义$ket(phi_i)$,$ket(phi_f)$所处表象的算符(如自旋)与$hat(H)$不对易,那么就会出现量子态跃迁的情况(参见自旋例题)。
如果系统有微扰(通常与原$hat(H)$不对易),那么微扰项将会产生跃
$
hat(H) = hat(H)_0 + hat(H)'
$
其中$hat(H)_0$为原哈密顿算符(如自由粒子),$hat(H)'$为微扰算符。Shrödinger方程为
$
i hbar partial/(partial t) ket(psi(t)) = (hat(H)_0 + hat(H)') ket(psi)
$
$ket(psi(t))$通常很难解析求出,所以用微扰近似,用无微扰时的波函数来展开波函数的修正项。
非微扰哈密顿算符定态本征值及本征函数为
$
hat(H)_0 ket(phi_n) = E_n ket(phi_n)
$
加上微扰后的薛定鄂方程
$
i hbar partial/(partial t) ket(psi(t)) = (hat(H)_0 + V(arrow(x), t)) ket(psi(t)) , V =H'
$
根据$hat(H)_0$的本征函数的完备性,方程任一解可以展开为:
$
psi = sum_n a_n (t) phi_n e^(- i/hbar E_n t)
$
代入薛定鄂方程得:
$
i hbar sum dd(a_n)/dd(t) phi_n e^(- i/hbar E_n t) = sum_n a_n (E_n + V) phi_n e^(- i/hbar E_n t)
$
两边乘以末态波函数$phi_f^*$并对空间积分得:
$
i hbar dd(a_f)/dd(t) = sum_n a_n (t) integral dd(""^3 x) phi_f^* V phi_n e^(- i/hbar (E_n - E_f) t)
$
这并非求得了$a_f$的解,因为方程右方求和中仍有$a_f$项。
假设$t=-T/2$的初始时刻系统处于初始态$phi_i$:
$
cases(
a_i (-T/2) = 1,
a_n (-T/2) = 0 "for" n != i
)
$
$V$很小时,可用上面这套$a$的初始值代入右边作为*一级近似*得:
$
dd(a_f)/dd(t) = - i/hbar integral dd(""^3 x) phi_f^* V phi_i e^(- i/hbar (E_i - E_f) t)
$
于是在时间间隔$T$内$i→f$的*跃迁振幅*(记为$i T_(f i)$)为:
$
i T_(f i) = a_f (T/2) = 1/(i hbar) integral_(-T/2)^(T/2) dd(t) e^(- i/hbar (E_i - E_f) t)integral dd(""^3 x) phi_f^* V phi_i
$
== 有限时常微扰
设$V$只在[−T/2, T/2]时间内起作用,且在产生作用的此时间窗口内不随时间变化(有限时常微扰),则有
$
V_(f i) = integral dd(""^3 x) phi_f^* V phi_i, i T_(f i) = V_(f i) /(i hbar) integral_(-T/2)^(T/2) dd(t) e^(- i/hbar (E_i - E_f) t)\
i T_(f i) = - 2 pi i (sin ((Delta E_(f i) T)/(2 hbar)))/(pi Delta E_(f i)) V_(f i)\
$
$T$足够大时
$
i T_(f i) = - 2 pi i delta(E_f - E_i) V_(f i)
$
跃迁速率(单位时间内从$i$跃迁到$f$的几率):
$
W_(f i) = abs(T_(f i))^2/T = 4 abs(V_(f i))^2/T abs((sin ((Delta E_(f i) T)/(2 hbar)))/(Delta E_(f i)))^2
$
如果$T$足够大,可以利用渐进公式
$
lim_(t -> oo) (sin^2 (x t))/x^2 = pi t delta(x)
$
我们有
$
W_(f i) = abs(T_(f i))^2/T = 4 abs(V_(f i))^2/T pi (T/(2)) delta(E_f - E_i) = (2 pi)/hbar abs(V_(f i))^2 delta(E_f - E_i)
$
实际上公式中的$E_f$还应包括所有可能的简并末态,所以
$
W_(f i) = sum_k (2 pi)/hbar abs(V_(f i))^2 delta(E_(f k) - E_k)
$
其中$k$表征能量为$E_f$的所有简并末态。如果$E_f$为连续谱,则应对$E_f$求积分
$
W_(f i) = integral (2 pi)/hbar abs(V_(f i))^2 delta(E_f - E_i) rho(E_f) dd(E_f)
$
其中$ρ(E_f)$为在$E_f→E_f+dd(E_f)$ 能量区间内的末态态密度(简并态密度,即单位能量间隔内的简并度),最后跃迁速率可表示为
$
W_(f i) = (2 pi)/hbar abs(V_(f i))^2 rho(E_i)
$
这就是*费米黄金定则*:跃迁速率——单位时间内从初态$ket(phi_i)$跃迁到末态$ket(phi_f)$的几率。
费米黄金定则的物理意义:
- $V_n$:跃迁矩阵元(matrix element),由微扰势能函数决定
- $rho(E)$:末态态密度,或末态相空间(phase space)
系统反应(或衰变)速率由*矩阵元和相空间*共同决定
_例:求箱归一化条件下的自由系统态密度$ρ$_
系统波函数:
$
psi = L^(-3/2) e^(i/hbar arrow(p) dot arrow(r))
$
动量本征值:
$
p_(x y z) = (2 pi n_(x y z) hbar)/L
$
$
rho(E) dd(E) = (4 pi p^2 dd(p))/((2 pi hbar)/L)^3 = (L/(2 pi hbar))^3 4 pi m sqrt(2 m E) dd(E)
$
如果只限于立体角$Omega(theta , phi)$附近,则
$
rho(E, Omega) dd(E) dd(Omega) = (L/(2 pi hbar))^3 m sqrt(2 m E) dd(E) dd(Omega)
$
有限时常微扰的实例——散射问题的处理。
== 散射问题的含时微扰处理
想象粒子沿$z$轴入射(波矢$arrow(k)$),在原点处被固定势能散射,粒子态跃迁到$arrow(k)'$态,粒子能量不变(弹性散射)。
可用波包代表粒子,固定势也有作用范围(如半径$a$),在波包和固定势场没有重合时,粒子处于自由运动状态,在两者重合时散射势$hat(H)'$产生作用,散射后势能又不起作用,这正是在$[-T/2, T/2]$时间内的常微扰问题,下面用*有限时常微扰方法*分析。注意:在波包尺度$→∞$时,相当于微扰时间$T→∞$,结果将和定态微扰一致。
初态入射粒子平面波(箱归一化):
$
phi_i =L^(-3/2) e^(i/hbar arrow(p) dot arrow(r)) = L^(-3/2) e^(i arrow(k) dot arrow(r))
$
末态散射粒子平面波(箱归一化):
$
phi_f = L^(-3/2) e^(i/hbar arrow(p)_f dot arrow(r)) = L^(-3/2) e^(i arrow(k)_f dot arrow(r))
$
于是:
$
V_(f i) &= integral phi^*_f V(arrow(r)) phi_i dd(""^3 x)\
&= L^(-3) integral e^(- i arrow(k)_f dot arrow(r)) V(arrow(r)) e^(i arrow(k) dot arrow(r)) dd(""^3 x)\
&= L^(-3) integral e^(- i arrow(q) dot arrow(r)) V(arrow(r)) dd(""^3 x)
$
其中
$
arrow(q) = arrow(k)_f - arrow(k)
$
跃迁速率:
$
W_(f i)=integral (2 pi)/hbar abs(V_(f i))^2 rho(E_i, Omega) dd(Omega)
$
末态态密度:
$
rho(E, Omega) = (L/(2 pi hbar))^3 m sqrt(2 m E)
$
代入跃迁速率公式中得:
$
W = (L^3 m)/(4 pi^2 hbar^4) integral abs(V_(f i))^2 sqrt(2 m E_i) dd(Omega)
$
于是在立体角$Omega(theta, phi)$附近的微分越迁速率$dd(W) = W(θ, φ) dd(Omega)$为
$
W(θ, φ) dd(Omega) = (L^3 m)/(4 pi^2 hbar^4) abs(V_(f i))^2 p dd(Omega) = j_s r^2 dd(Omega)
$
于是
$
W(θ, φ) = (L^3 m)/(4 pi^2 hbar^4) abs(V_(f i))^2 p
$
入射粒子概率流密度为:
$
j_("in") = rho v = (1/L^3) (p/m)
$
最后,微分散射截面为:
$
sigma(θ, φ) &= W(θ, φ)/j_("in") = ((L^6 M^2)/(4 pi^2 hbar^4)) abs(V_(f i))^2\
&= (L^6 M^2)/(4 pi^2 hbar^4) abs(L^(-3) integral e^(- i arrow(q) dot arrow(r)) V(arrow(r)) dd(""^3 x))^2\
&= m^2/(4 pi^2 hbar^4) abs(integral e^(- i arrow(q) dot arrow(r)) V(arrow(r)) dd(""^3 x))^2
$
这和按定态微扰处理的波恩近似结果一致,且$L$被消掉了。
== 有限时周期微扰
有限时周期微扰,即微扰的加入是在一个有限的时间段内,但是在这段时间内又是呈周期性变化(如交变电磁场),这时微扰引起的跃迁通常会伴随着系统与外界的能量、质量等交换,因为这时系统是非孤立系统。
显然,这时问题的处理只能用含时微扰的方法,而不能用定态微扰法,一般来说,我们引入的微扰具有下面的形式
$
hat(H) = hat(H)_0 + hat(H)'(t), hat(H)'(t) = hat(F) sin (omega t)
$
即$H'$有简谐微扰的形式,简谐震动角频率为$ω$,一般简谐振幅$F$与时间无关。
跃迁振幅公式为(注意时间积分改为从0开始了)
$
i T_(m k) = a_m (t) = 1/(i hbar) integral_0^t dd(t) e^(i/hbar (E_m - E_k) t) integral dd(""^3 x) phi_m^* hat(H)'(t) phi_k
$
矩阵元$H'_(m k)$也有类似时间依赖关系:
$
H'_(m k) (t) = F_(m k) sin (omega t), F_(m k) = integral phi_m^* hat(F) phi_k dd(tau)
$
$
a_(k->m) &= F_(m k) 1/(i hbar) integral_0^t sin(omega t') e^(i omega_(m k) t') dd(t')\
&= F_(m k) -1/(2 hbar) integral_0^t (e^(i omega t') - e^(- i omega t')) e^(i omega_(m k) t') dd(t')\
&= - F_(m k) 1/(2 i hbar)( (e^(i(omega+omega_(m k))t)-1)/(omega + omega_(m k)) + (e^(-i(omega-omega_(m k))t)-1)/(omega - omega_(m k)))
$
其中
$
omega_(m k) = (E_m - E_k)/hbar
$
跃迁几率成为
$
P_(k->m) (t) &= abs(F_(m k))^2/(4 hbar^2) abs( (e^(i(omega+omega_(m k))t)-1)/(omega + omega_(m k)) + (e^(-i(omega-omega_(m k))t)-1)/(omega - omega_(m k)))^2\
&= abs(F_(m k))^2/(2 hbar^2)((1 - cos((omega + omega_(m k))t))/(omega + omega_(m k))^2 + (1 - cos((omega - omega_(m k))t))/(omega - omega_(m k))^2 + (2 cos (omega t) (cos(omega t) - cos(omega_(m k) t)))/(omega^2 - omega_(m k)^2))
$
只考虑时间间隔$t$足够长的情形,利用渐近公式
$
lim_(t -> oo) (1 - cos(x t))/x^2 = pi t delta(x)
$
$
P_(k->m) (t) -> abs(F_(m k))^2/(2 hbar^2)pi t (delta(omega + omega_(m k)) + delta(omega - omega_(m k)))
$
简谐扰动引起的跃迁的若干重要特征:
- 跃迁几率包含两个$δ$函数,只在
$
omega_(m k) = ± omega
$
时跃迁几率才显著地不为0,而其它的跃迁几率都可以忽略不计。这种情况称为共振跃迁:
$
E_m - E_k = ± hbar omega
$
在$E_m=E_k+hbar ω$时称为共振吸收,在$E_m=E_k-hbar ω$时称为共振发射。
原子或分子对光的共振吸收形成它的特征暗线光谱,而共振发射形成特征明线光谱。“核磁共振”也是共振跃迁的重要例子。
- 在发生共振跃迁的时候,跃迁几率与时间成正比,所以它的跃迁速率是常数:
$
W_(k->m) = (P_(k->m) (t))/t = abs(F_(m k))^2/(2 hbar^2)pi (delta(omega + omega_(m k)) + delta(omega - omega_(m k)))
$
严格来讲,等式右边的$δ$函数只在$t→∞$才成立,但只要$t$足够大,$δ$函数就已经是很好的近似了。$t$足够大的判据是$t ≫ 1/omega_min$,其中$omega_min$是系统最小的$omega_(m k)$。$1/omega_min$被称为系统的*特征时间*。
- 利用F的厄密性可以证明
$
abs(F_(m k)) = abs(F_(k m))
$
于是
$
W_(k->m) = W_(m->k)
$
这称为*细致平衡原理*,在统计力学里有重要的应用。
== 跃迁选择定则
在跃迁几率的表达式中包含有矩阵元
$
H'_(m k) (t) = integral phi_m^* hat(F) phi_k dd(tau)
$
对于某些$hat(H)'(t), psi_m,psi_n$,矩阵元$H'_(m k)$可能为0,这时跃迁几率也为0,这就是*选择定则*。
在$hat(H)'_(m k) != 0$的时跃迁是允许的,在$hat(H)'_(m k) = 0$的时跃迁是禁止的。
选择定则的存在通常是由于某些守恒定律,如动量守恒、能量守恒、角动量守恒、电荷守恒、宇称守恒等等。
== 原子发射和吸收光子
真空中传播的电磁波的能量密度为
$
E = 1/2 (epsilon_0 E^2 + B^2/mu_0)
$
其中电场能与磁场能各占一半,即平均来说
$
epsilon_0 macron(E^2) = 1/mu_0 macron(B^2) => macron(B)/macron(E) = sqrt(mu_0/epsilon_0) = c
$
结合洛仑兹力和库仑力公式
$
arrow(F) = q (arrow(E) + arrow(v) crossproduct arrow(B))
$
粒子所受这两种力的比值为
$
(v macron(B))/macron(E) = v/c << 1
$
所以说对低速带电粒子来说,其所感受到的电磁波中的洛仑兹力远小于库伦力,洛仑兹力可以忽略不计。
在目前的理论框架下,我们仍然把光看作是经典的电磁波,也就是波动的电磁场,由于电场远比磁场的作用显著,所以微扰近似为:
$
arrow(E)(arrow(r), t) = arrow(E)_0 sin (omega t - arrow(k) dot arrow(r))
$
如果光的波长≫一个原子的尺度,可以认为在一个原子的尺度内电场是*空间均匀*地随时间而振荡的,这样的话
$
arrow(E) = arrow(E)_0 sin (omega t)
$
这种近似称为*长波近似*,它引起的跃迁称为*电偶极跃迁*。
$
hat(H)' (arrow(r), t) = e arrow(r) dot arrow(E)(arrow(r), t) = hat(F) sin (omega t), hat(F) = e arrow(r) dot arrow(E)_0
$
相应的跃迁矩阵元是
$
F_(m k) = e integral phi_m^* arrow(r) dot arrow(E)_0 phi_k dd(""^3 x)
$
其中的波函数是
$
psi_(n l m) = R_(n l) (r) Y_(l m) (theta, phi)
$
随着$arrow(E)_0$方向的不同,$arrow(r) dot arrow(E)_0$有不同的表达式,但可能的分量有三个:$E_0 x, E_0 y, E_0 z$,所现在先假设电场沿$x$方向,看系统吸收光子,那么
$
W_(k->m) = (pi e^2 E_0^2)/(2 hbar^2) abs(x_(m k))^2 delta(omega - omega_(m k))
$
电磁波的平均能量密度为
$
I = 1/2 expval(epsilon_0 E^2 + B^2/mu_0)
$
其中左右尖括号表示在一个时间周期内求平均,再利用
$
expval(B^2/mu_0) = expval(epsilon_0 E^2) = epsilon_0 E_0^2 omega/(2 pi) integral_0^(2 pi/omega) sin^2 (omega t) dd(t) = 1/2 epsilon_0 E_0^2
$
所以
$
I = 1/2 epsilon_0 E_0^2
$
$
W_(k->m) = (pi e^2)/(epsilon_0 hbar^2) I abs(x_(m k))^2 delta(omega - omega_(m k)) = (4 pi^2 e_s^2)/hbar^2 I abs(x_(m k))^2 delta(omega - omega_(m k))
$
上面讨论的是入射光为单色偏振光的情形,一般来说,光能量密度随频率有一个分布,设角频率在$ω→ω+dd(ω)$之间的入射光(在单位角频率内的)能量密度为$I(ω)$,则此区间的能量为
$
I(omega) dd(omega)
$
于是
$
W_(k->m) = (4 pi^2 e_s^2)/hbar^2 abs(x_(m k))^2 integral I(omega) dd(omega) delta(omega - omega_(m k)) = (4 pi^2 e_s^2)/hbar^2 I(omega_(m k)) abs(x_(m k))^2
$
目前为止,我们一直假设入射光是沿$x$方向偏振的。实际上入射光波矢沿各个方向都有,偏振也是各个方向都有,均匀分布。因此,我们要把$y, z$方向的偏振贡献也加进来,然后除以$3$求平均
$
W_(k->m) = (4 pi^2 e_s^2)/(3 hbar^2) I(omega_(m k)) (abs(x_(m k))^2 + abs(y_(m k))^2 + abs(z_(m k))^2) = (4 pi^2 e_s^2)/(3 hbar^2) I(omega_(m k)) abs(arrow(r)_(m k))^2
$
公式中出现了电子电偶极矩$-e arrow(r)$的矩阵元,所以这种跃迁又称为*电偶极跃迁*。这个跃迁速率的表达式与费米黄金定则很相似,但两者存在根本不同。这里原子初末态能量不守恒,相差$hbar omega_(m k)$,而费米黄金定则适用于初末态能量守恒的过程。
系统能否发生跃迁由矩阵元$arrow(r)_(m k)$决定,其角度部分的积分牵涉到下列三角函数在球坐标系中的矩阵元
#figure(
image("pic/2024-06-20-11-28-18.png", width: 80%),
numbering: none,
)
再利用球谐函数的正交性,看出只有在
$
l' - l = plus.minus 1 , m' - m = 0, plus.minus 1
$
的时候,矩阵元才不为0,所以得到结论:电偶极跃迁的选择定则是
$
Delta l = plus.minus 1, Delta m = 0, plus.minus 1
$
从物理的角度来看,这是由于角动量守恒,因为光子的总自旋量子数是1。当然,在其它的过程中还会有类似的选择定则。
== 正常塞曼效应再探讨 —— 自旋的影响
#figure(
image("pic/2024-06-20-11-30-41.png", width: 80%),
numbering: none,
)
#figure(
image("pic/2024-06-20-11-30-58.png", width: 80%),
numbering: none,
)
#figure(
image("pic/2024-06-20-11-41-59.png", width: 80%),
numbering: none,
)
#figure(
image("pic/2024-06-20-11-46-43.png", width: 80%),
numbering: none,
)
== 自发辐射的爱因斯坦理论
在非相对论量子力学框架内无法解释原子的自发辐射问题,而只能近似处理受激辐射和吸收的问题。但爱因斯坦提出了一个半唯象理论把它们之间的关系找了出来。
设能级$E_k$小于能级$E_m$,定义三个系数:
- $B_(m k)$:受激发射系数
- $B_(k m)$:吸收系数
- $A_(m k)$:自发辐射系数
设在热平衡条件下,处于这两个能级的原子数分别为$N_k, N_m$,那么
$
N_k B_(k m) I(omega_(m k)) = N_m (A_(m k) + B_(m k) I(omega_(m k)))
$
即单位时间内从$k$跃迁至$m$(吸收)的原子数,和从$m$跃迁至$k$(自发或受激)的原子数相等。据此可解出
$
I(omega_(m k)) = A_(m k)/(N_k/N_m B_(k m) - B_(m k))
$
又根据麦克斯韦-波尔兹曼分布知
$
N_k = C e^(-E_k/(k T)), N_m = C e^(-E_m/(k T))
$
所以
$
N_k / N_m = e^((E_m - E_k)/(k T)) = e^((hbar omega_(m k))/(k T))
$
代入$I$的表达式得
$
I(omega_(m k)) = A_(m k)/(e^((hbar omega_(m k))/(k T)) B_(k m) - B_(m k))
$
或者说
$
I(nu_(m k)) = (2pi A_(m k))/(e^((hbar nu_(m k))/(k T)) B_(k m) - B_(m k))
$
又根据黑体辐射的公式
$
I(nu) = (8 pi h nu^3)/(c^3 (e^((h nu)/(k T)) - 1))
$
跟前面$I$的表达式对照得出:
$
A_(m k) = (4 h nu_(m k)^3)/(c^3) B_(k m) = (hbar omega_(m k)^3)/(pi^2 c^3) B_(k m)\
B_(m k) = B_(k m)
$
即受激辐射和吸收系数相等,而且得出了自发辐射系数与受激辐射系数之间的关系。由这些关系进一步得到
$
A_(m k) /(B_(m k) I(omega_(m k))) = e^((hbar omega_(m k))/(k T)) - 1
$
此即热平衡时自发辐射和受激辐射速率之比。若要二者相等,则在$T=300k$时需要
$
omega_(m k) = (k T)/hbar ln(2) = 2.74 times 10^13 s^(-1)
$
这个角频率对应的波长大约为$69$µm,远大于可见光波长,因此在可见光波段,原子的自发辐射占绝对主导地位。
前面已求出吸收跃迁速率
$
W_(k->m) = (4 pi^2 e_s^2)/(3 hbar^2) I(omega_(m k)) abs(arrow(r)_(m k))^2
$
这应等于单个原子吸收跃迁速率$B_(k m) I(omega_(m k))$,所以
$
B_(k m) = B_(m k) = (4 pi^2 e_s^2)/(3 hbar^2) abs(arrow(r)_(m k))^2
$
$A_(m k)$就代表单个原子*自发辐射跃迁速率*,处于$m$能级原子的平均寿命就可表示为
$
tau_(m k)= 1/A_(m k)
$
如果原子能从m态跃迁到一系列能量更低的k态,则总平均寿命为
$
tau_m = sum_k 1/A_(m k)
$
受激辐射产生的光单色性、相干性好(激光),相比之下自发辐射则是随机的、相干性差。 |
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/002_Return%20to%20Ravnica.typ | typst | #import "@local/mtgset:0.1.0": conf
#show: doc => conf("Return to Ravnica", doc)
#include "./002 - Return to Ravnica/001_The Shadows of Prahv, Part 1.typ"
#include "./002 - Return to Ravnica/002_The Shadows of Prahv, Part 2.typ"
#include "./002 - Return to Ravnica/003_Epic Experiment.typ"
#include "./002 - Return to Ravnica/004_In Praise of the Worldsoul, Part 1.typ"
#include "./002 - Return to Ravnica/005_In Praise of the Worldsoul, Part 2.typ"
#include "./002 - Return to Ravnica/006_In Praise of the Worldsoul, Part 3.typ"
#include "./002 - Return to Ravnica/007_Slaughter Games.typ"
#include "./002 - Return to Ravnica/008_The Great Concourse.typ"
#include "./002 - Return to Ravnica/009_The Azorius Ten Most Wanted.typ"
#include "./002 - Return to Ravnica/010_The Seven Bells, Part 1.typ"
#include "./002 - Return to Ravnica/011_The Seven Bells, Part 2.typ"
#include "./002 - Return to Ravnica/012_Rogue’s Passage.typ"
|
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/023%20-%20Oath%20of%20the%20Gatewatch/009_Zendikar%20Resurgent.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Zendikar Resurgent",
set_name: "Oath of the Gatewatch",
story_date: datetime(day: 24, month: 02, year: 2016),
author: "<NAME>, <NAME>, <NAME>, and <NAME>",
doc
)
#emph[The Eldrazi titans have been destroyed. The world of Zendikar has been saved. Now the four Planeswalkers who acted to make this so must decide what is to come next.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#figure(image("009_Zendikar Resurgent/01.jpg", width: 100%), caption: [Oath of Gideon | Art by Wesley Burt], supplement: none, numbering: none)
His throat was all nettles and brambles when he swallowed. He must have been snoring. On the comfort of a bedroll, cradled in the warmth of an oxhide blanket, Gideon let his eyelids slide open. It was still dark in the tent but he threw the blanket aside, and though the air was still, it bit at his skin with a crispness that portended the world beyond the tent. It was enough to raise goosebumps before Gideon could find his shirt and pull it on in the predawn dark. He splashed water on his face from a wooden bowl that rested on a chair next to the entrance, and then finished climbing into his clothes. A water skin hung from one of the tent's support beams. Gideon removed it and slung it over his shoulder before pushing one of the two heavy tent flaps aside.
As he stepped across the threshold, a glint from within the tent caught his attention. He cocked his head, and the outline of his breastplate took shape in the far corner beyond his bedroll. And it would remain there, along with his greaves, pauldrons, shield, and sural—at least for the moment. He didn't need it just then, and he was suddenly aware of the lightness he felt around his back and shoulders. It felt good.
So did the chill. A sharp breeze brought it from the east, driving off the remaining warmth he had found beneath his blanket. Above the wind, Gideon could hear the waterfall that sent its contents spilling down from floating masses of land at the other end of the encampment. Purple was beginning to bloom on the horizon, and Gideon breathed in deep to savor the morning air that was laced with the faintest hint of cook fires.
Then he was off at a run, the water skin bouncing lazily between his shoulder blades.
This was his ritual, if it could be called that after only three days—waking up before sunrise, unencumbered by weapons or armor and unburdened by the logistics of keeping an army together, Gideon would simply run. He could focus on his breathing. That each footfall followed the last was his only concern.
Gideon's path took him around the perimeter of what was left of the great Zendikari encampment. The site was a collection of floating islands surrounding an enormous derelict hedron that leaned to one side. They had all been lashed together by ropes and bridges.
#figure(image("009_Zendikar Resurgent/02.jpg", width: 100%), caption: [Island | Art by Adam Paquette], supplement: none, numbering: none)
It was here, at what had come to be known as Sky Rock, that the people of Zendikar had mustered in unprecedented numbers to stand together in defiance of the destruction that the Eldrazi had promised. Before the army marched on Sea Gate, the encampment had swelled so large that the gravity-defying stretch of land was not enough to accommodate everyone, and a secondary camp went up in the shadow below Sky Rock. But the numbers had since dwindled. Many hadn't escaped their end at Sea Gate, and now that the titans had been destroyed, more and more of the Zendikari host were trickling away each day.
Above him, clouds, turned orange by the dawn, stretched out across the dim sky. He followed their course with his eyes toward the horizon, where the sun threatened to breach the surface of the sea. Between him and the horizon, Gideon's gaze found the ruins of Sea Gate. Even in the low light of early morning, Gideon could see what had once been a wall of brilliant white stone, topped with a mighty lighthouse, now reduced to a crumbling stump of its former self—a rotted tooth in the mouth of the bay.
#figure(image("009_Zendikar Resurgent/03.jpg", width: 100%), caption: [Sea Gate Wreckage | Art by <NAME>], supplement: none, numbering: none)
Sea Gate. Halimar Basin. It all happened there. In his mind, Gideon juxtaposed the sequence of events, complete with the destruction of the Eldrazi, onto the landscape. This was how Jace must see the world all the time—a series of scenarios playing out in some logical course that he could see. Jace had proved his worth. He stayed when others would have left. He was the right person for the puzzle of leylines. And now, the two of them were oath brothers.
Gideon's mind turned to the Gatewatch. This group of four Planeswalkers who shared his vision. Along with Jace, Nissa, a stranger to him only days ago, was now committed to helping worlds beyond her own.
And then there was Chandra. In the end, she had come. Of course she had.
Gideon pounded across a rope bridge that spanned two colossal floating stone slabs, its wooden planks roiling violently with each heavy step. At the other side, he paused for a moment, unslinging his water skin and tilting it up to his lips to drink.
"Sluggish this morning?" came a voice from behind. The words were punctuated by boots on the wooden planks behind him, and Gideon whirled around to see the blur of a figure rush past, water sloshing from the leather pouch to soak his shirt.
Tazri. He smiled and raced after her. "Just giving you a chance to catch up, Commander-General," he said. This time it was his turn to pass her. He pumped his legs harder, breaking into a full sprint. Any moment now, he'd be able to throw some jest at her over his shoulder. Any moment now. But for all his effort, Tazri kept pace. And Gideon loved it.
The two soldiers ran together without speaking for a while, making their way around the encampment to the sound of their steady footfalls and even breathing.
Soon the camp was stirring. More cook fires blossomed, and the accompanying sounds of an army coming to life soon filled the air. "I'm going to address the volunteers today," Tazri said without breaking stride. Gideon turned to her, and then followed her gaze to where to where the next group of departures—a mixed company of kor and elves—was preparing for their journey to some far corner of the plane.
Ulamog and Kozilek were dead, but reports of their spawn have continued to come in. "How many do you think will stay?" Gideon asked.
Tazri let out a noise that was somewhere between a snort and a chuckle. "You know, I have this gnawing feeling that in a few days, you and me'll still be running around this place all by ourselves."
"Maybe you should be working on your speech, then." Gideon let her see that he was smiling, but she was somewhere else. She was in the command tent, arguing with her generals over maps. She was wrangling supplies. She was in the field, leading from the front. And she was articulating speeches. The burden of command. It was now hers—Commander-General Tazri. And Gideon couldn't think of a better choice.
"And what about you, Gideon?" Tazri said. "Can I count on you to help sweep away the remaining Eldrazi?
When the two of them had been reunited after his escape from the demon's cave, Gideon had noticed a change in Tazri. It wasn't something he could define, at least not at the time. But now, he saw it as a cool calm. The maelstrom that came with leadership would roil around her, but she would remain unbowed by it. She was resolved to weather it for as long as it was necessary. "I'm yours to command, Commander," Gideon said.
"Until..." Tazri's words trailed off.
"Until," he confirmed. Gideon wasn't from Zendikar. He'd come here to do what he could against the Eldrazi. But there would be other threats to other worlds, and he had pledged to the Gatewatch to intervene where others couldn't.
Their run resumed its silence.
"Well, until then," Tazri said a moment later, "I'm glad you're with us." It was her turn to smile, and suddenly she pulled ahead of Gideon, who couldn't keep up.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Two rough, callused hands reached out and came to rest around iron. The hands were mostly wiped clean of the dried blood of the battlefield, but red lines remained under the fingernails. The iron they touched was not the pommel of a sword or the curved face of a shield, but the cold metal belly of a stout stewpot. The hands felt the rough underside of the cauldron, touched the sturdy squat legs, glided over the heavy-handled lid and the ridiculously sized ladle hanging to one side, and found places on either side of the pot. There, resting gently against the metal, the hands imparted warmth. Steady heat flowed from the fingers and palms into black iron, and from the metal into the cold broth inside.
The broth slowly warmed, and eventually it bubbled, drumming the lid and allowing comforting aromas to escape. Smells of herbs and hearty tubers and sweet ripe alliums—they were a recipe of convenience, the ingredients amassed on a midmorning sortie by a few of Tazri's soldiers. It was prepared on-site, in the same place where titans had risen and titans had fallen—the field of battle that was now just a field.
#figure(image("009_Zendikar Resurgent/04.jpg", width: 100%), caption: [Oath of Chandra | Art by <NAME>], supplement: none, numbering: none)
Chandra released her hands from the sides of the pot and used her arms to shift in her not-terribly-comfortable makeshift seat. She took the excessively large ladle in one hand and opened the lid with the other. She had to stretch slightly to reach the top of the pot, and her goggles steamed as they just cleared the lip. She reached in and dipped generously into the goulash, to get at the good chunks that had settled, and raised up a brimming portion.
She served bowlfuls of breakfast from her seat until the line ran out. And when Tazri's scouts found more roots and herbs and filled the pot with more broth, she heated that, too, and she and others served seconds to everyone, and some had thirds.
Chandra's muscles were tired of sitting, and the object she had chosen to rest on wasn't doing a very good impression of furniture. But she didn't have much choice in the matter.
As soldiers lifted the cauldron away from where Chandra sat, Nissa appeared, bearing a stacked armful of blankets. Chandra smiled a crooked smile at her as Nissa dumped the blankets, layer after layer of coarse, fragrant wool, into Chandra's lap. Nissa's eyes were quiet and thoughtful, green touching green. Chandra liked the way her movements were gentle, her hands kind.
Chandra looked at the blanket pile. She closed her eyes and centered herself. She hugged the blankets suddenly, her face squashing into the wool. And as her body encircled them, as her palms (mostly wiped clean of blood) pressed against the rough weave, the blankets warmed.
It felt strange now, using this humble bit of pyromancy, but good. A good, simple spell of heat, conjured with an ordinary thread of mana—after having been the human conduit, for a brief moment, of an entire world's mana. Chandra felt stretched somehow, strained in some abstract muscle she couldn't flex, and this, by contrast felt...
Minimal. Unassuming. Right. Back to wisps of mana and straightforward heat spells. Back to normalcy, almost.
Faint traces of steam curled up from the wool. Chandra relinquished them, and Nissa gathered them up in her arms again. Chandra watched her new—ally? Teammate? No, #emph[friend] is what we call those people who help us survive. She watched Nissa walk among the convalescence of tents and makeshift beds, carrying the stacks of magically warmed blankets. Nissa draped them one by one over sore shoulders or across shuddering chests, as Zendikari healers and field-clerics made their rounds.
Jace didn't come to say hello. Chandra saw him standing next to a boulder-sized hedron, his cloak wrapped snug around him. He stood still, but he looked like he was strolling somehow, maybe wandering through the events of the last several days somewhere deep inside his own head.
Finally Gideon approached, stowing his sural at his waist. He wore minimal armor this morning, but she could see that he still scanned the pitted turf around them, checking the tents, watching the bindings of Sky Rock—always vigilant, she thought, in war or in recovery. He stopped next to where she sat, at her shoulder. "Did a sweep with Tazri. There are still stragglers out there, but most of them are put down. We think it's done."
Chandra knocked him on the bicep. "Nice work, Lord-Commander-Knight-General."
He hitched his thumbs into the straps on his chestplate. "It's just Gideon, again. Is that thing at all comfortable?"
Chandra pushed with her arms to shift on her makeshift chair. She shrugged. "I asked to sit on it."
He nodded absently. "You going back to Regatha?"
"I meant what I said before. Had my hand up and everything."
"I know. But you can still return, if you have commitments there."
Chandra chuckled. "Are you giving me permission?"
"What I mean is, we're done here, for now. You've done your part. We can reconvene when we're needed again."
Chandra jabbed an elbow into his ribs. "I'm in this, Gideon. I'm part of the Gatewatch now."
He pointedly didn't look down at her. "How're the legs?"
"Enh," she grunted. Chandra's hands went involuntarily to her knees. She could feel the sensation in her legs, but just barely, like she only had partial ownership of them. She tapped her feet on the ground to prove they could wiggle. "Feeling's returning. Healers said it was something about the spell, the big one—I used reserves I shouldn't've. Said I'd be fine in a couple of days. But I'm thinking hours. #emph[Try] to stop me dancing."
Gideon's eyebrows twitched unevenly for an instant, a gesture he couldn't entirely hide. The man wore concern like an undergarment, hidden under layers of strength and steel.
"If you hadn't come..." he started. He shook his head.
"Well, if you hadn't asked," Chandra said. And she punched him in the arm.
Gideon just stood straight, trying to find something on the horizon to look at.
"Hey," Chandra said. "We helped people. And we'll do it again."
"You stick to those minor spells for a while," he said, squeezing her shoulder. "Don't strain yourself. I'm off to..." He looked around. "I'll do another sweep." He walked off.
Chandra used her hands to pull on her thighs and cross her own legs. She leaned back against the "chair," which looked a lot like fire-charred bone but, up close, didn't really feel like bone. She wondered what part of Ulamog's skull this had been—maybe it was from the back, where the titan's spinal musculature had exploded into shards of nothingness. She hoped it was from the front, between its jaw-structures, the faceplate that had turned toward her as it was consumed in fire. She leaned back against it and put her rough, callused hands behind her head.
#figure(image("009_Zendikar Resurgent/05.jpg", width: 100%), caption: [Oath of Jace | Art by <NAME>], supplement: none, numbering: none)
Jace stood next to an enormous fallen hedron, apart from the throng of busy Zendikari. From this vantage point he could see where Nissa's glyph of leylines had burned itself into the valley floor, shining with a green and wholesome light. He wondered if it would fade with time.
He watched as Gideon approached Chandra, who was still confined to her ridiculous battlefield throne, still unable to walk after channeling the mana of an entire world into one huge blast of fire. Jace wondered if that would fade with time, too. He'd been assured that it would.
She'd been hunched over, focusing intently on the delicate pyromancy of heat without fire. As soon as she saw Gideon, she grinned, her shoulders loosened, and those ever-fidgeting hands of hers fell still. By the time they were done speaking, she was sitting a little bit taller. Gideon's history with Chandra was nearly identical to Jace's, from what he'd been able to glean. Like Jace, Gideon had been sent after her to retrieve a stolen scroll. Now she greeted Gideon warmly, but still looked at Jace with suspicion.
Maybe there was magic in what Gideon did, but Jace didn't think so. He'd watched the Commander-General move among his troops after the battle—saying a few quick words, putting a firm hand on shoulders, kneeling silently at gravesides and listening to remembrances of the deceased. Everywhere he went, relief and hope took root. #emph[Leadership.] Jace wondered if it would work on him the way it did on the others.
Jace ought to be able to replicate the effect with telepathy, to work out from people's thoughts the right thing to say or do to give them solace and comfort. To make people trust him. But Gideon #emph[wasn't] a telepath, and everyone knew that. Gideon just knew what to say. Maybe that was why it worked. Maybe Jace should leave charisma to the charismatic and focus on arming Gideon with the best possible information to make those honest, forthright decisions of his. Jace felt a pang of guilt, already making plans to win Gideon over in some imaginary future argument to bring the others around. But then, that's what Jace was always doing. Making plans.
That was what bothered him about the present situation. No plan. Two Eldrazi titans were dead—truly dead, it seemed, according to Jace's calculations, Nissa's intuition, and the sheer volume of Eldrazi viscera splattered over the basin. That left one titan on the loose—perhaps still lurking on Zendikar, but more likely not. Ugin's missing allies, <NAME>ov and Nahiri the Lithomancer, still hadn't shown up, and Ugin himself had yet to make an appearance at the scene of the titans' fall.
Jace's new friends seemed content to help the Zendikari as they reunited with their families, cleaned up the prodigious mess, and hunted down the enthralled vampires and Eldrazi worshipers and what few of the brood had survived the conflagration. All laudable, to be sure. But these were tasks that the locals could undertake themselves. Ugin's allies, the third titan's whereabouts, other looming problems like the Chain Veil...these were threats that could only be handled by Planeswalkers. By the Gatewatch. That was the point, wasn't it?
A cry from the sentries broke his reverie, a pattern of trilling hoots that indicated a flying enemy. Jace scanned the horizon for a panicked moment—there, barely visible against the clear blue sky, was a luminous winged shape, flapping slowly.
Ugin.
"Don't engage!" shouted Jace, leaping to his feet. "That's a friendly!"
#emph[I hope he's feeling friendly, anyway.] There was, in fact, no guarantee of Ugin's current mood, but Jace certainly wasn't going to allow his side to start hostilities.
Others took up Jace's cry. Crossbows were lowered and nascent fireballs allowed to dissipate as Ugin swooped in low over the valley...heading right for Jace.
Gideon, Chandra, and Nissa understood. Gideon arrived at a dead run, Nissa seemed to melt out of the underbrush, and Chandra unsteadily pulled herself to her feet, nearly collapsed, and hobbled over using a long length of charred bone as a cane. All three of them were standing with him by the time Ugin's forty-foot-long body slammed into the jagged ground in front of Jace, his claws tossing up shards of distorted stone.
#figure(image("009_Zendikar Resurgent/06.jpg", width: 100%), caption: [Ugin, the Spirit Dragon | Art by Raymond Swanland], supplement: none, numbering: none)
"#emph[What have you done?] " bellowed the spirit dragon. A blast of heat washed over Jace, Ugin's internal fires stoked by anger.
Despite Jace's protestations, Zendikari soldiers clustered around Ugin. They bristled at his furious tone, pikes and swords out. Ugin didn't seem to notice them, which was probably an accurate estimation of their ability to harm him.
"We saved Zendikar," said Nissa.
"What have #emph[you] done?" asked Chandra. "Lately, I mean?"
Jace stepped forward.
"Ugin, the plan was mine. The others are guilty only of trusting me. If you take exception to what we've done, you can take it up with me and me alone."
"Like hell he can," said Gideon.
"We all killed the titans," said Nissa. "We'll all stand responsible for that."
"Actually, I killed the titans," said Chandra conspiratorially. "But they helped."
"Beleren," said Ugin. "Explain."
"I operated on the information I had," he said, trying to keep the waver out of his voice. Wise and ancient and intelligent Ugin might be, but he was still a dragon, with a dragon's size and temperament. And teeth. "We made a concerted effort to trap Ulamog, as you and I had agreed, but we were disrupted by a rogue Planeswalker following some ancient vendetta. I think we can all be forgiven for not foreseeing that."
Nissa's hands tightened on her staff. Ob Nixilis had escaped, and Jace knew it weighed on her. Count that among their extraplanar obligations, then.
"Granted," said Ugin. "Go on."
"The other surprise was that Kozilek was still on Zendikar," said Jace. "A fact you either didn't know or didn't relay. Respectfully, I don't find either scenario especially comforting."
"With the hedron network in its tattered condition, my ability to track the titans was curtailed," said Ugin.
"So the third one could be anywhere?" said Gideon.
"I can handle this, Gideon," said Jace.
"Your little escapade rang this plane like a bell," said Ugin. "I was able to take a thorough survey using the...echoes. Emrakul is gone, and has been for some time."
Jace was unsure whether to be relieved or horrified.
"Regardless, Kozilek caught us off guard," he said. "We had two titans to deal with, no time to prepare, and no idea how long they would remain on Zendikar. You yourself said they must not be allowed to leave."
"You had no reason to believe they would do so immediately," said Ugin. "You should have tried to trap them again."
"On the contrary," said Jace. "I had reason to believe Zendikar's defenders might act rashly and drive them off, despite my efforts to convince them not to. In the end, one of our allies tried to do exactly that. We didn't have time to construct a new hedron trap. But we have among our number an animist, capable of shaping Zendikar's leylines directly, without the use of hedrons. Given that—"
"Yes, yes," said Ugin. "It all follows. You could hold them using the glyph, but without the hedrons to bleed off energy and hold the leylines in place, your only options were to let the titans go or pull them fully into physical space and destroy them."
Jace blinked.
"You said that wasn't possible."
"I said it wasn't possible for #emph[you] ," said Ugin. "And you led me to believe you weren't going to try, so spare me your sanctimony."
"Wait," said Nissa. "You knew the titans could be killed? Did you know that when you trapped them here?"
Ugin rose up on two legs, towering above them like a schoolmaster.
"You've killed two living creatures that were older than worlds," said Ugin. "Without knowing their purpose, their role, the impact of their lives or their deaths—you risked this entire plane and unknown consequences beyond it to kill them. Because you could."
In the silence that followed, only Chandra spoke: "You're damned right we did."
Ugin dropped back to all fours with what sounded like a sigh.
"There is no force in all the Multiverse more dangerous or capricious than Planeswalkers," he said, shaking his horned head.
"What will happen now?" said Jace.
"Unknown," said Ugin. "As far as I'm aware, no one has ever killed an Eldrazi titan before. I have theories about what the Eldrazi are, and what might happen now that two of them are dead. The consequences may not accrue until long after all of you are dead, so you may count this as a victory if you wish. I, for my part, will study their remains, and prepare for the future."
Jace's friends made noises of disgust.
"Let me work with you," said Jace. "Tell me your theories about the Eldrazi. Together—"
"You, <NAME>," said Ugin, "have proven to be an extremely arrogant and unreliable partner. If you still insist on helping me, you may best do so by leaving. Immediately."
"What about your old allies?" said Jace, incredulous. "What about Bolas?"
"I won't stop you from investigating these matters," said Ugin. "Though I urge you to bear in mind that <NAME> and <NAME> will be far less forgiving of your interference."
Ugin waved one hand, a gesture that took in the Zendikari surrounding him and the valley filled with what was left of the titans.
"Tell your people not to interfere with my work. If I want a piece of one of the carcasses, I shall have it. If I want something left where it is, it stays."
Chandra shifted to stand between Ugin and the portion of Ulamog's skull she'd been using as a chair.
"You'll have to take that up with them," said Gideon.
"I doubt you want me to do that," said Ugin, snorting a puff of searing heat. "Goodbye, titan-slayers. May we meet again under more harmonious circumstances—or not at all. Either would suit me."
With that, the enormous dragon vaulted skyward, circling out above the newly emptied Halimar Basin.
"That went well," said Chandra.
Jace buried his face in his hands.
Gideon gestured, and Chandra, Nissa, and the other Zendikari slowly turned and wandered back to what they'd been doing. Then he sat down on a rock next to where Jace had been standing.
Jace looked down at Gideon, then sat next to him.
"It sounds like our troubles aren't over," said Gideon. Sitting down, he was only a little taller than Jace.
"They're not," said Jace.
He'd briefed Gideon about the dragon Planeswalker <NAME>, who'd apparently engineered the Eldrazi's release. About <NAME> and Nahiri the Lithomancer, who had helped trap the Eldrazi long ago and who Ugin seemed to think were both still alive somewhere.
"I know we're not done here," said Jace. "But—"
"Those oaths we took," said Gideon. "They weren't all alike, because we're not all alike."
That fact hadn't escaped Jace. It was a way for one oath to bind four very different people—until "justice and peace" and "the sake of the Multiverse" didn't line up. But they could deal with that when it came.
"I need to stay here until I know that the people here are safe," Gideon went on. "I imagine Nissa will stay until she's certain life will continue. Chandra...well, I don't presume to speak for her." He chuckled.
"But ultimately we need to know about the next threat," he said. "Not just clean up after the last one."
"Yes!" said Jace. "You understand the value of gathering intelligence."
"Absolutely," said Gideon. "What do you think should be our first priority?"
"Bolas is terrifying," said Jace, shaking his head. "I'd rather not come face to face with him until I know a lot more about what's going on. And we have no way to track this third titan or guess where she might go. That leaves Ugin's allies, Sorin and Nahiri. I'll go to Innistrad and find Sorin. I'm not sure he'll be more help than Ugin has been, but he can't be much less."
Gideon nodded slowly.
"I trust your judgment," he said, looking Jace in the eye. "When can you be ready to leave?"
"Today," said Jace. "I need to gather supplies and get some intelligence on Sorin, and then I'm ready."
"Good," said Gideon. "We'll be here."
He stood up, without the slap on the shoulder that he usually administered after giving people orders, and walked away.
#emph[Giving people orders...] Jace didn't feel ordered around. Had he just—
#emph[I'll be damned] , thought Jace.It worked on him, too.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
#figure(image("009_Zendikar Resurgent/07.jpg", width: 100%), caption: [Oath of Nissa | Art by Wesley Burt], supplement: none, numbering: none)
The darkness made it harder for Nissa to come up with a suitably viable distraction. She had managed to postpone acknowledging the weight in her pocket for as long as the sun had hung in the sky. Between delivering heated blankets to the Zendikari, joining Gideon on one of his many sweeps of the perimeter, and washing the crude dishes in the nearby falls—and then there had been the welcome, if unsettling, interruption provided by the spirit dragon. She hadn't had to stop moving since waking. But now the night had claimed the consciousness of most of the people at Sky Rock, the natural flow of activity had ceased, and the constant comforting stream of low murmurs had been replaced by silence. It was not the silence of nights on Zendikar that Nissa remembered from her youth. In that time, a night was only silent in comparison to a day. While the noises of the elves at her camp would cease for the most part at night, it only seemed to be with the purpose of making way for the sounds of the creatures that were just beginning to wake. But on this world, the Zendikar of the time after the titans, there were not creatures just beginning to wake. Instead there were mounds of chalky corruption. There were not trees with branches for the wind to whistle through; instead there were negative spaces, holes lined with repeating, unnatural patterns etched in an oily sheen. On this Zendikar, the silence of night was far more complete. And it was that silence that rang in Nissa's ears as she finally stopped moving.
It was the first time she had been to the glyph since the moment it had been seared into the ground. The others had visited it. She had seen Jace studying it, had watched Gideon walk along it, tracing the curvature of the lines with his steps, lost in thought. Many of the Zendikari had come by as well, leaving small tokens along its edges, taking off their shoes before stepping into the softly glowing grass. And the soul of Zendikar was there too. Nissa could feel it. It had been there, waiting for her all day. She only had to reach out. But she did not. Not yet.
Instead, careful not to tread on the glyph's lines, she made her way to the centermost point. Standing on the triangle of clear ground, she rolled up her sleeves. A tension drained from her shoulders as she knelt to the land, surrounded on all sides by the warm, green gleam. It was time. Nissa began to dig.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
When she had finished, there were four holes. One for each of the seeds that the vampire had given her what felt like years ago. Nissa had plotted the holes with care, measuring and planning for the size of each plant. The Jaddi tree would need the most space to grow. Its canopy would one day stretch across the width of the whole glyph or farther. It would provide welcome shade to weary travelers in its youth, and one day its expansive tangle of branches might become the home of a tribe of elves. Or, Nissa amended, perhaps a tribe of Zendikari—elves, kor, goblins, and humans together. They could live in the Jaddi and eat the fruit of the kolya grove, for there would surely be a grove. The kolya seed would feed on the power of mana here in the glyph—it would be the first to break ground. The tree's slender trunk would grow toward the sun and its flowers would quickly turn to tender, tangy fruit that would nourish the people of Zendikar. And the perilous beauty of the red mangrove would keep the ecosystem, and the people, in check. Then there was the bloodbriar. Nissa's breath caught on a raw spot deep inside. The bloodbriar of Bala Ged. A plant from her own home. Perhaps the very last of its kind. How many others had she taken for granted in her youth? Now it all came down to this one. This one would be charged with protecting all the other life that would subsist here with its nettled vines, the same way others of its kind had offered protection to the Joraga for ages.
Nissa could see this new forest taking shape even now as she held the pouch of seeds in her hand. One day it would be all of the things she dreamed for it to be. One day it would be vast and reaching. One day it would be lush and filled with power. One day it would be protected by tenacious thorns. But who would protect it until that day? Who would shepherd Zendikar from what it was now to what it would one day be?
"For what it's worth, I know it's going to be hard for you to leave." Chandra's voice startled Nissa; she had been so lost in thought that she hadn't heard Chandra approach. That was a strange thing. Nissa was not usually caught unawares. Stranger still was the way Chandra's words had reached the deepest layer of Nissa's consciousness, touching the feeling that was present but unwilling to wholly manifest. Chandra was the pyromancer, not a telepath.
Nissa looked up, meeting Chandra's eyes. They were wide, amber pools of sincerity, and in that moment Nissa felt they could see straight into her soul. She was unused to others being able to grasp her perception of things, let alone understand how she was feeling. Chandra had done both in a matter of moments. Perhaps that's why Nissa responded so honestly. "I don't know if I can leave." The words out of her mouth, Nissa held her breath.
But Chandra didn't say anything right away. Instead she lowered herself to the ground at Nissa's side. They sat there amidst the holes Nissa had dug but not yet filled, encircled by the glowing lines of the glyph, the lines that were only there because of what Chandra had done. If it hadn't been for the powerful pyromancer, Nissa reflected, not only would the glyph not be there, but the land in which the glyph was etched would have been completely obliterated. Chandra had stepped in at the moment that Nissa had felt the world coming apart. Chandra had reached out to Nissa and they had connected in a way Nissa had never connected to another being, not even to the soul of Zendikar. Together the two had combined their powers into something that was enough to destroy the Eldrazi titans. Just barely. Both had been terribly weak after it had ended, Chandra unable to walk and Nissa, for a time, unable to see or to stop her limbs from trembling. But now they were here, they were healing. And so was Zendikar. Only it would take much longer for the world than it had taken for Nissa and Chandra. Perhaps Chandra would understand that. Nissa looked to the pyromancer, who still had not uttered a word. "It's extremely fragile right now," Nissa began, an attempt to explain. "It came so close to fracturing. There's still so much that could go wrong, so many dangers. Whatever happens next will shape it, will help to make it whatever it will become."
"I bet it will be amazing." Chandra smiled and laid back on the cushion of soft growth, hands behind her head.
"I don't want to miss it," Nissa said, surprised at herself for admitting this aloud. "I want to be here when it happens."
"I can understand that," Chandra said.
"And," Nissa added because she felt she had to, "I don't just want to watch. I want to keep guard. Someone should be around. To protect it. To help it along. I can do that. I should do that."
They sat in silence, Nissa running her fingers along the folds of the pouch of seeds. She thought of the day she had first held them, of the weight she had felt, so much more than four little seeds. Of the responsibility. And of the fear that she would fail. But she had not failed them. At least, she hadn't failed them yet. There was still more to do. Wasn't there? Nissa broke the silence that had settled between her and Chandra. "If I stay here on Zendikar—"
"You have to do what you have to do," Chandra said. "I won't hold it against you."
Nissa cleared her throat. "What about the others? Do you think they will understand?"
"Gideon and Jace?" Chandra said. "Sure they would. They'd never make you leave."
Nissa exhaled—that was good. She had been worried. They had each taken an oath.
"They didn't make me leave Regatha either," Chandra said. "But in the end, I chose to come here anyway."
Nissa looked to Chandra. She couldn't imagine what would have happed if Chandra hadn't been here on Zendikar; she didn't want to imagine it. "I'm glad you came. Thank you."
"I almost didn't. I had a lot of students back there, you know. I was head of the whole school. Abbot."
Nissa raised her eyebrows, impressed.
"I know it sounds crazy to put me in charge."
"It doesn't sound crazy," Nissa said. "I've known since the first time I met you that you have a natural connection to great amounts of power."
Chandra smiled. "And that's exactly why I left." She leaned up on her elbows. "I could have stayed and taught those students to be talented pyromancers. I'd have done a good job, too. At least they'd all know how to make a really amazing self-sustaining fiery vortex."
Nissa laughed, and then she realized that laughing was something she hadn't done in a while. She enjoyed the way Chandra's nature could so easily make her smile and laugh.
"But <NAME> and the others are going to teach them well too," Chandra said. "They'll all become pyromancers, maybe not with quite as much skill at vortexing as I would have imparted, but they'll be all right. There was something else I had to do, something that Mother Luti and the others couldn't do. Something that no one else could do. And that was to come here. I think that's what Gideon was getting at when he said all that stuff about us having sparks and power and what that means. You know?"
Nissa knew exactly what Chandra was talking about: the speech Gideon had made when they had come out of Ob Nixilis's cave and seen the world on the brink of destruction. Gideon's words came back to Nissa: #emph["We need to be committed...to standing together against all the forces that threaten the Multiverse. No one else can do it. This is the task that falls to us, because of our power. Because of our sparks."]
"No one else can do it," Chandra said, once again making it seem as though she could read Nissa's mind. "But you can. We can. Together. Besides," she added mischievously, "don't you want to see how long it takes before Jace can't take another clap on the shoulder from Gideon and just snaps?"
Nissa laughed again. She did want to see them, Gideon and Jace, not necessarily see Jace snap, but it would be—funny? Yes, funny, she decided. Things around Chandra, Jace, and Gideon would be interesting, most likely exhilarating, and sometimes funny. She realized that a separation from the other three Planeswalkers would be just as painful as a departure from Zendikar. That revelation surprised her. It had been a long time since Nissa had felt a deep connection with something other than the world's soul. But there was no denying that now she felt three more bonds. New, but strong. There were three more souls that were counting on her, and millions more that were counting on the four of them together.
"I'm going to go start heating things up for breakfast," Chandra said, getting up. Nissa hadn't realized that the sun had begun to rise while they had been sitting there in the glyph. "Do you want me to bring you anything?"
"No," Nissa breathed in the morning Zendikar air. She wanted to be there herself. "I'll come up and get some in a minute."
"All right," Chandra walked away. "See you there."
"Chandra," Nissa called. Chandra looked back. "Thank you."
Chandra smiled and shrugged. "Don't wait too long to get some grub, or Gideon will eat it all."
Nissa would not wait. She would not wait for the world to heal; it would heal and grow with or without her there to watch it. And there were others who would be there. She thought of Tazri, of Munda, of Seble, and of Kiora.
She unfolded the topmost layer of the silk pouch, revealing the four small seeds. One by one she planted them in the holes she had dug. As she did, she whispered to them of her dreams for the forest they would one day become. She told them of the world they had come from, what Zendikar had been like, and what it had been through. And then she told them of the pyromancer, the telepath, and the fearless leader who had come to save them, who had made this world a safe place for them to grow.
With a final breath, Nissa pressed her palm to the ground and reached into the land; there was one more thing to do. She brushed against the soul of Zendikar. She told it to take care of the seeds. But before it could respond, before it could pull her in, encircle her and hold her close, she lifted her hand, and with it her soul. "I will see you again," she said. "I promise." Then she stood up, moving away from the world she had known and toward the one that was waiting.
#figure(image("009_Zendikar Resurgent/08.jpg", width: 100%), caption: [Zendikar Resurgent | Art by <NAME>], supplement: none, numbering: none)
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
Halfway to the cook fire, Nissa was ambushed by a harried, impatient stream of consciousness. #emph[Nissa! I need to talk to you.] The telepath strode into view, chasing his train of his thought. #emph[You have to tell me everything you know about Sorin Markov.]
Nissa's heart lifted. Yes, she reflected, this was what she was supposed to be doing now, this felt right. She looked into Jace's eyes, smiling. #emph[I think it would be easier if I showed you instead. ] Without hesitation, Jace leapt into her mind.
|
|
https://github.com/SundaeSwap-finance/sundae-audits-public | https://raw.githubusercontent.com/SundaeSwap-finance/sundae-audits-public/main/butane-sale/butane-sale.typ | typst | #import "../template/audit.typ": *
#import "@preview/finite:0.3.0": automaton
#show: report.with(
client: "Butane",
title: "Pro-rata Sale",
repo: "https://github.com/SundaeSwap-finance/sundae-audits-public",
date: "2023-02-21",
authors: (
(
name: "<NAME>",
display: text(1.3em, $pi$) + " Lanningham",
),
),
)
= Audit Manifest
Please find below the list of pinned software dependencies and files that were covered by the audit.
#software_versions(
items: (
(
name: "Pro-rata Sale",
version: "0.0.0",
commit: "<PASSWORD>",
),
)
)
#files_audited(
items: (
(
file: "validators/sale.ak",
hash: "75780d0962a096b13176c9ac10664a94a6c38badfdb633a9f09be654685c6568",
),
(
file: "validators/nft.ak",
hash: "e50a6642c85499da9ccfa18204b4c63d9455a7edde86726746017eef98a4acbf",
),
(
file: "lib/launchpad/prorata.ak",
hash: "b141707194119480c4ab4df48acfc941534e6b52d6ba1718a57834ddef0fc37e",
),
(
file: "lib/launchpad/types.ak",
hash: "9c322668b8e8c034ede0ecaca95df242c5de66b9b0bef1046fc6bfd695c77496",
),
(
file: "lib/launchpad/utils.ak",
hash: "512c6c801f07d6b8ae5d200fc48326b45b36f1161f7e25b278401cc695e6b8ae",
),
)
)
#artifacts(
(
(
validator: "sale",
method: "deposit",
hash: "",
),
(
validator: "sale",
method: "collect",
hash: "",
),
(
validator: "sale",
method: "machine",
hash: "",
),
(
validator: "nft",
method: "nft",
hash: "",
)
)
)
#pagebreak()
#set par(
leading: 1em,
first-line-indent: 1em,
justify: true,
)
= Context
The Butane token is a new cardano native token with utility in the upcoming "Butane" synthetics protocol. The scripts under audit are a set of smart contracts that govern a so-called "pro-rata" sale of these tokens. The butane team intends to offer 43% of the total supply (10,750,000 Butane) to the public in this sale, at a rate of 0.9 ADA per Butane.
If less than 9,675,000 ADA is raised, the remaining tokens will be burned, reducing the total supply. If more than 9,675,000 ADA is raised, then each user will use the same percentage of their deposit to buy the token at that rate, and the remaining ADA will be returned to them.
For example, if 10,000,000 ADA is raised, then only 96.75% of the raised ADA can actually purchase tokens. Thus, a user who deposited 1,000 ADA would use 967.5 ADA to purchase 1075 Butane, and 32.5 ADA would be returned.
#v(1em)
#set par(first-line-indent: 0em)
This audit was performed by Sundae Labs, with the following understanding:
- There would be an "admin" user that should be acknowledged as a point of centralization, and should be treated as a largely trusted actor.
- That is, this actor should never have direct access to the user funds, but can be trusted to progress the protocol, and provide accurate off-chain global state.
- Performance of the contracts is not a factor.
- To limit scope and complexity, we are only auditing the Sale portion, not the Butane minting policy.
- The duration in which the sale should be active is limited, minimizing the window of time in which an attacker has to find a vulnerability.
- The contracts will remain closed source during the sale, minimizing the information available to an attacker during that vulnerable window.
#pagebreak()
= Specification
The butane prorata sale protocol is intended to facilitate the initial public sale of the Butane token.
The high level objectives of this sale are:
- A trusted admin begins the sale
- While the sale is active, users can deposit funds in a bid to purchase Butane tokens
- This deposit must be a minimum amount of ADA
- At the end of the sale, the admin can close the sale, preventing further deposits
- The admin can then calculate the total subscription of the sale, and lock in a "pro-rata" percentage
- Users, or the admin in large batches, can then claim their portion of the sold tokens, paying a fixed rate for those they mint, and receiving the remaining amount of ADA in return.
- When rounding, values should be rounded in favor of the protocol. That is, a user may receive up to 1 diminutive unit less of Butane than they paid for, resulting in a slightly smaller total supply of Butane.
- The admin can exercise discretion over the timing of the raise
- The admin should not be able to change the terms of the sale
- Users should be able to reclaim their ADA after an expiration if the sale doesn't terminate for some reason.
In particular, what we mean by pro-rata distribution is:
- Let the butane price be the quantity of butane per 1 ADA raised
- Let the total purchased butane amount be the total deposited ADA multiplied by the butane price
- If the total purchased butane amount is less than the amount allocated to the sale
- Let each deposit be spent if the deposited ADA is paid to the admin, and `deposit_amount * butane_price` is minted and paid to the depositer
- If the total purchased butane amount is greater than the amount allocated to the sale
- Let the pro-rata percentage be `sale_allocation / total_purchased_butane_amount`
- Let the pro-rata payment be `deposited_ada * pro_rata_percentage`
- Let the rebate amount be `deposited_ada - pro_rata_payment`
- Let each deposit be spent if `pro_rata_payment` ADA is paid to the admin, and `pro_rata_payment * butane_price` Butane plus `rebate_amount` ADA is paid to the depositer
#pagebreak()
The full protocol should adhere to the following state transition diagram:
#v(3em)
#scale(x: 150%, y: 150%, origin: top+left)[
#automaton(
(
Pending: (Live:("Begin Sale")),
Live: (Counting:("End Sale")),
Counting: (Closed:("Close Sale")),
Closed: (nil: ("Burn")),
nil: (),
),
layout: (
Pending: (0,0),
Live: (2.5,0),
Counting: (5, 0),
Closed: (7.5, 0),
nil: (7.5, -2)
),
style: (
Closed-nil: (
label: (
angle: 90deg,
)
),
Pending: (stroke: red),
Live: (stroke: blue),
Counting: (stroke: purple),
Closed: (stroke: green),
)
)
]
#v(8em)
Each depositing user should adhere to the following state transition diagram. The highlighted transitions are only valid when the sale is in the appropriately colored state above.
#v(3em)
#scale(x: 150%, y: 150%, origin: top+left)[
#automaton(
(
Abstain: (Deposit: ("Deposit")),
Deposit: (Claimed: ("Claim"), Reclaimed: ("Expired")),
Claimed: (),
Reclaimed: (),
),
final: ("Abstain", "Claimed", "Reclaimed"),
layout: (
Abstain: (0,0),
Deposit: (2.5, 0),
Claimed: (5, 0),
Reclaimed: (2.5, -2),
),
style: (
Abstain-Deposit: (stroke: blue),
Deposit-Claimed: (stroke: green),
)
)
]
#pagebreak()
== Detailed Specification
=== Definitions
#defn("Butane Token", "The native token of the butane protocol being sold as part of these contracts")
#defn("Public Sale", [
A specific offering of the #ref("Butane Token") available to all users through the decentralized protocol covered by this audit
])
#defn("Admin UTXO", [
A trusted UTXO, authenticated by a unique NFT, used as a reference input to describe the global state of the #ref("Public Sale")
])
#defn("Admin NFT", [
The NFT authenticating the #ref("Admin UTXO")
])
#defn("State Machine", [
A smart contract implementing a simple state machine through which the #ref("Admin UTXO") is advanced by the #ref("Admin").
])
#defn("Admin", [
A user trusted to advance the #ref("Admin UTXO") through the stages of the sale correctly.
])
#defn("Deposit", [
Either:
- The act of depositing ADA to participate in the sale
- A specific UTXO holding the ADA of a user participating in the sale
])
#defn("Counting Token", [
A temporary token minted to authenticate participation in the #ref("Public Sale").
])
#defn("Sale Allocation", [
The total amount of #ref("Butane Token") allocated to the #ref("Public Sale")
])
#defn("Sale Price", [
The price of the #ref("Butane Token") for the purposes of the #ref("Public Sale"), either in ADA per Butane or Butane per ADA, depending on context.
])
#defn("Target Raise", [
The total amount of ADA being sought as part of the #ref("Public Sale"). Calculated as the #ref("Sale Allocation") times the #ref("Sale Price") in ADA per Butane.
])
#defn("Subscription", [
The total amount of ADA deposited in the #ref("Public Sale")
Related:
- A #ref("Public Sale") is under-subscribed when the total amount of ADA raised is less than the #ref("Target Raise")
- A #ref("Public Sale") is over-subscribed when the total amount of ADA raised is greater than the #ref("Target Raise")
])
#defn("Pro-rata Percentage", [
The percentage of the #ref("Sale Allocation") that each user is entitled to, based on their deposit amount.
This is calculated as follows:
- If under-subscribed, it is 100%
- If over-subscribed, it is the #ref("Sale Allocation") divided by the #ref("Subscription").
])
#defn("Rebate", [Some amount of ADA returned returned to the user when the #ref("Public Sale") is over-subscribed.])
#defn("Target Recipient", [The cardano address that will receive ADA raised from the #ref("Public Sale")])
#defn("Recipient", [The address attached to a specific deposit which will receive the #ref("Butane Token") and possibly a #ref("Rebate").])
#pagebreak()
=== Transactions
There are 7 transaction archetypes in this protocol. We present each in detail below.
- Initialization
- A new #ref("Public Sale") is initialized by the #ref("Admin") creating the #ref("Admin UTXO")
- An NFT must be minted and paid into a UTXO with the correct `Pending` datum.
- This represents the initial `Start` transition in the state diagram above.
#v(5em)
#transaction(
"Initialization",
inputs: (
(
name: "Admin Wallet",
value: (
ada: "minUTXO",
)
),
),
outputs: (
(
name: "Admin UTXO",
address: "State Machine",
value: (
ada: "minUTXO",
NFT: 1,
),
datum: (
"Pending": ""
)
),
)
)
#pagebreak()
- Begin Sale
- The #ref("Admin") opens the sale to the public by spending the #ref("Admin UTXO") and updating the state to `Live`.
- Represents the transition from "Pending" to "Live" in the diagram above.
- Involves a commitment to sale details.
#v(5em)
#transaction(
"Begin Sale",
inputs: (
(
name: "Admin UTXO",
address: "State Machine",
value: (
ada: "minUTXO",
NFT: 1,
)
),
),
outputs: (
(
name: "Admin UTXO",
address: "State Machine",
value: (
ada: "minUTXO",
NFT: 1,
),
datum: (
"Live": (
total_expected_ada: [A#sub[e]],
price_n: [P#sub[n]],
price_d: [P#sub[d]],
mint_token_pol: "policy",
mint_token_tn: "token name",
expiry_time: [`K`],
)
)
),
)
)
#pagebreak()
- Deposit
- A user deposits ADA, securing their position in the #ref("Public Sale").
- An equal amount of #ref("Counting Token") is minted to verify that the deposit was made while the #ref("Public Sale") was still ongoing, rather than after the fact.
- The #ref("Public Sale") must be live, as proven through a reference input.
- The user must commit to the details of the sale.
- Represents the users transition from "Abstain" to "Deposit" in the diagram above.
#v(5em)
#transaction(
"Deposit",
inputs: (
(
name: "User Wallet",
value: (
ada: "X+Y",
)
),
(
name: "Admin UTXO",
address: "State Machine",
reference: true,
value: (
ada: "minUTXO",
NFT: 1,
),
datum: (
"Live": (
total_expected_ada: [A#sub[e]],
price_n: [P#sub[n]],
price_d: [P#sub[d]],
mint_token_pol: "policy",
mint_token_tn: "token name",
expiry_time: [`K`],
)
)
)
),
outputs: (
(
name: "Deposit UTXO",
address: "sale.collect",
value: (
ada: "X",
counting: "X",
),
datum: (
recipient: "User Address",
locked_lovelace: "X",
details_hash: [`H`],
expiry_time: [`K`],
)
),
(
name: "Change UTXO",
address: "User Address",
value: (
ada: "Y",
)
),
),
notes: [
`H` is the hash of the admin Datum launch details.
]
)
#pagebreak()
- End Sale
- End the #ref("Public Sale"), preventing further deposits
- Also allows time for the #ref("Admin") to calculate the #ref("Subscription") and #ref("Pro-rata Percentage") before closing the sale.
- Represents the transition from "Live" to "Counting" in the diagram above.
#v(5em)
#transaction(
"End Sale",
inputs: (
(
name: "<NAME>",
address: "State Machine",
value: (
ada: "minUTXO",
NFT: 1,
),
datum: (
"Live": (
total_expected_ada: [A#sub[e]],
price_n: [P#sub[n]],
price_d: [P#sub[d]],
mint_token_pol: "policy",
mint_token_tn: "token name",
expiry_time: [`K`],
)
)
),
),
outputs: (
(
name: "<NAME>",
address: "State Machine",
value: (
ada: "minUTXO",
NFT: 1,
),
datum: (
"Counting": ""
)
),
)
)
#pagebreak()
- Close Sale
- The #ref("Admin") closes the sale after calculating the #ref("Subscription") and #ref("Pro-rata Percentage").
- Locks in a price and a #ref("Subscription") amount, so that claims can begin claiming.
- Represents the transition from "Pending" to "Closed" in the diagram above.
#v(5em)
#transaction(
"Close Sale",
inputs: (
(
name: "<NAME>",
address: "Admin Address",
value: (
ada: "minUTXO",
NFT: 1,
),
datum: (
"Counting": ""
)
),
),
outputs: (
(
name: "<NAME>",
address: "Admin Address",
value: (
ada: "minUTXO",
NFT: 1,
),
datum: (
"Closed": (
"total_deposited_ada": [A#sub[d]],
)
)
),
)
)
#pagebreak()
- Claim
- Someone (either the user, or someone on their behalf) spends a deposit, burning the #ref("Counting Token"), paying the appropriate ADA to the #ref("Target Recipient"), and minting the appropriate amount of #ref("Butane Token"), paid along with any #ref("Rebate") to the #ref("Recipient").
- $P_n / P_d$ is the #ref("Sale Price") denominated in ADA per Butane
- $A_e$ refers to the #ref("Sale Allocation")
- $A_d$ refers to the #ref("Subscription")
#v(2em)
#transaction(
"Claim",
inputs: (
(
name: "Deposit UTXO",
address: "sale.collect",
value: (
ada: "X",
counting: "X",
),
datum: (
recipient: [`recipient1`],
locked_lovelace: "X",
details_hash: [`H`],
expiry_time: [`K`],
)
),
(
name: "Deposit UTXO",
value: (
ada: "Y",
counting: "Y",
),
datum: (
"...": ""
)
),
(
name: "...",
),
(
name: "Admin UTXO",
reference: true,
value: (
ada: "minUTXO",
NFT: 1,
),
datum: (
"Closed": (
"total_deposited_ada": [A#sub[d]],
)
)
),
),
outputs: (
(
name: "User Output",
address: [`recipient1`],
value: (
ada: "X - Pa",
butane: "Ba",
),
),
(
name: "User Output 2",
address: [`recipient2`],
value: (
ada: "Y - Pb",
butane: "Bb",
)
),
(
name: "Payment UTXO",
address: "Target Recipient",
value: (
ada: "Pa + Pb",
)
),
),
notes: [
#linebreak()
`H` must match hash of details in each deposits redeemer
$ P_i = cases(
X_i "if" A_d <= A_e,
floor(frac(X_i * A_e, A_d)) "if" A_d > A_e,
) $
$ B_i = floor(frac(P_i * P_d, P_n)) $
]
)
#pagebreak()
- Reclaim
- Someone reclaims their ADA after the expiration.
- Only used in disaster recovery, if the sale datum is burned too soon.
#v(2em)
#transaction(
"Reclaim",
inputs: (
(
name: "Deposit UTXO",
address: "sale.collect",
value: (
ada: "X",
counting: "X",
),
datum: (
recipient: [`recipient1`],
locked_lovelace: "X",
details_hash: [`H`],
expiry_time: [`K`],
)
),
(
name: "Deposit UTXO",
value: (
ada: "Y",
counting: "Y",
),
datum: (
"...": ""
)
),
(
name: "...",
),
),
outputs: (
(
name: "User Output",
address: [`recipient1`],
value: (
ada: "X",
),
),
(
name: "User Output 2",
address: [`recipient2`],
value: (
ada: "Y",
)
),
),
notes: [
#linebreak()
`K` must be before the transaction lower bound.
]
)
#pagebreak()
=== Core Invariants
We use the following labels for the terms defined above:
- $P_n / P_d$ is the #ref("Sale Price") denominated in ADA per Butane
- $A_e$ refers to the #ref("Sale Allocation")
- $A_d$ refers to the #ref("Subscription")
#set enum(numbering: "1.a)")
#v(1em)
The protocol is considered correctly executed if:
+ The #ref("Admin NFT") is minted and paid with a `Pending` datum to the state machine script.
+ The #ref("State Machine") is advanced to `Live` with sale details matching those published publicly.
+ The #ref("State Machine") is advanced by the #ref("Admin") according to a reasonable schedule.
+ At least 1 hour without rollbacks passes between advancing the #ref("State Machine") to `Counting`, and advancing it to `Closed`.
+ The #ref("Subscription") amount provided to the state machine represents the total supply of the #ref("Counting Token"), and thereby the total amount of ADA locked in the script.
#v(1em)
The following core invariants should hold:
+ The #ref("Admin") can be trusted to progress the protocol, and provide accurate off-chain global state.
+ A user can only mint an amount #ref("Counting Token") by paying the same amount of Lovelace into the `sale.collect` script
+ A user must lock at least 300 ADA to participate in the sale.
+ A user can only mint Butane by burning the full amount of #ref("Counting Token") on their UTXO
+ A user can only mint #ref("Counting Token") while the #ref("Admin UTXO") is `Live`
+ A user can only claim the results of the #ref("Public Sale") after the #ref("Admin UTXO") has progressed to the `Closed` state.
+ The #ref("Admin") cannot change the details of the sale after it is in the `Live` state.
+ The total minted butane minted must not exceed $A_e * P_d / P_n$
+ A user can only mint Butane by paying $P_n / P_d$ ADA per #ref("Butane Token") paid to the #ref("Target Recipient")
+ The #ref("Butane Token") minted from a deposit must be paid to the #ref("Deposit") #ref("Recipient")
+ If $A_d <= A_e$, a user must pay the full amount of `locked_lovelace` to the #ref("Target Recipient") and mint $floor(frac("locked_lovelace" * P_d, P_n))$ Butane to the #ref("Recipient")
+ We use `floor` because we cannot mint a fractional diminutive unit, and rounding down favors the protocol: the user may receive 1 diminutive unit less Butane than they paid for
+ This helps maintain Invariant 5
+ If $A_d > A_e$, a user must pay $"paid_lovelace" = floor(frac("locked_lovelace" * A_e, A_d))$ ADA to the #ref("Target Recipient") and mint $floor(frac("paid_lovelace" * P_d, P_n))$ Butane to the #ref("Recipient")
+ We take the floor when calculating the `paid_lovelace` to maintain Invariant 5. If we took the ceiling, `paid_lovelace` might be 1 lovelace more than the correct pro-rata amount, which could result in higher minted Butane than the #ref("Sale Allocation")
+ Similarly, we take the floor when calculating the minted Butane to maintain Invariant 5
+ Any difference between `locked_lovelace` and `paid_lovelace` must be returned to the #ref("Recipient") along with the minted Butane.
+ After some minimum time delay, if the #ref("Deposit") hasn't been claimed yet, a user can reclaim their `locked_lovelace` from the `sale.collect` script
#pagebreak()
= Findings Summary
#findings(prefix: "BTN", items: (
(
title: [No commitment to price or allocation by Admin],
severity: "Critical",
description: [
The protocol has an Admin role, that has the following two trust assumptions:
- They will progress the protocol through the state machine
- In the Close sale transaction, they will provide an accurate value for $A_d$, such that $A_d$ is the sum of all `locked_lovelace` in valid #ref("Deposit")s.
However, the admin has much more control and requires much more trust than this. In particular, there is no commitment to the total expected ADA, the sale price, or the butane token policy ID.
This makes the following attacks possible, which we deem outside of a reasonable trust assumption for such a sale:
- Users lock up ADA in expectation of receiving Butane at a price of 0.9 ADA per Butane, and instead the price is set to 1000 ADA per Butane.
- Users lock up ADA in expectation of collectively receiving 43% of the supply, and instead only 0.1% of the supply is distributed, with the rest retained by the team.
- Users lock up ADA in expectation of receiving Butane, but are given some other worthless token instead.
],
recommendation: [
Add `total_expected_ada`, `price_n`, `price_d`, `mint_token_pol` and `mint_token_tn` to the `Pending` and `Live` datums.
Lock the Admin UTXO in a script that allows the #ref("Admin") to adhere to the state changes, and enforces that these values remain the same during each state transition.
This way, users can confirm the details of the sale before making the decision about whether to participate.
],
resolution: (
commit: "53cb47dc77da6a9c053d2ab9c8baf416ea1e7409"
)
),
(
title: [Not commitment to sale schedule],
severity: "Major",
description: [
The protocol assumes that the admin will be responsible for eventually progressing the protocol, but does not assume they are trusted to progress the protocol in accordance with a schedule.
One design goal is to allow reasonable flexibility in the timing. This is to allow an *almost* subscribed sale to wait for it's full sale before closing, without prescribing a set time.
However, in the current protocol, the admin must be trusted to adhere to that reasonable schedule. For example, the admin could drag out the sale for months if the sale is under-subscribed, trying to eke out more and more ADA, while participants are locked in and have no way to cancel.
Similarly, the admin could close the sale at any time, limiting the participants and impacting the amount of Butane burned.
Finally, the admin could reopen the sale after some tokens have been claimed, allowing further deposits to raise more ADA.
],
recommendation: [
Simplify the sale state machine to just include `Sale` and `Closed` states.
Lock the #ref("Admin UTXO") in a script that allows the admin to progress the protocol.
Add a `start_time`, `minimum_length` and `maximum_length` fields to the `Sale` and `Closed` datums.
Use the `start_time` to prevent deposits before the sale starts, and `start_time + maximum_length` to automatically close the sale and prevent further deposits.
Then, only a single transition from `Sale` to `Closed` is needed from the admin to report the #ref("Subscription"). Enforce that this happens after `start_time + minimum_length` to ensure the sale stays open for a minimum length of time.
Add the ability to reclaim ADA if they wish after some delay. This way, if the protocol never progresses for some reason, at the very least the ADA isn't locked forever.
In this way, the #ref("Admin") has flexibility over the timing of the sale, but users also know ahead of time the reasonable bounds on the schedule of the protocol. The trust placed in the #ref("Admin") is minimized, as they are only trusted to progress the protocol and provide an accurate #ref("Subscription") amount.
],
resolution: (
comment: "Flexibility in the timing of the sale is a design goal, and combined with the state machine and expiration we implemented for other findings, we believe the timing issue is safely within trust assumptions we are comfortable with"
)
),
(
title: [Admin can change terms during partial claim or deadlock unclaimed funds],
severity: "Critical",
description: [
The admin is trusted to progress the protocol, and provide accurate information.
However, in the current implementation, because the #ref("Admin UTXO") is just held in a wallet, after the sale is closed, the admin can spend the UTXO before all participants have claimed.
First, this could be used to change the terms of the sale part way through claims. For example, the admin could immediately claim funds for any insiders immediately when the sale is closed, and then change the price or allocation for the remaining claimants.
Second, the admin could spend the UTXO to remove the datum completely. Because claiming depends on this UTXO as a reference input, this would permanently lock users ADA in the deposit.
],
recommendation: [
As with the other findings, lock the #ref("Admin UTXO") in a script. The script should enforce that after the sale is closed and the terms are provided, it is never spent again.
This ensures that no user funds become deadlocked, and the terms of the sale don't change after some users have claimed.
Alternatively, allow users to reclaim their ADA after some timeout, to ensure that even if the Admin behaves badly, at the very least they get their ADA back.
],
resolution: (
commit: "bcddbd7a2a590404db8e6abbf0599b20b9b608eb"
)
),
(
title: [Attach staking addresses to deposits],
severity: "Info",
description: [
Because the sale may span an epoch boundary, you should ensure the users stake address is attached to any deposits. This doesn't impact the correctness of the script, but ensures that users earn staking rewards for any ADA before the sale officially completes.
You likely intended to do this anyway, but it's worth highlighting explicitly.
],
resolution: (
comment: "We address this by enforcing the recipient stake address equals the deposit utxo stake address"
)
),
(
title: [Incomplete solutions to previous findings],
severity: "Major",
description: [
The solutions to #ref("BTN-000") and #ref("BTN-001") provide some protection, reducing the severity to only "Major", but are not sufficient in our view.
#ref("BTN-000") was resolved by adding sale details to the `Live` datum, storing the hash of the sale details in the deposit datum, and verifying the sale details provided through the redeemer match the hash.
#ref("BTN-001") was addressed by implementing a simple state machine that transitions from `Pending`, to `Live`, to `Closed`.
However, the implementation suffers from two issues:
- The state machine never no longer has a transition back to `Pending`, meaning deposits cannot be halted to count up the total subscription. A user may deposit in between the total being counted and the sale being closed, resulting in an excess of Butane being minted.
- The state machine can be burned, deleting the admin token. Any unclaimed ADA would be permanently locked at that point.
],
recommendation: [
- Add an intermediate state to allow for counting the total subscription in between the close of the sale and the opening of claims.
- Either disallow the evaporation of the state machine, or add an expiration, after which a user that was never calimed can reclaim their ADA, even if the admin UTXO has been burned.
],
resolution: (
commit: "c0f71e9952487cd491888bfb13ad2e78b11a89b0"
)
),
(
title: [Issues with minUTXO protections],
severity: "Info",
description: [
One stated goal was to allow the user to lock up an arbitrary amount of ADA, so long as the purchase amount in the datum is less than or equal to the amount in the datum.
This is to allow the user to include the minUTXO amount, so that the Butane team doesn't need to cover the minUTXO amount when forcing claims for users.
However, there are three issues.
First, the user is not actually allowed to lock up an arbitrary amount of ADA. When executing a deposit, the following condition is checked:
```
assert(
locked_value == (
value.from_lovelace(lovelace_sent)
|> value.add(own_pid, "", lovelace_sent)
),
@"Recipient value must be equal to the lovelace_sent field in the redeemer!",
),
```
This means that `locked_lovelace` from the datum must always match the amount of ADA in the deposit.
Second, when claiming, the exact amount of ADA is checked here:
```rust
// previously was validating that the input was the rebated value.
// Now, we check it correctly corresponds to datum.
(( lovelace |> dict.to_list ) == [("", locked_lovelace)])?,
```
If the lovelace on the UTXO differs from the amount in the datum, the sale will be un-claimable.
Finally, when checking the result, the amount sent back to the user is compared via:
```rust
lovelace_amt >= must_rebate,
```
If the user had included an extra amount in their deposit to cover minUTXO, and received a rebate, then whoever executed their claim would be able to take the surplus.
Coincidentally, these issues nullify eachother: because the user cannot lock up additional ADA, there is no concern about the additional ADA being taken, or the UTXO being unspendable.
],
recommendation: [
If you would like to preserve this property, we recommend switching the first check to comparing a greaterthan, like so:
```
assert(
and {
value.lovelace_of(locked_value) >= lovelace_sent,
value.without_lovelace(locked_value) == value.add(own_pid, "", lovelace_sent)
},
@"Recipient value must be equal to the lovelace_sent field in the redeemer!",
),
```
Then, update the second check to compare the #ref("Counting Token")s instead, like so:
```
(( other_dict |> dict.to_list ) == [("", locked_lovelace)])?,
```
This is equivalent to the intention, since the minting policy checks that #ref("Counting Token")s are minted equal to the amount in the datum, but avoids the surplus ADA issue.
Finally, we recommend checking that the amount sent to the user is exactly:
```
lovelace_amt == this_value.lovelace - must_send
```
Which ensures that the user receives the full amount of ADA they put in, minus the amount they paid in the sale.
Alternatively, you can simply acknowledge the risk that Butane may need to cover the minUTXO costs to fully realize the claim. The upper-bound for this cost would be if the full amount was subscribed exactly (meaning no rebates were available to cover the minUTXO), and the most users possible claimed at the minimum amount available.
That would be roughly 32,250 users, with a minUTXO requirement of around 1.2 ADA, or around 38,700 ADA in minUTXO costs. In any case, the minUTXO cost is capped at 0.4% of the total raise.
],
resolution: (
comment: "We will take the latter approach; If we raise 10,000,000 ADA, having to cover up to 38,700 ADA in minUTXO costs is an acceptable risk for us.",
)
),
(
title: [Funds could get deadlocked if the recipient is a script],
severity: "Minor",
description: [
If users construct their own transaction to participate in the sale, and direct the funds to a script address, they may become permanently locked.
First, the ADA could never be reclaimed, because the contracts explicitly expect VerificationKeyCredentials.
Second, we enforce that the output when minting the butane has NoDatum. A script address with NoDatum on the UTXO cannot be spent.
We don't expect users to build their own transactions given the short time window when this will be active, but if these scripts are reused, this could be more of a concern.
],
recommendation: [
One approach is to split the `Destination` and the `Owner` into two separate fields. The destination is an address and a datum, and the owner is a condition authorized to reclaim the ADA after some time.
A simpler approach is just to enforce that the `recipient` is a VerificationKeyCredential during the initial deposit.
],
resolution: (
commit: "580bba7c85603cd87f6b1e037d30915ca0cf543f"
)
)
))
|
|
https://github.com/VoigtSebastian/typst-CV | https://raw.githubusercontent.com/VoigtSebastian/typst-CV/main/template.typ | typst | MIT License | #let spacing = 25pt
#let huge = 30pt
#let text_size = 11pt
#let off_black = luma(20)
// Icons
// I do not recommend using these functions manually, as they are not meant to be.
// Use githubIcon, mailIcon or githubIconInline instead
// Both functions are easily customizized for different icons (e.g. twitter, linkedin, etc.)
// FIXME: scale, baseline and inset are very arbitrary - find a better way to do this
#let link_icon_left(path, address, name, scale: 10%) = box[
#link(address)[
#box(baseline: 25%, rect(fill: off_black, width: scale, inset: 2pt)[#image(path)])
#name
]
]
#let link_icon_right(path, address, name, scale: 10%) = box[
#link(address)[
#name
#box(baseline: 25%, rect(fill: off_black, width: scale, inset: 2pt)[#image(path)])
]
]
// Use the following functions to place a mail or github icon with some additional text, both of which are clickable links
#let githubIcon(address, name) = link_icon_right("icons/github.svg", address, name)
#let mailIcon(address, name) = link_icon_right("icons/mail.svg", address, name)
#let githubIconInline(address, name) = link_icon_left("icons/github.svg", address, name, scale : 7%)
// An entry in the CV - dates, type, location and description included
#let entry(from: "", to: "", type: "", location: "", body) = {
block(height: auto, width: 100%)[
#grid(
columns: (20%, 80%),
[
#if from != "" { from } else { " " }
#if to != "" { text()[ -- #to] }
],
[
#grid(
columns: (50%, 50%),
[#text(weight: "bold")[#type]],
[#text(weight: "bold")[#align(right)[#location]]]
)
#v(2pt)
#body
]
)
]
}
#let semibold(body) = text(weight: "semibold")[#body]
//
// project definition
//
#let project(
firstname: "",
lastname: "",
github: ("", ""),
mail: "",
body
) = {
set page(margin: spacing)
set text(font: "Fira Code", fill : off_black, size: text_size, lang: "EN", region: "US")
set list(marker: [>])
// Override default section/header format
show heading: txt => [
#set text(fill: white, size: text_size, weight: "bold")
#rect(fill: off_black)[#upper(txt.body)]
#v(2pt)
]
// Header left side - name in large letters
box(width: 40%, height: (huge * 2) + text_size)[
#rect(fill: off_black)[#text(white, size: huge, weight: "bold")[#upper(firstname)]]
#v(-10pt)
#rect(fill: off_black)[#text(white, size: huge, weight: "bold")[#upper(lastname)]]
]
// Header right side - github and mail links
box(width: 60%, height: (huge * 2) + text_size)[
#align(horizon + right)[
#block()[
#githubIcon(github.at(0), github.at(1))\
#mailIcon("mailto:" + mail, mail)
]
]
]
body
}
|
https://github.com/rxt1077/it610 | https://raw.githubusercontent.com/rxt1077/it610/master/markup/exercises/getting-started.typ | typst | #import "/templates/exercise.typ": exercise, code, admonition
#show: doc => exercise(
course-name: "Systems Administration",
exercise-name: "Getting Started",
doc,
)
== Goals
+ Install git
+ Install Docker
+ git pull the class git repository
+ Build a custom Docker image
+ Run a container
== Installing git
You have a few options for installing git, one of which is #link("https://desktop.github.com/download/")[GitHub Desktop] which includes a few cools tools for GitHub as well.
If you want to install git without the GitHub tools you can also use:
=== Windows
- #link("https://gitforwindows.org/")[git for windows]: Installs git, git BASH, and a GUI.
The git command can then be run from PowerShell, CMD, or the BASH shell (which it installs).
=== MacOS
- #link("https://sourceforge.net/projects/git-osx-installer/files/")[git for Mac Installer]: Provides an easy installer for git on MacOS.
- #link("https://developer.apple.com/xcode/")[Xcode]: Xcode installs a command line git and you may have it installed already.
== Installing Docker
Follow #link("https://docs.docker.com/desktop/")[these instructions] to install Docker Desktop.
== Cloning the Class git Repository
#admonition([
Everything shown after the `$` prompt is the text you need to run in a terminal.
Lines that do not start with a `$` are the output of the commands.
Yours should match what is show but your prompt will probably be different.
A prompt will _usually_ show you what directory you are in.
])
#admonition([
In MacOS, you can use the Terminal application, in Windows you can use PowerShell or Windows Terminal to execute these commands.
])
#code([
```console
$ git clone https://github.com/rxt1077/it610.git <1>
Cloning into 'IS601'...
remote: Enumerating objects: 43, done.
remote: Counting objects: 100% (43/43), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 43 (delta 4), reused 43 (delta 4), pack-reused 0
Unpacking objects: 100% (43/43), done.
```
], callouts: (
("<1>", [
Make sure you are in a directory where you have write permissions.
In Windows you can typ `cd ~` to change to your home directory.
In MacOS you should start in your home directory, but you can run `cd` just to be sure.
`cd` with no directory defaults to home in MacOS / Linux.]),
)
)
== Building a Custom Docker Image
#code([
```console
$ cd it610/exercises/getting-started <1>
it610/exercises/1 $ docker build -t getting-started . <2>
Sending build context to Docker daemon 5.632kB <3>
Step 1/2 : FROM ubuntu:20.04
20.04: Pulling from library/ubuntu
d51af753c3d3: Pull complete
fc878cd0a91c: Pull complete
6154df8ff988: Pull complete
fee5db0ff82f: Pull complete
Digest: sha256:8bce67040cd0ae39e0beb55bcb976a824d9966d2ac8d2e4bf6119b45505cee64
Status: Downloaded newer image for ubuntu:20.04
---> 1d622ef86b13
Step 2/2 : RUN echo "bXkgb3RoZXIgY2FyIHJ1bnMgTGludXg=" | base64 -d > /message.txt
---> Running in 4528d351968b
Removing intermediate container 4528d351968b
---> a09d3012fc11
Successfully built a09d3012fc11
Successfully tagged getting-started:latest
```
], callouts: (
("<1>", [Make sure you are in the `it610/exercises/1` directory]),
("<2>", [This tells Docker to build an image based on the Dockerfile in _this_ (`.`) directory and tag it as getting-started]),
("<3>", [It may take a moment to pull down the images this image is built from.]),
)
)
== Running a Container
Now that we've built an image, we're create and run a container and then get a BASH shell on it.
That can all be done with a single command:
#code([
```console
$ docker run -it getting-started bash <1>
```
], callouts: (
("<1>", [The `-it` option means that you want to run this container interactively and communicate with it via a tty.]),
)
)
You are now _in_ a BASH shell running _inside_ a container of the custom image for this exercise.
From this shell, use your systems administration skills (feel free to Google) to read the contents of `/message.txt` and submit that phrase in the textbox for this assignment.
When you are done in the container type `exit` to exit the shell and stop the container.
|
|
https://github.com/maxgraw/bachelor | https://raw.githubusercontent.com/maxgraw/bachelor/main/apps/document/src/0-base/6-abbreviations.typ | typst | #set heading(numbering: none, supplement: [Abschnitt])
= Abkürzungsverzeichnis
/ DOM: Document Object Model
/ HTML: Hypertext Markup Language
/ VR: Virtual Reality
/ AR: Augmented Reality
/ UEQ: User Experience Questionnaire
/ npm: Node Package Manager
/ SDK: Software Development Kit
/ UEQ: User Experience Questionnaire |
|
https://github.com/mismorgano/UG-OrdinaryDifferentialEquations-Project-24 | https://raw.githubusercontent.com/mismorgano/UG-OrdinaryDifferentialEquations-Project-24/main/Dynamical-Systems.typ | typst |
#let author = ("<NAME>")
#let title = [
Sistemas dinámicos,
una introducción
]
#import "conf.typ": conf, definition
#show: doc => conf(title, author, doc)
// #set page(margin: 1.75in)
// #set par(leading: 0.55em, first-line-indent: 1.8em, justify: true)
#set text(font: "New Computer Modern", lang: "es", size: 12pt)
#show raw: set text(font: "New Computer Modern Mono")
// #show par: set block(spacing: 0.55em)
// #show heading: set block(above: 1.4em, below: 1em)
#let sd = [sistemas dinámicos]
#let ssd = [sistema dinámico discreto]
// let title = [Sistemas dinámicos, una introducción]
La dinámica es un proceso evolutivo en el tiempo.
= Un poco de historia
El comportamiento explicito de un sistema y su dependencia en condiciones iniciales inicio después de 1880.
Es bien sabido que soluciones analíticas a ecuaciones no lineales no existen a excepción de muy pocas formas especiales.
Incluso cuando se tiene la solución analítica es difícil de analizar su comportamiento asintótico.
Es por ello que se sintió la necesidad de determinar características cualitativas en en lugar del análisis cuantitativo.
= Pero, ¿Que son?
#definition[
Un *sistema dinámico* es un semigrupo $G$ con identidad $e$ que actúa sobre un
conjunto $M$. Es decir, existe un mapeo
$ T: G times M &-> M \
(g, x) &|-> T_g(x) $
tal que $ T_g circle.small T_h = T_(g circle.small h), quad T_e = I. $
Si $G$ es un grupo, diremos que es un *sistema dinámico invertible*.
]
Nos interesan los *#sd continuos* donde $G = RR^+$ o $G = RR$ y los *sistemas
dinámicos discretos* donde $G = NN_0$ o $G = ZZ$.
Puntos a considerar
+ Un breve introducción a los sistemas dinámicos
+ Tipos de sistemas:
/ continuos: y su relación a las Edos, mencionar unos cuantos
/ discretos: que es sobre lo que me voy a centrar en el presente trabajo
+ Sistemas dinámicos discretos
/ Definición:
/ ejemplos:
/ resultados:
== Sistemas dinámicos discretos
#bibliography("references.yml", full: true) |
|
https://github.com/a-mhamdi/graduation-report | https://raw.githubusercontent.com/a-mhamdi/graduation-report/main/Typst/en-Report/common/metadata.typ | typst | MIT License | // Enter your project data here:
#let title = "Project Title"
#let titre = "Titre"
#let diploma = "License"
#let program = "Electrical Engineering"
#let supervisor = "Mr(s). ***"
#let author = "Author"
#let date = datetime.today().display()
#let chap1 = "Project Context"
#let chap2 = "Design Overview"
#let chap3 = "Implementation"
#let dedication = lorem(16)
#let ack = lorem(32)
#let resume = lorem(128)
#let abstract = lorem(128)
#let motscles = "rapport, pfe, typst"
#let keywords = "report, capstone, typst"
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/math/matrix.typ | typst | Apache License 2.0 | // Test matrices.
---
// Test semicolon syntax.
#set align(center)
$mat() dot
mat(;) dot
mat(1, 2) dot
mat(1, 2;) \
mat(1; 2) dot
mat(1, 2; 3, 4) dot
mat(1 + &2, 1/2; &3, 4)$
---
// Test sparse matrix.
$ mat(
1, 2, ..., 10;
2, 2, ..., 10;
dots.v, dots.v, dots.down, dots.v;
10, 10, ..., 10;
) $
---
// Test baseline alignment.
$ mat(
a, b^2;
sum_(x \ y) x, a^(1/2);
zeta, alpha;
) $
---
// Test alternative delimiter with set rule.
#set math.mat(delim: "[")
$ mat(1, 2; 3, 4) $
$ a + mat(delim: #none, 1, 2; 3, 4) + b $
---
// Test alternative math delimiter directly in call.
#set align(center)
#grid(
columns: 3,
gutter: 10pt,
$ mat(1, 2, delim: "[") $,
$ mat(1, 2; delim: "[") $,
$ mat(delim: "[", 1, 2) $,
$ mat(1; 2; delim: "[") $,
$ mat(1; delim: "[", 2) $,
$ mat(delim: "[", 1; 2) $,
$ mat(1, 2; delim: "[", 3, 4) $,
$ mat(delim: "[", 1, 2; 3, 4) $,
$ mat(1, 2; 3, 4; delim: "[") $,
)
---
// Error: 13-14 expected array, found content
$ mat(1, 2; 3, 4, delim: "[") $,
---
$ mat(B, A B) $
$ mat(B, A B, dots) $
$ mat(B, A B, dots;) $
$ mat(#1, #(foo: "bar")) $
---
// Test matrix line drawing (augmentation).
#grid(
columns: 2,
gutter: 10pt,
$ mat(10, 2, 3, 4; 5, 6, 7, 8; augment: #3) $,
$ mat(10, 2, 3, 4; 5, 6, 7, 8; augment: #(-1)) $,
$ mat(100, 2, 3; 4, 5, 6; 7, 8, 9; augment: #(hline: 2)) $,
$ mat(100, 2, 3; 4, 5, 6; 7, 8, 9; augment: #(hline: -1)) $,
$ mat(100, 2, 3; 4, 5, 6; 7, 8, 9; augment: #(hline: 1, vline: 1)) $,
$ mat(100, 2, 3; 4, 5, 6; 7, 8, 9; augment: #(hline: -2, vline: -2)) $,
$ mat(100, 2, 3; 4, 5, 6; 7, 8, 9; augment: #(vline: 2, stroke: 1pt + blue)) $,
$ mat(100, 2, 3; 4, 5, 6; 7, 8, 9; augment: #(vline: -1, stroke: 1pt + blue)) $,
)
---
// Test using matrix line drawing with a set rule.
#set math.mat(augment: (hline: 2, vline: 1, stroke: 2pt + green))
$ mat(1, 0, 0, 0; 0, 1, 0, 0; 0, 0, 1, 1) $
#set math.mat(augment: 2)
$ mat(1, 0, 0, 0; 0, 1, 0, 0; 0, 0, 1, 1) $
#set math.mat(augment: none)
---
// Error: 3-37 cannot draw a vertical line after column 3 of a matrix with 3 columns
$ mat(1, 0, 0; 0, 1, 1; augment: #3) $,
|
https://github.com/storopoli/Bayesian-Statistics | https://raw.githubusercontent.com/storopoli/Bayesian-Statistics/main/slides/11-hierarchical_models.typ | typst | Creative Commons Attribution Share Alike 4.0 International | #import "@preview/polylux:0.3.1": *
#import themes.clean: *
#import "utils.typ": *
#import "@preview/cetz:0.1.2": *
#new-section-slide("Hierarchical Models")
#slide(title: "Recommended References")[
- #cite(<gelman2020regression>, form: "prose"):
- Chapter 5: Hierarchical models
- Chapter 15: Hierarchical linear models
- #cite(<mcelreath2020statistical>):
- Chapter 13: Models With Memory
- Chapter 14: Adventures in Covariance
- #cite(<gelmanDataAnalysisUsing2007>, form: "prose")
- <NAME>'s case study on #link(
"https://betanalpha.github.io/assets/case_studies/hierarchical_modeling.html",
)[Hierarchical modeling]
- #cite(<kruschke2015bayesian>, form: "prose")
]
#focus-slide(background: julia-purple)[
#align(center)[#image("images/memes/hierarchical_models.jpg")]
]
#slide(title: [I have many names...])[
Hierarchical models are also known for several names #footnote[
for the whole full list
#link(
"https://statmodeling.stat.columbia.edu/2019/09/18/all-the-names-for-hierarchical-and-multilevel-modeling/",
)[check here].
]
- Hierarchical Models
- Random Effects Models
- Mixed Effects Models
- Cross-Sectional Models
- Nested Data Models
]
#slide(title: [What are hierarchical models?])[
Statistical model specified in multiple levels that estimates parameters from
the posterior distribution using a Bayesian approach.
The sub-models inside the model combines to form a hierarchical model, and
Bayes' theorem is used to integrate it to observed data and account for all
uncertain.
#v(2em)
Hierarchical models are mathematical descriptions that involves several
parameters, where some parameters' estimates depend on another parameters'
values.
]
#slide(title: [What are hierarchical models?])[
#text(size: 16pt)[
Hyperparameter $φ$ that parameterizes $θ_1, θ_2, dots, θ_K$, that are used to
infer the posterior density of some random variable
$bold(y) = y_1, y_2, dots, y_K$
]
#align(center)[
#canvas(
length: 0.9cm,
{
import draw: *
set-style(
mark: (end: ">", fill: black, size: 0.3),
stroke: (thickness: 2pt),
radius: 1,
)
circle((6, 0))
content((6, 0), [#align(center)[$φ$]])
line((6, 1), (0, 2))
circle((0, 3))
content((0, 3), [#align(center)[$θ_1$]])
line((6, 1), (3, 2))
circle((3, 3))
content((3, 3), [#align(center)[$dots$]])
line((6, 1), (6, 2))
circle((6, 3))
content((6, 3), [#align(center)[$θ_k$]])
line((6, 1), (9, 2))
circle((9, 3))
content((9, 3), [#align(center)[$dots$]])
line((6, 1), (12, 2))
circle((12, 3))
content((12, 3), [#align(center)[$θ_K$]])
line((0, 4), (0, 5))
circle((0, 6), fill: julia-purple)
content((0, 6), [#align(center)[#text(fill: white)[$y_1$]]])
line((3, 4), (3, 5))
circle((3, 6), fill: julia-purple)
content((3, 6), [#align(center)[#text(fill: white)[$dots$]]])
line((6, 4), (6, 5))
circle((6, 6), fill: julia-purple)
content((6, 6), [#align(center)[#text(fill: white)[$y_k$]]])
line((9, 4), (9, 5))
circle((9, 6), fill: julia-purple)
content((9, 6), [#align(center)[#text(fill: white)[$dots$]]])
line((12, 4), (12, 5))
circle((12, 6), fill: julia-purple)
content((12, 6), [#align(center)[#text(fill: white)[$y_K$]]])
},
)
]
]
#slide(title: [What are hierarchical models?])[
#text(size: 14pt)[
Even that the observations directly inform only a single set of parameters, a
hierarchical model couples individual parameters, and provides a "backdoor" for
information flow.
]
#align(center)[
#side-by-side[
#canvas(
length: 0.7cm,
{
import draw: *
set-style(
mark: (end: ">", fill: black, size: 0.3),
stroke: (thickness: 2pt),
radius: 1,
)
circle((6, 0))
content((6, 0), [#align(center)[$φ$]])
line((6, 1), (0, 2))
circle((0, 3))
content((0, 3), [#align(center)[$θ_1$]])
line((6, 1), (3, 2))
circle((3, 3))
content((3, 3), [#align(center)[$dots$]])
line((6, 1), (6, 2))
circle((6, 3))
content((6, 3), [#align(center)[$θ_k$]])
line((6, 1), (9, 2))
circle((9, 3))
content((9, 3), [#align(center)[$dots$]])
line((6, 1), (12, 2))
circle((12, 3))
content((12, 3), [#align(center)[$θ_K$]])
circle((0, 6), fill: julia-purple.lighten(50%))
content((0, 6), [#align(center)[#text(fill: white)[$y_1$]]])
circle((3, 6), fill: julia-purple.lighten(50%))
content((3, 6), [#align(center)[#text(fill: white)[$dots$]]])
line((6, 5), (6, 4))
circle((6, 6), fill: julia-purple)
content((6, 6), [#align(center)[#text(fill: white)[$y_k$]]])
circle((9, 6), fill: julia-purple.lighten(50%))
content((9, 6), [#align(center)[#text(fill: white)[$dots$]]])
circle((12, 6), fill: julia-purple.lighten(50%))
content((12, 6), [#align(center)[#text(fill: white)[$y_K$]]])
},
)
][
#canvas(
length: 0.7cm,
{
import draw: *
set-style(
mark: (end: ">", fill: black, size: 0.3),
stroke: (thickness: 2pt),
radius: 1,
)
circle((6, 0))
content((6, 0), [#align(center)[$φ$]])
line((6, 1), (0, 2))
circle((0, 3))
content((0, 3), [#align(center)[$θ_1$]])
line((6, 1), (3, 2))
circle((3, 3))
content((3, 3), [#align(center)[$dots$]])
line((6, 1), (6, 2))
circle((6, 3))
content((6, 3), [#align(center)[$θ_k$]])
line((6, 1), (9, 2))
circle((9, 3))
content((9, 3), [#align(center)[$dots$]])
line((6, 1), (12, 2))
circle((12, 3))
content((12, 3), [#align(center)[$θ_K$]])
line((0, 5), (0, 4))
circle((0, 6), fill: julia-purple)
content((0, 6), [#align(center)[#text(fill: white)[$y_1$]]])
line((3, 5), (3, 4))
circle((3, 6), fill: julia-purple)
content((3, 6), [#align(center)[#text(fill: white)[$dots$]]])
circle((6, 6), fill: julia-purple.lighten(50%))
content((6, 6), [#align(center)[#text(fill: white)[$y_k$]]])
line((9, 5), (9, 4))
circle((9, 6), fill: julia-purple)
content((9, 6), [#align(center)[#text(fill: white)[$dots$]]])
line((12, 4), (12, 5))
circle((12, 6), fill: julia-purple)
content((12, 6), [#align(center)[#text(fill: white)[$y_K$]]])
},
)
]
]
#text(size: 14pt)[
For example, the observations from the $k$th group, $y_k$, informs directly the
parameters that quantify the $k$th group's behavior,
$θ_k$. These parameters, however, inform directly the population-level
parameters,
$φ$, that, in turn, informs others group-level parameters. In the same manner,
observations that informs directly other group's parameters also provide
indirectly information to population-level parameters, which then informs other
group-level parameters, and so on...
]
]
#slide(title: [When to Use Hierarchical Models?])[
#v(3em)
*Hierarchical models* are used when information is available in *several levels
of units of observation*. The hierarchical structure of analysis and
organization assists in the understanding of *multiparameter problems*, while
also performing a crucial role in the development of *computational strategies*.
]
#slide(title: [When to Use Hierarchical Models?])[
#text(size: 16pt)[
Hierarchical models are particularly appropriate for research projects where
participant data can be organized in more than one level #footnote[
also known as nested data.
].
The units of analysis are generally individuals that are nested inside
contextual/aggregate units (groups).
An example is when we measure individual performance and we have additional
information about distinct group membership such as:
- sex
- age group
- income level
- education level
- state/province of residence
]
]
#slide(title: [When to Use Hierarchical Models?])[
Another good use case is *big data* @gelman2013bayesian.
- simple nonhierarchical models are usually inappropriate for hierarchical data:
with few parameters, they generally _cannot_ fit large datasets accurately.
- whereas with many parameters, they tend to *overfit*.
- hierarchical models can have enough parameters to fit the data well, while using
a population distribution to structure some dependence into the parameters,
thereby *avoiding problems of overfitting*.
]
#slide(title: [When to Use Hierarchical Models?])[
#v(2em)
Most important is *not to violate* the *exchangeability assumption*
@definettiTheoryProbability1974.
#v(2em)
This assumption stems from the principle that *groups are _exchangeable_*.
]
#slide(title: [Hyperprior])[
In hierarchical models, we have a hyperprior, which is a prior's prior:
#v(1em)
$
bold(y) &tilde "Normal"(10, bold(θ)) \
bold(θ) &tilde "Normal"(0, φ) \
φ &tilde "Exponential(1)"
$
#v(2em)
Here $bold(y)$ is a variable of interest that belongs to distinct groups.
$bold(θ)$, a prior for $bold(y)$, is a vector of group-level parameters with
their own prior (which becomes a hyperprior) $φ$.
]
#slide(title: [Frequentist versus Bayesian Approaches])[
#text(size: 18pt)[
There are also hierarchical models in frequentist statistics. They are mainly
available in the lme4 package @lme4, and also in MixedModels.jl @MixedModels.
- *optimization of the likelihood function* versus *posterior approximation via
MCMC*. Almost always lead to convergence failure for models that are not
extremely simple.
- *frequentist hierarchical models do not compute $p$-values for the group-level
effects*
#footnote[
see #link("https://stat.ethz.ch/pipermail/r-help/2006-May/094765.html")
[<NAME>, creator of the lme4 package explanation].
]. This is due to the underlying assumptions of the approximations that
frequentist statistics has to to do in order to calculate the group-level
effects $p$-values. The main one being that the groups must be balanced. In
other words, the groups must be homogeneous in size. Hence, any unbalance in
group compositions results in pathological $p$-values that should not be
trusted.
]
]
#slide(title: [Frequentist versus Bayesian Approaches])[
#v(3em)
To sum up, *frequentist approach for hierarchical models is not robust* in both
the *inference process* (*convergence flaws* during the maximum likelihood
estimation), and also in the *results* from the inference process (do not
provide $p$-values due to *strong assumptions that are almost always violated*).
]
#slide(title: [Approaches to Hierarchical Modeling])[
#v(1em)
- *Varying-intercept* model: One group-level intercept besides the
population-level coefficients.
#v(1em)
- *Varying-slope* model: One or more group-level coefficient(s) besides the
population-level intercept.
#v(1em)
- *Varying-intercept-slope* model: One group-level intercept and one or more
group-level coefficient(s).
]
#slide(title: [Mathematical Specification of Hierarchical Models])[
#v(4em)
We have $N$ observations organized in $J$ groups with $K$ independent variables.
]
#slide(title: [Mathematical Specification -- Varying-Intercept Model])[
This example is for linear regression:
$
bold(y) &tilde "Normal"(α_j + bold(X) dot bold(β), σ) \
α_j &tilde "Normal"(α, τ) \
α &tilde "Normal"(μ_α, σ_α) \
bold(β) &tilde "Normal"(μ_{bold(β)}, σ_(bold(β))) \
τ &tilde "Cauchy"^+(0, ψ_(α)) \
σ &tilde "Exponential"(λ_σ)
$
]
#slide(title: [Mathematical Specification -- Varying-Intercept Model])[
#text(size: 14pt)[
If you need to extend to more than one group, such as $J_1, J_2, dots$:
$
bold(y) &tilde "Normal"(α_j_1 + α_j_2 + bold(X) bold(β), σ) \
α_(j_1) &tilde "Normal"(α_1, τ_α_j_1) \
α_(j_2) &tilde "Normal"(α_2, τ_α_j_2) \
α_1 &tilde "Normal"(μ_(α_1), σ_α_1) \
α_2 &tilde "Normal"(μ_(α_2), σ_α_2) \
bold(β) &tilde "Normal"(μ_(bold(β)), σ_(bold(β))) \
τ_(α_j_1) &tilde "Cauchy"^+(0, ψ_α_j_1) \
τ_(α_j_2) &tilde "Cauchy"^+(0, ψ_α_j_2) \
σ &tilde "Exponential"(λ_σ)
$
]
]
#slide(title: [Mathematical Specification -- Varying-(Intercept-)Slope Model])[
If we want a varying intercept, we just insert a column filled with $1$s in the
data matrix $bold(X)$.
#v(1em)
Mathematically, this makes the column behave like an "identity" variable
(because the number $1$ in the multiplication operation $1 dot β$ is the
identity element. It maps $x → x$ keeping the value of $x$ intact) and,
consequently, we can interpret the column's coefficient as the model's
intercept.
]
#slide(title: [Mathematical Specification -- Varying-(Intercept-)Slope Model])[
Hence, we have as a data matrix:
#v(2em)
// typstfmt::off
$
bold(X) =
mat(
delim: "[",
1, x_(11), x_(12), dots, x_(1K);
1, x_(21), x_(22), dots, x_(2K);
dots.v, dots.v, dots.v, dots.down, dots.v;
1, x_(N 1), x_(N 2), dots, x_(N K);
)
$
// typstfmt::on
]
#slide(title: [Mathematical Specification -- Varying-(Intercept-)Slope Model])[
This example is for linear regression:
$
bold(y) &tilde "Normal"(bold(X) bold(β)_{j}, σ) \
bold(β)_j &tilde "Multivariate Normal"(bold(μ)_j, bold(Σ))
"for" j ∈ {1, dots, J} \
bold(Σ) &tilde "LKJ"(η) \
σ &tilde "Exponential"(λ_σ)
$
#v(1em)
Each coefficient vector $bold(β)_j$ represents the model columns $bold(X)$ coefficients
for every group $j ∈ J$. Also the first column of $bold(X)$ could be a column
filled with $1$s (intercept).
]
#slide(title: [Mathematical Specification -- Varying-(Intercept-)Slope Model])[
If you need to extend to more than one group, such as $J_1, J_2, dots$:
$
bold(y) &tilde "Normal"(α + bold(X) bold(β)_j_1 + bold(X) bold(β)_j_2, σ) \
bold(β)_j_1 &tilde "Multivariate Normal"(bold(μ)_j_1, bold(Σ)_1)
"for" j_1 ∈ {1, dots, J_1} \
bold(β)_j_2 &tilde "Multivariate Normal"(bold(μ)_j_2, bold(Σ)_2)
"for" j_2 ∈ {1, dots, J_2} \
bold(Σ)_1 &tilde "LKJ"(η_1) \
bold(Σ)_2 &tilde "LKJ"(η_2) \
σ &tilde "Exponential"(λ_σ)
$
]
#slide(title: [Priors for Covariance Matrices])[
We can specify a prior for a covariance matrix $bold(Σ)$.
#v(1em)
For computational efficiency, we can make the covariance matrix $bold(Σ)$ into a
correlation matrix. Every covariance matrix can be decomposed into:
$
bold(Σ)="diag"_"matrix" (bold(τ)) dot bold(Ω) dot "diag"_"matrix" (bold(τ))
$
where $bold(Ω)$ is a correlation matrix with
$1$s in the diagonal and the off-diagonal elements between -1 e 1 $ρ ∈ (-1, 1)$.
$bold(τ)$ is a vector composed of the variables' standard deviation from
$bold(Σ)$ (is is the $bold(Σ)$'s diagonal).
]
#slide(title: [Priors for Covariance Matrices])[
#text(size: 16pt)[
Additionally, the correlation matrix $bold(Ω)$
can be decomposed once more for greater computational efficiency.
Since all correlations matrices are symmetric and positive definite (all of its
eigenvalues are real numbers $RR$ and positive $>0$), we can use the
#link("https://en.wikipedia.org/wiki/Cholesky_decomposition")[Cholesky Decomposition]
to decompose it into a triangular matrix (which is much more computational
efficient to handle):
$
bold(Ω) = bold(L)_Ω bold(L)^T_Ω
$
where $bold(L)_Ω$ is a lower-triangular matrix.
What we are missing is to define a prior for the correlation matrix $bold(Ω)$.
Not a long time ago, we've used a Wishart distribution as a prior
@gelman2013bayesian.
But this has been abandoned after the proposal of the LKJ distribution by
#cite(<lewandowski2009generating>, form: "prose")
#footnote[
LKJ are the authors' last name initials -- Lewandowski, Kurowicka and Joe.
] as a prior for correlation matrices.
]
]
|
https://github.com/jgm/typst-hs | https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/bugs/square-base-00.typ | typst | Other | #set page(height: 80pt)
#square(width: 40%, rect(width: 60%, height: 80%))
|
https://github.com/lxl66566/my-college-files | https://raw.githubusercontent.com/lxl66566/my-college-files/main/信息科学与工程学院/机器学习(选修)/结课报告/报告.typ | typst | The Unlicense | #let 字号 = (
初号: 42pt,
小初: 36pt,
一号: 26pt,
小一: 24pt,
二号: 22pt,
小二: 18pt,
三号: 16pt,
小三: 15pt,
四号: 14pt,
中四: 13pt,
小四: 12pt,
五号: 10.5pt,
小五: 9pt,
六号: 7.5pt,
小六: 6.5pt,
七号: 5.5pt,
小七: 5pt,
)
#let 字体 = (
仿宋: ("Times New Roman", "FangSong"),
宋体: ("Times New Roman", "SimSun"),
黑体: ("Times New Roman", "SimHei"),
楷体: ("Times New Roman", "KaiTi"),
代码: ("New Computer Modern Mono", "Times New Roman", "SimSun"),
)
// 中文摘要
#let zh_abstract_page(abstract, keywords: ()) = {
set heading(level: 1, numbering: none, outlined: false)
show <_zh_abstract_>: {
align(center)[
#text(font: 字体.黑体, size: 字号.小二, "摘要")
]
}
[= 摘要 <_zh_abstract_>]
set text(font: 字体.宋体, size: 字号.小四)
abstract
par(first-line-indent: 0em)[
#text(weight: "bold", font: 字体.黑体, size: 字号.小四)[
关键词:
]
#keywords.join(";")
]
}
// 英文摘要
#let en_abstract_page(abstract, keywords: ()) = {
set heading(level: 1, numbering: none, outlined: false)
show <_en_abstract_>: {
align(center)[
#text(font: 字体.黑体, size: 字号.小二, "Abstract")
]
}
[= Abstract <_en_abstract_>]
set text(font: 字体.宋体, size: 字号.小四)
abstract
par(first-line-indent: 0em)[
#text(weight: "bold", font: 字体.黑体, size: 字号.小四)[
Key Words:
]
#keywords.join("; ")
]
}
#let project(
title: "",
authors: (),
abstract_zh: [],
abstract_en: [],
keywords_zh: (),
keywords_en: (),
body,
) = {
set document(author: authors, title: title)
set page(
numbering: "I",
number-align: center,
header: [#text(size: 字号.五号, title)#line(length: 100%)],
)
// 两端对齐,段前缩进2字符
set par(justify: true, first-line-indent: 2em)
show heading: it => {
it
par()[#text(size: 0.5em)[#h(0.0em)]]
}
// 正文
set text(font: 字体.宋体, size: 字号.小四, lang: "zh")
// heading
show heading: set text(font: 字体.黑体)
set heading(numbering: "1.1")
show heading: it => {
if it.level == 1 {
text(font: 字体.黑体, size: 字号.四号, it)
} else if it.level == 2 {
text(font: 字体.黑体, size: 字号.小四, it)
} else if it.level == 3 {
text(font: 字体.黑体, size: 字号.五号, it)
}
}
// figure(image)
show figure: it => [
#set align(center)
#if not it.has("kind") {
it
} else if it.kind == image {
it.body
[
#set text(font: 字体.宋体, size: 字号.五号, weight: "extrabold")
#h(1em)
#it.caption
]
} else if it.kind == table or it.kind == code {
[
#set text(font: 字体.宋体, size: 字号.五号, weight: "bold")
#h(1em)
#it.caption
]
it.body
}
]
show outline: ol => {
set par(first-line-indent: 0pt)
ol
}
set page(numbering: "1")
align(center)[#text(font: 字体.黑体, size: 字号.小二, title)]
body
}
#show: project.with(
title: "使用预训练模型进行推理",
authors: ("ab<PASSWORD>ex",),
)
= 前言
本报告是一份使用心得,以此作为机器学习的结课报告。
在机器学习的课程中,我学会了如何使用回归模型、神经网络等算法进行模型训练的原理,并且在作业中调用 python 库 `sklearn.neural_network` 进行训练。但是,更进一步的模型训练需要学习如何调整参数,学习更多的机器学习算法,并付出大量训练时间和GPU资源。如果我不想自己训练模型,而是使用预训练模型,我需要怎么做呢?
== llama.cpp
llama.cpp (https://github.com/ggerganov/llama.cpp) 是一个基于C++编写的高性能计算库,旨在提供快速、稳定且易于使用的计算工具。它采用了先进的并行计算技术,充分利用多核处理器和分布式系统的优势,实现了高效的计算性能。llama.cpp支持多种计算模式,包括向量计算、矩阵运算、图算法等,可广泛应用于机器学习、图像处理、数据分析等领域。
`llama.cpp` 的主要特点包括:
- 高性能计算:它是一个基于 C++ 编写的高性能计算库,旨在提供快速、稳定且易于使用的计算工具。
- 并行计算技术:采用了先进的并行计算技术,充分利用多核处理器和分布式系统的优势,实现了高效的计算性能³。
- 优化底层计算和内存管理:通过优化底层计算和内存管理,可以在不牺牲模型性能的前提下提高推理速度。
=== 安装
在 windows 上,配置好 C++ 环境后尝试编译,仍会报错,指向看不懂的 C++ 错误。因此我尝试切换到 linux 下进行编译。
首先,下载源码包:
```sh
git clone <EMAIL>:ggerganov/llama.cpp.git -b master --depth 1
```
只克隆 master 分支和设置深度为 1 可以减少一些下载量。然后执行
```sh
make -j8
```
进行编译,此处使用 8 线程。linux 下可以一遍编译成功,文件夹下会多出 `main` 可执行文件。
当然,也可以直接去 Release 中下载编译好的可执行文件,又快又能避开环境问题,预编译文件和预训练模型也非常相配。
=== 下载模型
此处我选择从huggingface下载已经过量化的成品模型。这里我选用的是 llama2-uncensored (https://huggingface.co/georgesung/llama2_7b_chat_uncensored),一个经过微调的 Llama-2 7B。
顺带一提,在 huggingface 下载模型的官方教程使用的也是 git 下载,但是速度比较慢。这个回答 (https://stackoverflow.com/questions/67595500/) 给出了许多工具,可以帮助我方便快速地下载模型。
=== 交互式运行
准备就绪,现在我可以运行下面的代码,使用 llama.cpp 加载模型,并交互式输入。
```sh
./main -m llama2-uncensored --color -ins -c 2048 --temp 0.2 -n 256 --repeat_penalty 1.1
```
这里是一些参数的说明:
- `-m` 指定模型
- `-c` 控制上下文的长度,值越大越能参考更长的对话历史(默认:512)
- `-ins` 启动类ChatGPT对话交流的instruction运行模式
- `-f` 指定prompt模板
- `-n` 控制回复生成的最大长度(默认:128)
- `-b` 控制batch size(默认:8),可适当增加
- `-t` 控制线程数量(默认:4),可适当增加
- `--repeat_penalty` 控制生成回复中对重复文本的惩罚力度
- `--temp` 温度系数,值越低回复的随机性越小,反之越大
- `--top_p`, top_k 控制解码采样的相关参数
这里是运行的结果:
#figure(image("static/ex.png"))
可以看出,这个只有 7B 参数,3.8GB 大小的模型并不强大,第二句话就开始胡说八道。但是至少它在我的机器上成功运行了,并且能够给出语句通顺的回答。
== ollama
当然,在大语言模型如井喷般迅猛发展的现在,llama.cpp 并不能算是一个足够好用的工具。这里我又尝试了 ollama (https://github.com/ollama/ollama),一个用 go 语言写的,无脑上手的大模型运行工具,本质上是对 llama.cpp 的包装。
=== 安装
go 语言具有统一的包管理,我原以为只需要执行
```sh
git clone [email protected]:ollama/ollama.git -b main --depth 1
cd ollama
go generate ./...
go build main.go
```
即可拉取源代码,并构建可执行文件。(参考了官方的开发者指南 https://github.com/ollama/ollama/blob/main/docs/development.md)
但是实际上这个安装也会拉取 llama.cpp 仓库并尝试编译,并且编译时也会报错:`Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.`,也是无法简单解决的问题。
因此我也不推荐从源代码编译,可以直接下载已编译好的可执行文件。
=== 使用
ollama 最大的特点就是易用。只需要执行一句
```sh
ollama run llama3
```
其就会自动下载 llama3 模型,并使用默认的参数运行。代价就是无法像使用 llama.cpp 那样作出精细的参数控制。 |
https://github.com/jasonelaw/bes-typst-memo | https://raw.githubusercontent.com/jasonelaw/bes-typst-memo/main/_extensions/quarto-ext/memo/typst-template.typ | typst | // This function gets your whole document as its `body`
// and formats it as a simple letter.
#let memo(
// The letterhead image file path
letterhead: "images/letterhead.png",
// The letter's sender, which is display at the top of the page.
sender: none,
// The letter's recipient, which is displayed close to the top.
recipient: none,
// The date, displayed to the right.
date: none,
// The subject line.
re: none,
// The memo body
body
) = {
let footer = [
#set text(font: "Palatino Linotype", size: 10pt)
#line(length: 100%, stroke: (thickness: 0.5pt, paint: black))
#v(4pt, weak: true)
Ph: 503-823-7740 #sym.square.filled
Fax: 503-823-6995 #sym.square.filled
#link("https://portland.gov/bes")[portland.gov/bes] #sym.square.filled
An Equal Opportunity Employer\
#set text(font: "Calibri", size: 8pt)
#v(0.5em)
The City of Portland ensures meaningful access to City programs, services,
and activities to comply with Civil Rights Title VI and ADA Title II laws
and reasonably provides: translation interpretation, modifications,
accomodations, alternative formats, auxiliary aids and services. To request
these services or file a complaint of discrimination, contact 503-823-7740,
or 311 (503-823-4000), for Relay Service and TTY: 711.
]
// Configure page and text properties.
set page(
paper: "us-letter",
margin: (x: 1.5in, y: 1.5in),
header: context {
if counter(page).get().first() == 1 {
align(center + bottom,
move(block(
height: 1.5in,
width: 7.5in,
image(letterhead, width: 100%)
), dy: 0.5in),
)
}
},
footer-descent: 10%,
footer: context {
if counter(page).get().first() == 1 {
align(center + horizon,
block(
height: 1.75in,
width: 7in,
footer
)
)
}
}
)
/* align(center,
move(
block(
height: 1in,
width: 7.5in,
image(letterhead, width: 100%)
),
dy: 1in
)
)
*/
v(5em)
text(font: "Calibri", weight: "light", size: 18pt, tracking: 12pt,
upper("Memorandum")
)
// Memo header material
set text(font: "Calibri", size: 12pt, weight: "bold")
line(length: 100%)
date
grid(
columns: (1.0in, auto),
rows: (auto),
row-gutter: 12pt,
"To:", recipient,
"From:", sender,
"RE:", re
)
line(length: 100%)
v(2em)
// memo body
set text(font: "Calibri", size: 12pt, weight: "regular")
set par(linebreaks: "optimized", first-line-indent: 1em)
body
}
|
|
https://github.com/MobtgZhang/sues-thesis-typst | https://raw.githubusercontent.com/MobtgZhang/sues-thesis-typst/main/paper/covers/authorization.typ | typst | MIT License | #import "../thesis.typ": fontstypedict,fontsizedict,linespacing,autoFakeBold_pt
#set align(center)
#text("上海工程技术大学\n学位论文版权使用授权书",size:fontsizedict.三号,font:fontstypedict.黑体,stroke:autoFakeBold_pt)
#set align(left)
#set text(font:fontstypedict.宋体)
#par(justify: true, first-line-indent: 2em, leading: linespacing)[
本学位论文作者完全了解学校有关保留、使用学位论文的规定,同意学校保留并向国家有关部门或机构送交论文的复印件和电子版,允许论文被查阅和借阅。本人授权上海工程技术大学可以将本学位论文的全部或部分内容编入有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存和汇编本学位论文。
#h(1em)
#align(left + top,
box(
grid(
columns: (auto, auto,auto,auto),
gutter: 1em,
"",rect(width: 9pt, height: 9pt),text("保密",stroke:autoFakeBold_pt,font:fontstypedict.黑体)," ,在年解密后适用本授权书。",
"本学位论文属于","","","",
"",rect(width: 9pt, height: 9pt),text("不保密",stroke:autoFakeBold_pt,font:fontstypedict.黑体),"",
)
)
)
]
#align(center + bottom,
box(
grid(
columns: (auto, auto),
gutter: 2em,
"学位论文作者签名:", "",
"日" + h(2em) + "期:", h(1em) + text("年") + h(2em) + text("月") + h(2em) + text("日")
),
)+h(0.5fr)+box(
grid(
columns: (auto, auto),
gutter: 2em,
"指导老师签名:", "",
"日" + h(2em) + "期:", h(1em) + text("年") + h(2em) + text("月") + h(2em) + text("日")
),
),
)
#v(15em)
#pagebreak() |
https://github.com/drupol/master-thesis | https://raw.githubusercontent.com/drupol/master-thesis/main/src/thesis/theme/leftblank.typ | typst | Other | #import "common/metadata.typ": *
#let leftblank(
weak: true
) = {
pagebreak(weak: weak)
set align(center)
v(80%)
text(fill: black.lighten(75%))[
This page is intentionally left blank.
]
pagebreak(weak: true)
}
|
https://github.com/TypstApp-team/typst | https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/bugs/flow-3.typ | typst | Apache License 2.0 | // In this bug, there was a bit of space below the heading because weak spacing
// directly before a layout-induced column or page break wasn't trimmed.
---
#set page(height: 60pt)
#rect(inset: 0pt, columns(2)[
Text
#v(12pt)
Hi
#v(10pt, weak: true)
At column break.
])
|
https://github.com/lucannez64/Notes | https://raw.githubusercontent.com/lucannez64/Notes/master/Vector-Valued%20Functions.typ | typst | #import "template.typ": *
// Take a look at the file `template.typ` in the file panel
// to customize this template and discover how it works.
#show: project.with(
title: "Vector-Valued Functions",
authors: (
"<NAME>",
),
date: "30 Octobre, 2023",
)
#set heading(numbering: "1.1.")
= Vector-Valued functions
<vector-valued-functions>
== Definition
<definition>
Tangent vectors and normal vectors are two types of vectors that are
associated with vector-valued functions. A tangent vector is a vector
that is tangent to the curve or surface defined by the vector-valued
function, while a normal vector is a vector that is perpendicular to the
curve or surface.
Tangent vectors and normal vectors are important because they provide
information about the local behavior of a vector-valued function. For
example, the direction of the tangent vector at a point on a curve can
be used to determine the direction of the curve at that point, while the
direction of the normal vector at a point on a surface can be used to
determine the orientation of the surface at that point.
Tangent vectors and normal vectors can be calculated using a variety of
mathematical techniques. In general, the tangent vector at a point on a
curve is found by taking the derivative of the vector-valued function at
that point, while the normal vector at a point on a surface is found by
taking the gradient of the function at that point. These vectors can
then be used to study the properties of the function at that point, such
as its curvature or its rate of change.
=== Formula
<formula>
The main formula for vector-valued functions is:
f(t) \= x(t)i + y(t)j + z(t)k
where t is the input variable, i, j, and k are the unit vectors in the
x, y, and z directions, respectively, and x(t), y(t), and z(t) are
functions that determine the magnitude of the vector in each direction.
This formula is known as the parametric representation of a
vector-valued function, because it expresses the vector as a function of
a single input variable, t, which is called the parameter.
This formula can be used to represent a wide variety of vector-valued
functions, including those that describe curves in two- or
three-dimensional space, or surfaces in three-dimensional space. It
provides a convenient way to represent and manipulate vector-valued
functions using mathematical operations, such as differentiation and
integration.
Note that this formula is just one of many possible ways to represent
vector-valued functions. Other representations are also commonly used,
depending on the specific problem being considered and the tools and
techniques being used to study the function.
== Tangent and Normal Vector
<tangent-and-normal-vector>
Tangent vectors and normal vectors are two types of vectors that are
associated with vector-valued functions. A tangent vector is a vector
that is tangent to the curve or surface defined by the vector-valued
function, while a normal vector is a vector that is perpendicular to the
curve or surface.
Tangent vectors and normal vectors are important because they provide
information about the local behavior of a vector-valued function. For
example, the direction of the tangent vector at a point on a curve can
be used to determine the direction of the curve at that point, while the
direction of the normal vector at a point on a surface can be used to
determine the orientation of the surface at that point.
Tangent vectors and normal vectors can be calculated using a variety of
mathematical techniques. In general, the tangent vector at a point on a
curve is found by taking the derivative of the vector-valued function at
that point, while the normal vector at a point on a surface is found by
taking the gradient of the function at that point. These vectors can
then be used to study the properties of the function at that point, such
as its curvature or its rate of change.
=== Formula
<formula-1>
===== Tangent Vector
<tangent-vector>
The main formula for calculating the tangent vector at a point on a
curve defined by a vector-valued function is:
T(t) \= f’(t)
where f(t) is the vector-valued function, and f’(t) is the derivative of
the function with respect to the input variable t. This formula
expresses the tangent vector as the derivative of the function, which
provides information about the local slope or rate of change of the
function at the point in question.
==== Normal Vector
<normal-vector>
The main formula for calculating the normal vector at a point on a
surface defined by a vector-valued function is:
N(t) \= ∇f(t)
where f(t) is the vector-valued function, and ∇f(t) is the gradient of
the function at the point in question. The gradient is a vector that
points in the direction of greatest rate of increase of the function,
and is perpendicular to the surface at the point in question. This
formula expresses the normal vector as the gradient of the function,
which provides information about the orientation of the surface at the
point in question.
Note that these formulas are just two examples of many possible ways to
calculate the tangent and normal vectors of vector-valued functions.
There are many other techniques and methods that can be used to
calculate these vectors, depending on the specific problem being
considered and the tools and techniques being used to study the
function.
===== Gradient
<gradient>
The main formula for calculating the gradient of a vector-valued
function is:
∇f(t) \= \[f1’(t), f2’(t), f3’(t)\]
where f(t) is the vector-valued function, f1(t), f2(t), and f3(t) are
the components of the function in the x, y, and z directions,
respectively, and f1’(t), f2’(t), and f3’(t) are the derivatives of
these components with respect to the input variable t. This formula
expresses the gradient of the function as a vector whose components are
the partial derivatives of the function with respect to each input
variable.
The gradient is a vector that points in the direction of greatest rate
of increase of the function, and is perpendicular to the surface defined
by the function at the point in question. It can be used to calculate
the normal vector at a point on a surface, and is an important tool in
vector calculus and other branches of mathematics.
Note that this formula is just one of many possible ways to calculate
the gradient of a vector-valued function. There are many other
techniques and methods that can be used to calculate the gradient,
depending on the specific problem being considered and the tools and
techniques being used to study the function.
=== Arc Length and Curvature
<arc-length-and-curvature>
The arc length of a vector-valued function is a measure of the distance
along the curve defined by the function. It is calculated by dividing
the length of the curve by the number of intervals into which the curve
is divided, and is often denoted by the symbol s. The formula for the
arc length of a vector-valued function is:
s \= ∫∣f’(t)∣dt
where f(t) is the vector-valued function, f’(t) is the derivative of the
function with respect to the input variable t, and the integral is taken
over the range of t for which the function is defined. This formula
expresses the arc length as the integral of the magnitude of the
derivative of the function, which provides a way to calculate the
distance along the curve defined by the function.
The curvature of a vector-valued function is a measure of the degree to
which the curve defined by the function deviates from a straight line.
It is calculated by taking the magnitude of the derivative of the
tangent vector at a point on the curve, and is often denoted by the
symbol k. The formula for the curvature of a vector-valued function is:
k \= ∣f’’(t)∣
where f(t) is the vector-valued function, f’(t) is the derivative of the
function with respect to the input variable t, and f’’(t) is the second
derivative of the function. This formula expresses the curvature as the
magnitude of the second derivative of the function, which provides a way
to calculate the degree to which the curve defined by the function is
curved at a given point.
Both the arc length and curvature of a vector-valued function are
important concepts in vector calculus and other branches of mathematics.
They provide information about the local behavior of the function, and
can be used to study the properties of the curve or surface defined by
the function.
|
|
https://github.com/ufodauge/master_thesis | https://raw.githubusercontent.com/ufodauge/master_thesis/main/src/template/index.typ | typst | MIT License | #import "utils/theorems.typ": *
#import "components/cover-section/index.typ": CoverSection
#import "components/intro-section/index.typ": IntroSection
#import "components/main-section/index.typ" : MainSection
#import "components/common/route.typ" : Route
#let template(
title : "卒業論文、修士論文のタイトル",
student-number : "22MM305",
author : "<NAME>",
mentor : "<NAME>",
mentor-post : "教授",
laboratry : "鐘井研究室",
font : "<NAME>",
font-strong : "<NAME>",
date : datetime.today(),
abstract : [],
acknowledgement: [],
references : none,
body
) = Route(
font : font,
font-strong: font-strong,
[
#CoverSection(
title : title,
student-number: student-number,
mentor : mentor,
mentor-post : mentor-post,
date : date,
author : author,
laboratry : laboratry,
)
#IntroSection(
abstract : abstract,
acknowledgement: acknowledgement,
)
#MainSection(
references: references,
body
)
]
) |
https://github.com/darioglasl/Arbeiten-Vorlage-Typst | https://raw.githubusercontent.com/darioglasl/Arbeiten-Vorlage-Typst/main/Anhang/02_Implementations_Details/00_index.typ | typst | == Implementations-Details
|
|
https://github.com/Myriad-Dreamin/typst.ts | https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/font_00.typ | typst | Apache License 2.0 |
#import "/contrib/templates/std-tests/preset.typ": *
#show: test-page
// Set same font size in three different ways.
#text(20pt)[A]
#text(2em)[A]
#text(size: 15pt + 0.5em)[A]
// Do nothing.
#text()[Normal]
// Set style (is available).
#text(style: "italic")[Italic]
// Set weight (is available).
#text(weight: "bold")[Bold]
// Set stretch (not available, matching closest).
#text(stretch: 50%)[Condensed]
// Set font family.
#text(font: "IBM Plex Serif")[Serif]
// Emoji.
Emoji: 🐪, 🌋, 🏞
// Colors.
#[
#set text(fill: eastern)
This is #text(rgb("FA644B"))[way more] colorful.
]
// Disable font fallback beyond the user-specified list.
// Without disabling, New Computer Modern Math would come to the rescue.
#set text(font: ("PT Sans", "Twitter Color Emoji"), fallback: false)
2π = 𝛼 + 𝛽. ✅
|
https://github.com/lphoogenboom/typstThesisDCSC | https://raw.githubusercontent.com/lphoogenboom/typstThesisDCSC/master/chapters/firstRealChapter.typ | typst | #import "../typFiles/chapter.typ": *
#show: chapter.with(chapterTitle: "First Real Chapter", content: [
dasdasdasfgdfgfg
]) |
|
https://github.com/danilasar/conspectuses-3sem | https://raw.githubusercontent.com/danilasar/conspectuses-3sem/master/Ассемблер/240926.typ | typst | Машинный формат двухадресной команды, для которой один операнд находится всегда в регистре, а второй --- в регистре или памяти можно представить следующим обрезом:
#image("image copy.png")
...
В ассемблере, как и в языках высокого уровня, могут использоваться именованные константы.
25 --- неименованная константа, которой можно присвоить символическое имя.
```nasm
mov ax, 25
const equ 34h ; именованная константа const
mov ax, const
```
== Прямая адресация
Если нам известен физический адрес байта, начиная с которого расположен операнд, мы можем его написать прямо в команде:
```nasm
mov ax, es : 0001
```
Можно использовать в качестве прямой адресации символическое имя, которому предварительно поставлен в соответствие некоторый адрес. Это может быть сделано с помощью директив определения данных и памяти, среди которых:
`db`, `dw`, `dd` --- определить байт, слово и двойное слово.
Если в сегменте `ES` содержится директива `Var_p DW ?`, тогда по команде
```nasm
mov ax, es : Var_p ; ((ES) + Var_p) -> ax
```
Например, если команда имеет ид:
```nasm
mov ax, Var_p; ((DS) + Var_p) -> ax
```
== Косвенно-регистровая адресация
Косвенно-регистровая отличается от регистровой тем, что в регистре содержится не операнд, а адрес области памяти, в которой содержится операнд.
```nasm
mov ax, [st]
```
Могут использоваться регистры: si, di, bx, bp, eax, ebx, ecx, edx, ebp, esi, edl.
Не могут: ax, cx, dx, sp, esp.
== Адресация по базе со смещением
```nasm
mov ax, [bx + 2] ; ((ds) + (bx) + 2) -> ax
mov ax, [bx] + 2 ; то же самое
mov ax, 2[bx] ; то же самое
mov ax, [bp + 4] ; ((ss) + (bp) + 4) -> ax
```
== 6. Прямая с индексированием
```nasm
mov ax, mas[si] ; ((ds) + (si) + mas) -> ax
```
Используется для работы с одномерными массивами и полями структур.
== По базе с индексированием
```nasm
mov ax, arr[bx][di] ; ((ds) + (bx) + (di) + arr)
```
Эта адресация позволяет работать с двумерными массивами и со структурами.
= особенности использования команд пересылки
+ Нельзя пересылать информацию из одной области памяти в другую. Для этого есть команды работы со строками
+ Нельзя пересылать информацию из одного сегментного регистра в другой. Если очень хочется, то есть регистры общего назначения и стек:
```nasm
push ds
pop es
```
3. Нельзя пересылать непосредственный операнд в сегментный регистр, но если такая необходимость возникает, то нужно использовать в качестве промежуточного один из регистров общего назначения:
```nasm
mov dx, 100h
mov ds, dx
```
4. Нельзя изменять командой mov содержимое регистра cs
+ Размер передаваемых данных определяется типом операндов в команде:
```nasm
x db ? ; x --- адрес одного байта в памяти
y dw ? ; y определяет поле в 2 байта в памяти
mov x, 0 ; очищение одного байта в памяти
mov y, 0 ; очишение двух байтов в памяти
mov ax, 0 ; очищение двухбайтового регистра
mov [si], 0 ; сообщение об ошибке: нам неизвестны размеры полей
```
Для выхода из неопределённости размера полей можно использовать специальный оператор
```nasm
тип ptr выражение
```
где тип --- byte, word, dword и т д., а выражение --- константа или адрес
```nasm
byte ptr 0 ; 0 применяется как байт
word ptr 0 ; 0 применяется как слово
byte ptr op ; один байт в памяти
mov byte ptr [si], 0 ; = mov [si], byte ptr 0
mov [si] word ptr 0 ; 0 -> ((ds) + (si))
```
7. Если тип обоих операндов определён, то они должны соответствовать друг другу
```nasm
mov ah, 500 ; сообщение об ошибке
mov ax, x ; ошибка: x --- 1 байт, ax --- 2 байта
mov al, r ; ошибка
mov al, byte ptr r ; (AL) = 34h
mov al, byte ptr r+1 ; (AL) = 12h
```
К командам пересылки относят команду обена значений операндов:
```nasm
xchg op1, op2 ; r <-> r or r <-> m
mov ax, 10h
mov bx, 20h
xchg ax, bx ; (ax) = 20h, (bx) = 10h
```
Для перестановки значений байтов внутри регистра используют bswop:
```nasm
(eax) = 12345678h
bswop eax ; (eax) = 78563412h
```
Команды конвертирования:
```nasm
cbw ; безадресная команда, (AL) -> AX
cwd ; (ax) -> dx:ax
cwe ; (ax) -> eax (i386+)
cdf ; (eax) -> edx:eax (i386+)
```
Команды условной пересылки cmovxx:
```nasm
cmovl al, bl ; (al) < (bl) => (bl) -> (al)
```
Загрузка адреса
```nasm
lea op1, op2 ; вычисляет адрес op2 и пересылает первому операнду, который может быть только регистром
```
```nasm
lea bx, m[bx][di]
```
= Этапы обработки
Три этапа обработки:
1. Из исходного кода получаем программный код машины. Исходный код может состоять из нескольких модулей
2. Исходные модули объединяются в исполняемый модуль (.exe).
Чтобы выполнить com-файл, нужно выполнить ещё один этап обработки:
3. С помощью системной программы exe2com или в среде разработке с помощью специального ключа
= Команды и директивы в ассемблере
Команда на ассемблере состоит из четырёх полей:
[\<имя\>[:]] \<код операции\> [\<операнды\>][; комментарий]
Поля отделяют друг от друга как минимум одним пробелом. В квадратных скобках указаны необязательные поля. Кроме кода операции могут участвовать имя --- символическое имя Ассемблера. Имя используется в качестве метки для обращения к этой команде, передачи управления на другую команду, [:] после имени означает, что метка является внутренней. Код операции определяет, какое действие должен выполнить процессор. Поле \<операнды\> содержит адреса данных, или данные, участвующие в операции, а также место расположения результатов операции. Операндов может быть от 1до 3, они отделяются друг от друга запятой.
Комментарии отделяются кроме пробела ещё ";" и могут занимать всю строку или часть строки. например:
```nasm
jmp m1
```
; команда безусловной передачи управления на команду с меткой.
```nasm
m1: mov ax, bx ; пересылка содержимого регистра bx в регистр ax
```
В комментарии выше будем записывать в виде (BX) AX
== Директива
Директива, как и команда, может иметь 4 поля:
```nasm
[<имя>] <код псевдооперации> <операнды> [; комментарии]
```
Здесь
- имя --- символическое имя ассемблера
- код псевдооперации определяет назначение директивы
Например:
```nasm
m1 db 1, 0, 1, 0, 1 ; db определяет 5 байтов памяти, заполняет их 0 или 1 соответственно, адрес первого байта --- M1
m2 db ?, ?, ? ; директива db определяет 3 байта памяти без инициализации
```
```nasm
proc ; директива начала процедуры
edp ; директива конца процедуры
```
Исходный модуль на ассемблере --- последовательность строк, команд, директив и комментариев.
Исходный модуль просматривается ассемблером, пока не встретится директива end. Обычно программа на ассемблере состоит из трёх сегментов: сегмент стека, сегмент данных, сегмент кода.
```nasm
; сегмент стека
sseg Segment
sseg ends
; сегмент данных
dseg segment
dseg ends
; сегмент кода
cseg segment
cseg ends
end start
```
= Назначение сегментов
```nasm
assume ss:sseg, ds:dseg, cs:cseg, es:dseg
```
_ассмблера не будет даня ебанулся_
|
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/in-dexter/0.0.6/sample-usage.typ | typst | Apache License 2.0 | #import "./in-dexter.typ": *
// This typst file demonstrates the usage of the in-dexter package.
#set text(lang: "en", font: "Arial", size: 10pt)
#set heading(numbering: "1.1")
// Index-Entry hiding : this rule makes the index entries in the document invisible.
#show figure.where(kind: "jkrb_index"): it => {}
// Front Matter
#align(center)[
#text(size: 23pt)[in-dexter]
#linebreak() #v(1em)
#text(size: 16pt)[An index package for Typst]
#linebreak() #v(.5em)
#text(size: 12pt)[Version 0.0.6 (30. September 2023)]
#linebreak() #v(.5em)
#text(size: 10pt)[<NAME>, <NAME>]
#v(4em)
]
= Sample Document to Demonstrate the in-dexter package
Using the in-dexter package in a typst document consists of some simple steps:
+ Importing the package `in-dexter`.
+ Marking the words or phrases to include in the index.
+ Generating the index page by calling the `make-index()` function.
== Importing the Package
The in-dexter package is currently available on GitHub in its home repository
(https://github.com/RolfBremer/in-dexter). It is still in development and may have
breaking changes #index[Breaking Changes] in its next iteration.
#index[Iteration]#index[Development]
```typ
#import "./in-dexter.typ": *
```
The package is also available via Typst's build-in Package Manager:
```typ
#import "@preview/in-dexter:0.0.6": *
```
Note, that the version number of the typst package has to be adapted to get the wanted
version.
== Marking of Entries
We have marked several words to be included in an index page at the end of the document.
#index[Sample] The markup for the entry stays invisible#index[Invisible]. Its location in
the text gets recorded, and later it is shown as a page reference in the index page.
#index[Index Page]
```typ
#index[The Entry Phrase]
```
=== Marker Classes
#index(class: classes.main)[Classes]
#index(class: classes.main)[Marker Classes]
The entries support a class. This class determines the
visualization for the page number of the entry. Currently, we distinguish between class
"simple" #index[Simple] and class "main" #index[Main]. The first one is the default. The
second is provided to mark the main reference for that entry -- its page number will be
printed in *bold*.
```typ
#index(class: classes.main)[The Entry Phrase]
```
In future versions of this package there may be more marker classes for additional cases.
It is recommended to use the `classes` definition of the package.
- `classes.simple`
- `classes.main`
==== More Convenience
There is also a convenience #index-main[Convenience] function, to ease the usage of main
entries. Instead of the main entry syntax used above, one can use the following:
```typ
#index-main[The Entry Phrase]
```
#pagebreak()
== The Index Page
#index(class: classes.main)[Index Page]
To actually create the index page, the `make-index()` function has to be called. Of course,
it can be embedded into an appropriately formatted #index[Formatting]
environment#index[Environment], like this:
```typ
#columns(3)[
#make-index()
]
```
= Why Having an Index in Times of Search Functionality?
#index(class: classes.main)[Searching vs. Index]
A _hand-picked_ #index[Hand Picked] or _handcrafted_ #index[Handcrafted] Index in times of
search functionality #index[Search Functionality] seems a bit old-fashioned
#index[Old-fashioned] at the first glance. But such an index allows the author to direct
the reader, who is looking for a specific topic#index[Topic], to exactly the right
places. Especially in larger documents #index[Large Documents] and books #index[Books]
this becomes very useful, since search engines #index[Search Engines] may provide
#index[Provide] too many locations of specific words. The index #index[Index] is much more
comprehensive#index[Comprehensive], assuming that the author #index[Authors
responsibility] has its content #index[Content] selected well. Authors know best where a
specific topic is explained #index[Explained] thoroughly #index[Thoroughly] (using the
`index-main` function to point there) or merely noteworthy #index[Noteworthy] mentioned
(using the `index` function). Note, that this document is not necessarily a good example
of the index. Here we just need to have as many index entries #index[Entries] as possible
to demonstrate #index-main[Demonstrate] the functionality #index[Functionality] and have a
properly #index[Properly] filled index at the end.
#line(length: 100%, stroke: .1pt + gray)
= Index
Here we generate the Index page in three columns:
#columns(3)[
#make-index()
]
|
https://github.com/nixon-voxell/nixon_resume | https://raw.githubusercontent.com/nixon-voxell/nixon_resume/main/README.md | markdown | MIT License | # Nixon's Resume
This repository is where Nixon stores his resume. This way, Nixon will be able to keep track of all his resume versions and changes.
## Credit
[**Typst**](https://github.com/typst/typst) is a new markup-based typesetting system that is designed to be as powerful as LaTeX while being much easier to learn and use.
[**FontAwesome**](https://fontawesome.com/) is the Internet's icon library and toolkit, used by millions of designers, developers, and content creators.
[**Roboto**](https://github.com/google/roboto) is the default font on Android and ChromeOS, and the recommended font for Google’s visual language, Material Design.
[**Source Sans Pro**](https://github.com/adobe-fonts/source-sans-pro) is a set of OpenType fonts that have been designed to work well in user interface (UI) environments.
|
https://github.com/rabotaem-incorporated/calculus-notes-2course | https://raw.githubusercontent.com/rabotaem-incorporated/calculus-notes-2course/master/sections/05-complex-functions/01-holomorphic-functions.typ | typst | #import "../../utils/core.typ": *
== Голоморфные функции
#def(label: "def-hfn")[
$Omega subset CC$, $f: Omega --> CC$, $z_0 in Omega$.
$f$ называется _голоморфной_ в точке $z_0$, если существует предел (конечный --- в $CC$ других нет),
$
lim_(z -> z_0) (f(z) - f(z_0)) / (z - z_0) =: f'(z_0)
$
]
#notice(label: "hfn-condition")[
$f$ --- голоморфна в точке $z_0$ тогда и только тогда, когда существует $k in CC$ такая, что
$ f(z) = f(z_0) + k (z - z_0) + o(z - z_0) $
при $z -> z_0$.
]
#props(label: "hfn-props")[
1. Сумма, разность и произведение функций голоморфных в точке $z_0$ также голоморфна в $z_0$.
2. $f$ и $g$ голоморфны в $z_0$, $g(z_0) != 0$, значит $f / g$ голоморфна в $z_0$.
3. Если $f$ голоморфна в $z_0$, а $g$ голоморфна в $f(z_0)$, то $g compose f$ голоморфна в $z_0$.
]
#proof[
Доказывается ровно так же, как и для вещественных функций.
]
#notice(plural: true, label: "def-complex-linear-mat")[
1. $f(x, y) := f(x + i y)$, $x, y in RR$, $f$ --- голоморфна#rf("def-hfn"). Тогда
$
(diff f)/(diff x) (x_0, y_0) &= lim_(h -> 0) (f(x_0 + h + i y_0) - f(x_0 + i y_0)) / h =^rf("def-hfn") f'(z_0), \
(diff f)/(diff y) (x_0, y_0) &= i lim_(h -> 0) (f(x_0 + i h + i y_0) - f(x_0 + i y_0)) / (i h) =^rf("def-hfn") i f'(z_0).
$
Значит, если $f$ голоморфна в точке $z_0$, то $(diff f)/(diff y) (z_0) = i (diff f)/(diff x) (z_0)$.
2.
$
vec(Re f(x, y), Im f(x, y)) = vec(Re f(x_0, y_0), Im f(x_0, y_0)) + mat(a, b; c, d) vec(x - x_0, y - y_0) + o(norm(vec(x - x_0, y - y_0)))
$
Какое условие на $mat(a, b; c, d)$ дает голоморфность $f$?
$
f(x + i y) =^rf("hfn-condition") f(x_0 + i y_0) + (u + i v) ((x - x_0) + i (y - y_0)) + o(...)
$
Распишем,
$
(u + i v) ((x - x_0) + i (y - y_0)) = (u (x - x_0) - v (y - y_0)) + i dot (u (y - y_0) + v (x - x_0)),
$
и, чтобы вектор соответсвовал комплексному числу, необходимо,
$
mat(a, b; c, d) vec(x - x_0, y - y_0) = vec(a(x - x_0) + b(y - y_0), c(x - x_0) + d(y - y_0)) <==> mat(a, b; c, d) = mat(u, -v; v, u).
$
Назовем матрицы такого вида _комплексно-линейными_.
3. Линейное отображение $CC --> CC$: $z maps lambda z = abs(lambda) e^(i phi) z$ --- композиция растяжения и поворота. Такое отображение называется _поворотной гомотетией_.
]
#denote(label: "def-complex-diff")[
Заведем две дифференциальные формы#rf("def-differential-form"):
$dif z = dif x + i dif y$, $dif cj(z) = dif x - i dif y$.
Хотим
$ dif f = (diff f)/(diff x) dif x + (diff f)/(diff y) dif y = (diff f)/(diff z) dif z + (diff f)/(diff cj(z)) dif cj(z). $
Чтобы такое равенство выполнялось, необходимо и достаточно, чтобы
$
(diff f)/(diff z) dif x + i (diff f)/(diff z) dif y + (diff f)/(diff cj(z)) dif x - i (diff f)/(diff cj(z)) dif y = (diff f)/(diff x) dif x + (diff f)/(diff y) dif y <==> \
<==> (diff f)/(diff z) := 1/2 ((diff f)/(diff x) - i (diff f)/(diff y)) #h(1cm) and #h(1cm) (diff f)/(diff cj(z)) := 1/2 ((diff f)/(diff x) + i (diff f)/(diff y))
$
Положим это определением $(diff f)/(diff z)$ и $(diff f)/(diff cj(z))$.
]
#th(name: "условие Коши-Римана", label: "cauchy-reimann-condition")[
Пусть $f: Omega --> CC$. $z_0 in Omega subset CC$. $f$ дифференциируема в $z_0$ как функция из $RR^2$ в $RR^2$. Тогда следующие условия равносильны:
1. $f$ голоморфна в $z_0$.
2. $dif_(z_0) f$ комплексно линеен.
3. $(diff f)/(diff cj(z))(z_0) = 0$.
4. Выполняется условие Коши-Римана: $ cases((diff Re f)/(diff x) (z_0) = (diff Im f)/(diff y) (z_0), (diff Im f)/(diff x) (z_0) = - (diff Re f)/(diff y) (z_0)) $
]
#proof[
- "$1 <=> 2$": очевидно#rf("def-complex-linear-mat").
- "$2 <=> 4$": матрица $dif_(z_0) f$#rf("def-complex-linear-mat"):
$
mat((diff Re f)/(diff x), (diff Re f)/(diff y); (diff Im f)/(diff x), (diff Im f)/(diff y)),
$
а она комплексно линейна тогда и только тогда, когда выполняется условие Коши-Римана.
- "$3 <=> 4$":
$
(diff f)/(diff cj(z)) =^rf("def-complex-diff")
1/2 ((diff f)/(diff x) + i (diff f)/(diff y)) = 0 <=>
(diff Re f)/(diff x) + i (diff Im f)/(diff x) = (diff f)/(diff x) = - i (diff f)/(diff y) = -i ((diff Re f)/(diff y) + i (diff Im f)/(diff y)). $
]
#denote[
$f in H(Omega)$ значит, что $f: Omega --> CC$ голоморфна во всех точках.
]
#follow(label: "hfn-real-const-const")[
Если $f in H(Omega)$, и $Re f = const$, то $f = const$.
]
#proof[
$
cases(
(diff Im f)/(diff x) =^rf("cauchy-reimann-condition") -(diff Re f)/(diff y) = 0,
(diff Im f)/(diff y) =^rf("cauchy-reimann-condition") (diff Re f)/(diff x) = 0
) ==> Im f = const.
$
]
#th(name: "Коши", label: "hfn-locally-exact")[
Если $f in H(Omega)$, то $f(z) dif z$ --- локально точная#rf("def-closed-exact-form").
]
#proof[
*Первое докальательство*, для случая, когда $(diff f)/(diff x)$ и $(diff f)/(diff y)$ непрерывны. Знаем, что замкнутость и непрерывность частной производной влечет локальную точность#rf("closed-is-locally-exact"). Проверим замкнутость.
$ f(z) dif z = f(z) dif x + i f(z) dif y. $
Надо проверить, что $(diff f)/(diff y) = (diff (i f))/(diff x) = i (diff f)/(diff x)$. Это верно из $(diff f)/(diff cj(z)) = 0$#rf("cauchy-reimann-condition").
Но мы хотим проверить это в общем случае: оказывается, что непрерывность есть всегда автоматически. Поэтому не будем добавлять это в формулировку, и докажем в общем случае.
#figure(cetz.canvas({
import cetz.draw: *
catmull(
(0, 0), (5, 0), (7, 5), (0, 4),
close: true, fill: rgb(20, 100, 255, 10%)
)
content((4, 4), text(blue, size: 3em, $Omega$))
circle((2, 2), radius: 2, fill: rgb(20, 100, 255, 10%), stroke: blue)
content((4, 0.5), text(blue, size: 2em, $U$))
let (x1, x3) = (0.8, 3.3)
let x2 = (x1 + x3) / 2
rect((0.8, 1.3), (3.3, 3.1), name: "P")
content((to: "P.top", rel: (0.5, 0.2)), $P$)
let (y1, y3) = (1.3, 3.1)
let y2 = (y1 + y3) / 2
line((x1, y2), (x3, y2), stroke: (dash: "dashed"))
line((x2, y1), (x2, y3), stroke: (dash: "dashed"))
content((to: "P", rel: (0.5, 0.4)), $P'$)
content((to: "P", rel: (0.5, -0.4)), $P''$)
content((to: "P", rel: (-0.5, 0.4)), $P'''$)
content((to: "P", rel: (-0.5, -0.4)), $P''''$)
}))
*Второе доказальство*, без ограничений на $f$. Возьмем круг $U subset Omega$. Надо доказать, что $integral_P omega = 0$ для любого прямоугольника $P$ из $U$. От противного. Пусть нашелся такой $P$, где $integral_P omega != 0$. Назовем этот интеграл $alpha(P)$. Разрежем его на 4 равные части, как на картинке. Тогда $ alpha(P) = alpha(P') + alpha(P'') + alpha(P''') + alpha(P''''), $ значит $ abs(alpha(P)) <= abs(alpha(P')) + abs(alpha(P'')) + abs(alpha(P''')) + abs(alpha(P'''')). $ Пусть $P_1$ такой из $P'$, $P''$, $P'''$, $P''''$, что $alpha(P_1) >= 1/4 abs(alpha(P))$. Аналогично построим последовательность прямоугольников $P supset P_1 supset P_2 supset ...$, $alpha(P_n) >= 1/(4^n) abs(alpha(P))$. Тогда по теореме о вложенных отрезках, найдется $z_0$ лежащая во всех прямоугольниках. $f$ --- голоморфна в $z_0$,
$ f(z) = f(z_0) + f'(z_0) (z - z_0) + abs(z - z_0) dot beta(z - z_0), $
где $lim_(z->z_0) beta(z - z_0) = 0$. Тогда
$ abs(alpha(P_n)) = abs(integral_(P_n) f(z) dif z) = abs(integral_(P_n) f(z_0) dif z + integral_(P_n) f'(z_0) (z - z_0) dif z + integral_(P_n) abs(z - z_0) beta(z - z_0) dif z). $
Первый интеграл --- интеграл константы по замкнутому контуру, то есть $0$, второй тоже 0, если сослаться на первое доказательство. Значит,
$
4^n abs(alpha(P_n)) =
4^n abs(integral_(P_n) abs(z - z_0) beta(z - z_0) dif z) <=^rf("curve-integral-2-props", "norm-bound")
4^n "периметр" P_n dot max abs(z - z_0) beta(z - z_0) <= \ <= 4^n "периметр"^2 P_n dot max_(z in P_n) abs(beta(z - z_0)) = "периметр"^2 P dot max_(z in P_n) abs(beta(z - z_0)) --> 0.
$
Противоречие.
]
#follow(plural: true)[
1. Если $f in H(Omega)$ и $gamma$ --- стягиваемый#rf("def-contracting-path") в $Omega$ замкнутый путь, то $integral_gamma f(z) dif z = 0$.
2. Если $f in H(Omega)$, $z_0 in Omega$, то у $z_0$ есть окрестность $U_(z_0)$ и функция $F in H(Omega)$ такая, что $F' = f$ в $U_(z_0)$.
]
#proof[
1. Очевидно#rf("contracting-path-integral-zero").
2. $f(z) dif z$ локально точная, значит существует#rf("def-closed-exact-form") $U_(z_0)$ и $F: U_(z_0) --> CC$ --- первообразная формы#rf("def-form-antiderivative") $f(z) dif z$. Тогда
$
f(z) dif z = f(z) dif x + i f(z) dif y ==> (diff F)/(diff x) = f and (diff F)/(diff y) = i f.
$
То есть $(diff F)/(diff x) = i (diff F)/(diff y)$, значит#rf("cauchy-reimann-condition") первообразная голоморфна в окрестности, и $F' = (diff F)/(diff x) = f$.
]
#notice(label: "form-antiderivative-hfn-antiderivative")[
Первообразная формы, и первообразная функции в данном случае --- одно и то же, то есть $F$ --- первообразная формы $f(z) dif z$ тогда и только тогда, когда $F' = f$.
]
#th(name: "модификация теоремы Коши", label: "hfn-locally-exact+")[
Пусть $Delta$ --- прямая, паралелльная какой-то оси координат. $f in C(Omega)$ и $f in H(Omega without Delta)$. Форма $f(z) dif z$ все равно локально точная в $Omega$.
]
#proof[
Проверим, что у каждой точки из $Omega$ есть окрестность, такая, что $integral_P f(z) dif z = 0$ для любого прямоугольника $P$ со сторонами параллельными осям, и прямоугольника из этой окрестности.
Если точка не лежит в $Delta$, то проведем рассуждения также, как в доказательстве теореме Коши. Интересен только случай, когда точка лежит на $Delta$.
Если $P$ не пересекает $Delta$, то все как в предыдущей теореме. Иначе, разрежем прямоугольник по $Delta$, как на картинке. Остался случай, когда одна из сторон прямоугольника лежит в $Delta$.
#figure(grid(
columns: 2,
cetz.canvas(length: 0.8cm, {
import cetz.draw: *
catmull(
(0, 0), (5, 0), (7, 5), (0, 4),
close: true, fill: rgb(20, 100, 255, 10%)
)
content((4, 4), text(blue, size: 3em, $Omega$))
circle((2, 2), radius: 2, fill: rgb(20, 100, 255, 10%), stroke: blue)
line((-1, 2), (8, 2), name: "delta")
content((to: "delta.right", rel: (0.0, 0.3)), $Delta$)
set-style(mark: (fill: red), stroke: red)
place-marks(
merge-path({
line((1.3, 2.0), (1.3, 3.1))
line((1.3, 3.1), (3.3, 3.1))
line((3.3, 3.1), (3.3, 2.0))
line((3.3, 2.0), (1.3, 2.0))
}, close: true),
..for i in range(10) {
((mark: "<", pos: i / 10 + 0.05),)
}
)
set-style(mark: (fill: orange), stroke: orange)
place-marks(
merge-path({
line((1.3, 4 - 2.0), (1.3, 4 - 3.3))
line((1.3, 4 - 3.3), (3.3, 4 - 3.3))
line((3.3, 4 - 3.3), (3.3, 4 - 2.0))
line((3.3, 4 - 2.0), (1.3, 4 - 2.0))
}, close: true),
..for i in range(10) {
((mark: ">", pos: i / 10 + 0.05),)
}
)
}),
cetz.canvas(length: 0.8cm, {
import cetz.draw: *
line((-1, 0), (8, 0), name: "delta")
content((to: "delta.right", rel: (0.0, 0.3)), $Delta$)
set-style(mark: (fill: red), stroke: red)
place-marks(
merge-path({
line((1, 0), (7, 0))
line((7, 0), (7, 5))
line((7, 5), (1, 5))
line((1, 5), (1, 0))
}, close: true),
..for i in range(20) {
((mark: "<", pos: i / 20 + 0.02),)
}
)
set-style(mark: (fill: black))
place-marks(
line((1, 1), (7, 1), stroke: (dash: "dashed", paint: black)),
..for i in range(7) {
((mark: "<", pos: i / 7 + 0.02),)
}
)
line((2, 0), (2, 1), mark: (start: ">", end: ">"), stroke:black)
content((2.3, 0.5), $eps$)
rect(stroke: none, (1, 1), (7, 5), fill: rgb(200, 0, 0, 10%), name: "P1")
content("P1", text(red, size: 2em, $P_eps$))
content((1, -0.3), $a$)
content((7, -0.3), $b$)
}),
))
Отойдем от $Delta$ на $eps$, "отодвинув" сторону $P$ от нее. Получится прямоугольник $P_eps$. Мы знаем, что $integral_(P_eps) f(z) dif z = 0$. На сколько будут отличаться интегралы?
$
integral_P f(z) dif z - integral_(P_eps) f(z) dif z = integral_[b, b + i eps] f(z) dif z + integral_[a + i eps, a] f(z) dif z + integral_[a, b] (f(z) - f(z + i eps)) dif z ==> \
abs(integral_P f(z) dif z - integral_(P_eps) f(z) dif z) <= abs(integral_[b, b + i eps] f(z) dif z) + abs(integral_[a + i eps, a] f(z) dif z) + abs(integral_[a, b] (f(z) - f(z + i eps)) dif z)
$
Так как $f in C(Omega)$, существует $M$ такая, что $abs(f(z)) <= M$ для любого $z$ в прямоугольнике $P$ (на компакте).
Тогда
$
abs(integral_[b, b + i eps] f(z) dif z) <= M eps,
abs(integral_[a, a + i eps] f(z) dif z) <= M eps,
\
abs(integral_[a, b] (f(z) - f(z + i eps)) dif z) <=^rf("curve-integral-2-props", "norm-bound") (b - a) max_(z in [a, b]) abs(f(z) - f(z + i eps))
$
Что делать с последней штукой? $f$ --- равномерно непрерывна как непрерывная на компакте, значит $ forall delta space exists eps > 0 space abs(omega - omega') <= eps ==> abs(f(omega) - f(omega')) < delta $
Значит, можно сделать сколь угодно маленькую $delta$, и
$
abs(integral_[a, b] (f(z) - f(z + i eps)) dif z) <= (b - a) max_(z in [a, b]) abs(f(z) - f(z + i eps)) < delta (b - a).
$
]
#follow(label: "hfn-locally-exact++")[
$f in C(Omega)$ и $f$ голоморфна в $Omega$ за исключением конечного количества точек. Тогда $f(z) dif z$ локально точная в $Omega$.
]
#proof[
Если в $z_0$ есть голоморфность, то есть окрестность, в которой есть голоморфность, и можно просто сослаться на теорему Коши#rf("hfn-locally-exact"). Если в $z_0$ нет голоморфности, то возьмем маленький кружочек, который не задевает остальные точки, и удаляем из него прямую, содержащую точку. По модифицированной теореме#rf("hfn-locally-exact+"), получили локальную точность.
]
#def(label: "def-curve-index")[
Пусть $gamma$ --- замкнутая кривая, не проходящая через $0$ (начало координат#footnote[для димы написал]). Пусть $r(t)$ и $phi(t)$ --- ее параметризация в полярных координатах. Пусть $r, phi: [a, b] --> RR$, и $r > 0$.
_Индекс кривой (пути) относительно точки_ $ Ind(gamma, 0) := (phi(b) - phi(a)) / (2 pi). $
Это целое число --- количество оборотов прямой около нуля, против часовой стрелки.
#figure(
image("../../images/curve-index.svg", width: 10cm),
caption: [Если я умею считать индекс этой кривой --- 0.]
)
Индекс в точках, отличных от нуля, определяется аналогично.
]
#notice[
Индекс можно посчитать, рассмотрев какой-нибудь луч из точки, и посчитав, сколько раз этот луч пересекается с прямой, и в каких направлениях. Если луч $n$ раз пересекает прямую, идущую против часовой стрелки, и $m$ раз --- по часовой стрелке, то индекс прямой равен $n - m$.
#figure(
image("../../images/index-through-intersection.svg", width: 10cm),
caption: [Вроде и правда умею.]
)
Доказательство трудное, нужно возиться, мы не будем.
]
#th(label: "index-through-integral")[
$gamma$ --- замкнутая кривая, не проходящая через $0$. Тогда $ integral_gamma (dif z)/z = 2 pi i dot Ind(gamma, 0)^rf("def-curve-index"). $
]
#proof[
Берем параметризацию $gamma$ в полярных координатах, $z(t) = r(t) e^(i phi(t))$. Распишем дифференциал через параметризацию: $ dif z = (r'(t) e^(i phi(t)) + r(t) i phi' e^(i phi(t))) dif t, $
и интегрируем по ней:
$
integral_gamma (dif z)/z =
integral_a^b (r'(t) e^(i phi(t)) + r(t) i phi'(t) e^(i phi(t)))/(r(t) e^(i phi(t))) dif t newline(=)
integral_a^b ((r'(t))/(r(t)) + i phi'(t)) dif t =
underbrace(ln r(b) - ln r(a), 0) + i (phi(b) - phi(a)) =
2 pi i dot Ind(gamma, 0).
$
$r(b) = r(a)$, так как кривая замкнутая. Индекс возникает по определению#rf("def-curve-index").
]
#th(name: "Интегральная формула Коши", label: "cauchy-integral")[
$f in H(Omega)$, $a in Omega$, $gamma$ --- стягиваемый в $Omega$ путь#rf("def-contracting-path"), $gamma$ не проходит через $a$. Тогда $ integral_gamma (f(z))/(z - a) dif z = 2pi i f(a) Ind(gamma, a) $
]
#proof[
$ g(z) := cases(
(f(z) - f(a))/(z - a) "при" z != a,
f'(a) "при" z = a
) $
Такая $g in C(Omega)$ и $g in H(Omega without {a})$. По следствию из теоремы выше про локальную точность голоморфной функции без конечного числа точек#rf("hfn-locally-exact++"), $g$ --- локально точная, и $integral_gamma g(z) dif z = 0$#rf("contracting-path-integral-zero").
Тогда
$
0 =^rf("contracting-path-integral-zero")
integral_gamma g(z) dif z =
integral_gamma (f(z))/(z -a) dif z - integral_gamma f(a)/(z - a) dif z newline(=)
integral_gamma (f(z))/(z -a) dif z - f(a) integral_gamma (dif z)/(z - a) =^rf("index-through-integral")
integral_gamma (f(z))/(z -a) dif z - 2pi i f(a) Ind(gamma, a).
$
]
#th(label: "hfn-analytical")[
$f$ --- голоморфна в круге ${abs(z) < R}$. Тогда $f$ --- аналитична в этом круге.
]
#proof[
Рассмотрим $abs(z) < r_1 < r < R$. По интегральной формуле Коши#rf("cauchy-integral") для $gamma$ --- окружность радиуса $r$,
$
f(z) = 1/(2 pi i) integral_({abs(zeta) = r}) (f(zeta))/(zeta - z) dif zeta.
$
Разложим $1/(zeta - z)$ в ряд:
$
1 / (zeta - z) = 1/(zeta) dot 1/(1 - z / zeta) = 1/zeta sum_(n = 0)^oo (z^n)/(zeta^n) = sum_(n = 0)^oo (z^n)/(zeta^(n + 1)).
$
Так можно делать, так как $abs(z / zeta) < r_1 / r < 1$.
Значит,
$
f(z) = 1/(2 pi i) integral_({abs(zeta) = r}) sum_(n = 0)^oo f(zeta)/(zeta^(n + 1)) dot z^n dif zeta.
$
Поменяем местами интеграл и сумму:
$
f(z) = 1/(2 pi i) integral_({abs(zeta) = r}) sum_(n = 0)^oo f(zeta)/(zeta^(n + 1)) dot z^n dif zeta = sum_(n = 0)^oo z^n dot underbrace(1/(2 pi i) integral_({abs(zeta) = r}) f(zeta)/(zeta^(n + 1)) dif zeta, =: a_n) = sum_(n = 0)^oo a_n z^n.
$
Почему так можно делать? Промажорируем,
$
(f(zeta) z^n) / zeta^(n + 1) <= M/r dot ((r_1)/r)^n.
$
Значит, есть равномерная сходимость.
]
#follow(plural: true, label: "hfn-analytical-props")[
1. #sublabel("coeff-formula") Есть формула для коэффициентов:
$
a_n = 1/(2 pi i) integral_({abs(zeta) = r}) f(zeta)/(zeta^(n + 1)) dif zeta.
$
2. #sublabel("hfn-analytical") $f: Omega --> CC$. $f in H(Omega) <==> f "аналитична в" Omega$.
3. #sublabel("hfn-infinitely-differentiable") $f in H(Omega) ==> f "бесконечно дифференцируема"$.
4. #sublabel("derivative-hfn") $f in H(Omega) ==> f' in H(Omega)$.
]
#proof[
1. Достается из доказательства.
2. "$==>$": берем $B_R (a) in Omega$, по теореме $f(z)$ раксладывается в ряд в этом круге.
3. Следует из аналитичности.
4. Аналитичность + 2)
]
#def(label: "def-harmonic")[
$f: Omega --> RR$, $Omega subset RR^n$. $f$ --- гармоническая, если
$
(diff^2 f)/(diff x_1^2) + (diff^2 f)/(diff x_2^2) + ... + (diff^2 f)/(diff x_n^2) = 0.
$
Если $Omega subset CC$, то $
(diff^2 f)/(diff x^2) + (diff^2 f)/(diff y^2) = 0.
$
]
#follow(name: "продолжение", plural: true, label: "hfn-re-im-harmonic")[
5. $f in H(Omega)$, значит $Re f$ и $Im f$ --- гармонические.
]
#proof[
5. $ (diff^2 Re f)/(diff x^2) = (diff)/(diff x) ((diff Re f)/(diff x)) = (diff)/(diff x) ((diff Im f)/(diff y)) = (diff)/(diff y) ((diff Im f)/(diff x)) = (diff)/(diff y) (-(diff Re f)/(diff y)) = -(diff^2 Re f)/(diff y^2). $
]
#notice[
На односзвяной области $Omega$, если $P$ --- гармоническая#rf("def-harmonic"), то $exists Q$ --- гармоническая#rf("def-harmonic"), такая, что $P + i Q$ --- голоморфная, и $Q$ --- единственная с точностью до прибавления константы.
]
#proof[
Мы хотим, чтобы выполнялось условие Коши-Римана для $P + i Q$#rf("cauchy-reimann-condition"):
$
cases(
(diff P)/(diff x) = (diff Q)/(diff y),
(diff P)/(diff y) = -(diff Q)/(diff x),
).
$
Рассмотрим следующую дифференициальную форму:
$
-(diff P)/(diff y) dif x + (diff P)/(diff x) dif y.
$
Она замкнута, так как
$
diff/(diff y) (-(diff P)/(diff y)) = -(diff^2 P)/(diff y^2) = (diff^2 P)/(diff x^2) = diff/(diff x) ((diff P)/(diff x)).
$
По лемме Пуанкаре#rf("poincare"), из замкнутости следует локальная точность, а по теореме о локально точной форме на односвязной области#rf("locally-exact-is-exact-in-simply-connected"), она точная.
Значит у нее есть первооборазная, назовем ее $Q$. По построению, $P + i Q$ --- голоморфна. Наконец, $Q$ гармонична#rf("def-harmonic"), так как
$
(diff^2 Q)/(diff x^2) + (diff^2 Q)/(diff y^2) =
diff/(diff x) (diff Q)/(diff x) + diff/(diff y) (diff Q)/(diff y) = -diff/(diff x) (diff P)/(diff y) + diff/(diff y) (diff P)/(diff x) = -(diff^2 P)/(diff x diff y) + (diff^2 P)/(diff y diff x) =^rf("def-harmonic") 0.
$
]
#th(name: "Морера", label: "morera")[
$f(z) in C(Omega), space f(z) dif z$ локально точная. Тогда $f in H(Omega)$.
]
#proof[
$f(z) dif z$ --- локально точная, значит, у нее локально есть первообразная у каждой точки. Если есть первообразная у формы, то это значит, что выполняются условия Коши-Римана, а тогда из непрерывности $f = F'$ следует #rf("cauchy-reimann-condition") голоморфность $F$, а из нее, в совою очередь #rf("hfn-analytical-props", "derivative-hfn"), голоморфность $f$.
]
#follow(label: "hfn-without-line-hfn")[
$f in C(Omega)$ и $f$ голоморфна в $Omega without Delta$ (где $Delta$ --- прямая, паралелльная оси), или в $Omega$ за исключением конечного числа точек. Тогда $f in H(Omega)$.
]
#proof[
Условие говорит о том, что $f(z) dif z$ локально точна#rf("hfn-locally-exact+")#rf("hfn-locally-exact++"), и можно применить теорему Морера#rf("morera").
]
#th(label: "hfn-conditions")[
Собираем все вместе.
$f: Omega --> CC$. Следующие условия равносильны:
1. $f in H(Omega)$.
2. $f$ аналитична в $Omega$.
3. $f$ бесконечно дифференцируема в $Omega$.
4. $f$ локально имеет первообразную.
5. Форма $f(z) dif z$ локально точная.
6. Форма $f(z) dif z$ замкнута, и частные производные $f$ непрерывны, $f in C(Omega)$.
7. Интеграл по любому достаточно малому прямоугольнику (у любой точки есть окрестность, в которой все прямоугольники такие), со сторонами паралелльными осям, равен $0$, $f in C(Omega)$.
]
#proof[
- "$1 ==> 5$": теорема Коши#rf("hfn-locally-exact").
- "$5 ==> 1$": теорема Морера#rf("morera").
- "$1 ==> 2$": теорема про аналитичность#rf("hfn-analytical").
- "$2 ==> 3$": очевидно.
- "$3 ==> 1$": очевидно.
- "$4 <==> 5$": первообразная формы $f(z) dif z$ и функции $f$ --- одно и то же#rf("form-antiderivative-hfn-antiderivative").
- "$6 ==> 7$": формула Грина#rf("green") + свойство Коши-Римана под интегралом#rf("cauchy-reimann-condition").
- "$7 ==> 5$": критерий точности#rf("closed-curve-integral-2").
- "$5 + 3 ==> 6$": коэффициенты формы непрерывны#rf("locally-exact-closed").
]
#th(name: "<NAME>", label: "cauchy-inequality")[
$f$ --- голоморфна в круге ${abs(z) < R}$, $f(z) = sum_(n = 0)^oo a_n z^n$. Тогда
$
abs(a_n) <= M_r / r^n, "где" 0 < r < R " и " M_r := max_(abs(z) = r) abs(f(z)).
$
]
#proof[
$
abs(a_n) =^rf("hfn-analytical-props", "coeff-formula")
abs(1 / (2pi i) integral_(abs(z) = r) f(z)/(z^(n + 1)) dif z) <=
1/cancel(2 pi) dot max_(abs(z) = r) abs(f(z)/(z^(n + 1))) dot cancel(2 pi) r =
(r dot max_(abs(z) = r) abs(f(z))) / r^(n + 1) = M_r / r^n.
$
]
#def(label: "whole-fn")[
$f$ --- _целая_ функция, если $f in H(CC)$. Это всегда степенные ряды, у которых радиус сходимости равен бесконечности.
]
#examples[
$exp$, $sin$, $cos$, $CC[x]$, ...
]
#th(name: "Лиувилля", label: "liouville")[
Если $f in H(CC)$ и ограниченная, то $f = const$.
]
#proof[
$f(z) = sum_(n = 0)^oo a_n z^n$. Пусть $abs(f(z)) <= M$ для любого $z in CC$. Тогда $ abs(a_n) <=^rf("cauchy-inequality") M_r/r^n <= M/r^n -->_(r -> +oo) 0 ==> a_n = 0. $
]
#th(name: "Основная теорема алгебры", label: "fundamental-theorem-of-algebra")[
Любой многочлен $P$ степени $deg P >= 1$ имеет корень в $CC$.
]
#proof[
Предположим противное. Пусть $P(z) != 0$ для любого $z in CC$. Тогда $f(z) := 1/P(z) in H(CC)$. Если мы проверим, что она ограничена, мы получим противоречие, так как тогда $f$ --- константа.
Запишем многочлен в приведенном виде: $P(z) = z^n + a_(n - 1) z^(n - 1) + ... + a_1 z + a_0$. Пусть $R := 1 + abs(a_(n - 1)) + ... + abs(a_1) + abs(a_0)$. $f$ непрерывна в ${abs(z) <= R}$, значит $f$ --- ограничена в этом круге. Проверим, что $f$ ограничена в ${abs(z) >= R}$. Оценим снизу $P$:
$
abs(P(z)) = abs(sum_(k = 0)^n a_k z^k) >= abs(z^n) - sum_(k = 0)^(n - 1) abs(a_k) dot abs(z)^k.
$
Так как $R >= 1$, то $abs(z) >= 1$, поэтому
$
abs(P(z)) >= abs(z^n) - sum_(k = 0)^(n - 1) abs(a_k) dot abs(z)^k >= abs(z)^n - abs(z)^(n - 1) dot underbrace(sum_(k = 0)^(n - 1) abs(a_k), R - 1) = underbrace(abs(z)^(n - 1), >= 1) dot underbrace((abs(z) - (R - 1)), >= 1) >= 1.
$
По теореме Лиувилля#rf("liouville"), $f equiv const$, значит $P equiv const$. Противоречие.
]
#follow[
Если $P$ --- многочлен степени $n$, то $P(z) = c dot (z - z_1) dot (z - z_2) dot ... dot (z - z_n)$.
]
|
|
https://github.com/ayoubelmhamdi/typst-phd-AI-Medical | https://raw.githubusercontent.com/ayoubelmhamdi/typst-phd-AI-Medical/master/chapters/ch01-ana.typ | typst | MIT License | #import "../functions.typ": heading_center, images, italic
#let finchapiter = text(fill:rgb("#1E045B"),[■])
= ANATOMIE DES NODULES PULMONAIRES.
== Introduction.
=== Definition.
Les nodules pulmonaires, de petites masses arrondies formées dans les poumons, apparaissent lors des examens d'imagerie. Leurs caractéristiques déterminent le traitement : nature (bénin ou malin), taille, croissance, et symptômes éventuels. Pour les évaluer, on utilise souvent la surveillance régulière et la biopsie.
#images(
filename:"images/nod2.png",
caption:[
Nodule pulmonaire.
],
width: 40%,
//height: 14%
// ref:
)
//#linebreak()
=== Types de nodules pulmonaire.
Les nodules pulmonaires, petites masses arrondies apparues dans les poumons, sont détectés par des examens d'imagerie. Leur traitement dépend de leur nature, taille, croissance et symptômes éventuels. Dans l'évaluation de ces nodules, la surveillance régulière et la biopsie jouent un rôle clé.
Plusieurs types de nodules pulmonaires existent#footnote[https://www.ocean-imagerie.fr/fiche-conseil/nodule-pulmonaire/] : les infectieux, granulomateux, calcifiés et carcinoïdes sont les plus courants. Les nodules infectieux résultent d'infections pulmonaires, comme la tuberculose, la pneumonie ou les infections fongiques, avec des caractéristiques variant selon l'agent pathogène. Les nodules granulomateux se distinguent par une inflammation granulomateuse, souvent liée à des infections spécifiques comme la tuberculose ou la sarcoïdose. Les nodules calcifiés, qui résultent d'infections antérieures ou d'autres processus inflammatoires, contiennent des dépôts de calcification. Les carcinoïdes se développent à partir de cellules neuroendocrines dans les poumons et peuvent être bénins ou malins.
A noter qu'un diagnostic précis des nodules pulmonaires nécessite un examen médical détaillé, incluant des examens d'imagerie, des analyses de sang, et parfois une biopsie pour déterminer la nature du nodule.
En résumé, la classification des nodules pulmonaires se fait selon leurs causes et caractéristiques. Un examen médical détaillé est souvent nécessaire pour un diagnostic précis.
=== Causes des nodule pulmonaire.
Les nodules pulmonaires peuvent naître de diverses causes#footnote("https://cancer.ca/fr/cancer-information/cancer-types/lung/what-is-lung-cancer/lung-nodules"). Certaines, comme les infections pulmonaires, les maladies inflammatoires, les réactions à des substances inhalées et les tumeurs bénignes, sont plus courantes. Les nodules malins peuvent découler de tumeurs malignes, y compris le cancer du poumon ou des cancers métastatiques. Des examens détaillés sont nécessaires pour diagnostiquer précisément les nodules pulmonaires. Ils permettent de déterminer l'origine exacte des nodules et d'orienter le traitement adéquat.
=== Importance de l'etudes des nodules pulmonaire.
L'étude des nodules pulmonaires est importante pour plusieurs raisons :
- *Détection précoce du cancer du poumon:* Les nodules pulmonaires peuvent être un signe précoce de cancer du poumon. Le cancer du poumon étant souvent asymptomatique dans ses premiers stades, la détection précoce des nodules pulmonaires peut permettre un diagnostic précoce du cancer et améliorer les chances de réussite du traitement.
- *Différencier les nodules bénins des nodules malins:* Tous les nodules pulmonaires ne sont pas cancéreux. Une étude approfondie des nodules nous permet de différencier les nodules bénins des nodules malins. Cette distinction est essentielle pour éviter toute intervention ou traitement inutile chez les patients présentant des nodules bénins, tout en assurant une prise en charge rapide des nodules malins.
- *Surveillance et évaluation des changements:* Les nodules pulmonaires peuvent changer de taille, de forme ou de caractéristiques au fil du temps. L'étude régulière des nodules nous permet de surveiller ces changements et de déterminer si d'autres mesures sont nécessaires, telles qu'une biopsie ou une intervention chirurgicale.
- *Évaluation du pronostic:* L'étude des nodules pulmonaires peut fournir des informations sur le pronostic d'un patient atteint d'un cancer du poumon. Par exemple, la taille, la localisation et les caractéristiques du nodule peuvent aider à prédire le stade de la maladie et à orienter les options thérapeutiques.
- *Planification du traitement:* Les résultats de l'étude des nodules pulmonaires aident les professionnels de santé à élaborer un plan de traitement approprié. Celui-ci peut inclure des options telles que la surveillance régulière, la chirurgie, la radiothérapie, la chimiothérapie ou l'immunothérapie, en fonction de la nature des nodules et de leur éventuelle malignité.
En résumé, l'étude des nodules pulmonaires est d'une grande importance
pour la détection précoce, la différenciation des nodules bénins et
malins, la surveillance des changements, l'évaluation du pronostic et
la planification du traitement. Une approche précise et complète de
l'étude des nodules pulmonaires permet une prise en charge optimale des
patients et de meilleurs résultats cliniques.
=== Traitement des nodules pulmonaire.
Le traitement des nodules pulmonaires dépend d'un certain nombre de
facteurs, notamment de la nature des nodules (bénins ou malins), de leur
taille, de leur croissance, de leurs caractéristiques et de la présence
ou non de symptômes. Voici quelques options thérapeutiques possibles :
- *Surveillance régulière* : Les petits nodules pulmonaires bénins qui ne présentent aucun signe de malignité peuvent être surveillés régulièrement par des examens d'imagerie, tels que des radiographies ou des tomodensitométries du thorax, afin de suivre leur évolution. Si le nodule reste stable dans le temps, aucun autre traitement n'est généralement nécessaire.
- *Biopsie* : Dans certains cas, une biopsie peut être pratiquée pour déterminer la nature du nodule et exclure la présence d'un cancer. La biopsie peut être réalisée par différentes méthodes, telles que la biopsie percutanée sous guidage radiologique, la bronchoscopie ou la biopsie chirurgicale. La biopsie fournit un échantillon de tissu pour une évaluation pathologique plus approfondie.
- *Traitement médical* : Si les nodules pulmonaires sont causés par une infection ou une inflammation spécifique, un traitement médical approprié peut être prescrit. Il peut s'agir d'antibiotiques pour les infections bactériennes, d'antifongiques pour les infections fongiques, de corticostéroïdes pour l'inflammation, etc.
- *Chirurgie* : Si le nodule pulmonaire est suspecté d'être malin ou s'il présente des caractéristiques inquiétantes, une intervention chirurgicale peut être recommandée. La chirurgie peut consister en une ablation complète du nodule (lobectomie, pneumonectomie) ou en une résection partielle (segmentectomie, résection cunéiforme). L'intervention chirurgicale peut être réalisée à ciel ouvert ou avec une assistance vidéo.
- *Radiothérapie* : La radiothérapie peut être utilisée pour traiter les nodules pulmonaires malins lorsque la chirurgie n'est pas possible ou appropriée. Elle utilise des radiations de haute énergie pour détruire les cellules cancéreuses. La radiothérapie peut être administrée par voie externe ou interne (curiethérapie).
- *Chimiothérapie et immunothérapie* : Pour les nodules pulmonaires malins avancés ou métastatiques, des traitements systémiques tels que la chimiothérapie ou l'immunothérapie peuvent être utilisés pour cibler et détruire les cellules cancéreuses.
Le choix du traitement dépend de la nature spécifique du nodule
pulmonaire, du stade de la maladie, de l'état de santé général du
patient et de ses préférences personnelles. Il est essentiel de
consulter un professionnel de la santé pour obtenir une évaluation
précise et des recommandations appropriées concernant le traitement des
nodules pulmonaires.
== Antomie internes et externes du poumant.
L'anatomie pulmonaire est l'étude de la structure des poumons. Les
poumons sont des organes intrathoraciques qui permettent l'échange des
gaz vitaux, notamment l'oxygène et le dioxyde de carbone. L'oxygène est
nécessaire au métabolisme de l'organisme, et le dioxyde de carbone doit
être évacué. L'appareil respiratoire humain est l'ensemble des organes
de l'organisme qui permet d'acheminer le dioxygène (O2) de l'extérieur
(air ou eau) vers les cellules et d'éliminer le dioxyde de carbone (CO2)
produit durant la respiration cellulaire
On distingue trois régions dans le thorax :
- le médiastin: occupé par le cœur, les vaisseaux, trachée, œsophage voies lymphatiques... supérieure et a l'arc aortique
- les deux cavités pleuropulmonaires occupées par les poumons. Les deux poumons sont séparés par le médiastin. Le sommet du poumon dépasse légèrement au-dessus de la clavicule : le dôme du poumon se situe au niveau sus-claviculaire.
=== Morphplogie externe.
1. *forme:* les poumons ont la forme d'un demi-cône irrégulier, mesure 20 cm de haut, 20 cm d'épaisseur et 10 cm de diamètre transversal.
1. *coloration:* rosée et brillant chez le sujet jeune, et tacheté de dépôts pigmentaires chez le sujet âgé. Cela est vrai chez le non-fumeur ; en effet, chez le fumeur, le phénomène d'anthracose fait que le poumon a un aspect noirâtre ou l'on voit des petits polygones roses (= lobules pulmonaires) entoures de noir.
2. *poids:* le poumon droit (700 g) est plus volumineux que le poumon gauche (600 g).
3. *consistance:* molle et spongieuse
4. *structure:* schématiquement le poumon apparaît constitué de :
- la ramification de l'arbre bronchique depuis le hile jusqu'à la périphérie
- trame vasculaire fonctionnelle(vx pulm.) et trophique (vx bronchiques et lymphatiques)
- un tissu conjonctivo-élastique, constituant la charpente fibreuse
#images(
filename:"images/poum_str.png",
caption:[
La structure de poumon#footnote("https://cancer.ca/fr/cancer-information/cancer-types/lung/what-is-lung-cancer/the-lungs").
],
width: 100%,
height: 20%
// ref:
)
5. *configuration externe:* on décrit au poumon :
- 3 faces : costale, médiastinale, diaphragmatique.
- 3 bords : antérieur , postérieur , et inferieur 1 base 1 sommet.
6. *Segmentation:* Chaque poumon se divise en lobe:
- Poumon droit : 3 lobes Le lobe supérieur Le lobe moyen Le lobe inferieur
- Poumon gauche : 2 lobes Le lobe supérieur Le lobe inferieur
=== Morphologie interne.
L'unité fonctionnelle: Les alvéoles sont enveloppées par des capillaires
artérioveineux l'ensemble assurant les échanges gazeux à travers la
membrane alvéolocapillaire. Cette surface estimée chez l'adulte de $70$ à
$90 m^2$ en moyenne, présente au cours du vieillissement une réduction de
ses capacités d'échanges
==== Vascularisation.
La vascularisation du poumon désigne le réseau de vaisseaux sanguins qui
assure l'apport d'oxygène et l'élimination du dioxyde de carbone dans
les poumons. Voici un résumé de la vascularisation pulmonaire :
- Les artères pulmonaires transportent le sang désoxygéné provenant du ventricule droit du cœur vers les poumons.
- À l'intérieur des poumons, les artères pulmonaires se ramifient en artérioles pulmonaires de plus petite taille.
- Les artérioles pulmonaires se divisent en capillaires pulmonaires qui sont présents au niveau des parois des alvéoles pulmonaires.
- Les capillaires pulmonaires permettent les échanges gazeux : l'oxygène est absorbé par le sang des capillaires, tandis que le dioxyde de carbone est libéré du sang pour être expiré.
- Les capillaires pulmonaires se regroupent pour former des veinules pulmonaires, qui à leur tour se rejoignent pour former les veines pulmonaires.
- Les veines pulmonaires transportent le sang oxygéné depuis les poumons vers l'oreillette gauche du cœur.
- Le sang oxygéné est ensuite pompé par le ventricule gauche du cœur vers le reste du corps, fournissant ainsi de l'oxygène aux tissus et organes.
La vascularisation du poumon assure ainsi les échanges gazeux essentiels
à la respiration, en fournissant de l'oxygène au sang et en éliminant
le dioxyde de carbone. Ce processus permet de maintenir l'équilibre de
l'organisme en oxygène et en gaz carbonique.
=== Diagnostique des maladies pulmonaire.
Pour diagnostiquer les maladies pulmonaires, les médecins recourent à diverses méthodes. Celles-ci débutent par l'anamnèse, l'examen physique et les tests de la fonction pulmonaire, essentiels à l'évaluation de la santé pulmonaire. Les poumons sont ensuite visualisés et leurs anomalies détectées à l'aide de techniques d'imagerie comme la radiographie, la tomodensitométrie, l'échographie, la biopsie et la scintigraphie pulmonaire.
Le choix des procédures de diagnostic est déterminé par les caractéristiques spécifiques du patient et les soupçons cliniques du médecin. Ce dernier, en se basant sur les résultats des examens initiaux, peut suggérer des tests supplémentaires pour établir un diagnostic rigoureux. Ces tests permettent d'identifier la cause exacte de la pathologie pulmonaire et d'orienter le choix du traitement adéquat.
== Cancer du poumon et nodules pulmonaire.
=== Causes, types et stades des cancer de poumon.
Le cancer du poumon, maladie qui voit des cellules anormales croître de manière incontrôlée dans le tissu pulmonaire, découle principalement de l'exposition à la cigarette, le tabagisme passif, l'exposition professionnelle à des subtances cancérigènes comme l'amiante ou les produits chimiques aéroportés, ainsi qu'à des facteurs génétiques et environnementaux.
Deux principales versions de ce cancer existent#footnote("https://www.e-cancer.fr/Patients-et-proches/Les-cancers/Cancer-du-poumon/Les-points-cles"):
- Le cancer du poumon à petites cellules (CPPC) est le responsable d'environ 10 à 15 % des cas, souvent associé au tabagisme et se propage rapidement dans le corps.
- Le cancer du poumon non à petites cellules (CPNPC) est plus fréquent, représentant 85 à 90 % des cas. Il comprend des sous-types comme l'adénocarcinome, le carcinome épidermoïde et le carcinome à grandes cellules.
La stadification du cancer du poumon utilise couramment le système TNM (tumeur, ganglions lymphatiques, métastases) qui évalue la taille de la tumeur originelle (T), l'atteinte des ganglions lymphatiques (N) et la présence de métastases lointaines (M). Les stades se classent comme suit#footnote("https://www.elsan.care/fr/radiotherapie-metz-iprm/nos-actualites/stades-du-cancer-du-poumon-et-esperance-de-vie."):
- *Stade I* : tumeur limitée au poumon, sans atteinte des ganglions lymphatiques ni métastases à distance.
- *Stade II* : la tumeur a envahi les ganglions lymphatiques proches du poumon touché ou a infiltré les structures avoisinantes.
- *Stade III* : la tumeur est plus avancée localement et a envahi plus de ganglions lymphatiques ou de structures adjacentes.
- *Stade IV* : le cancer a migré à d'autres parties du corps, souvent éloignées des poumons.
Il convient de noter que la classification et la stadification peuvent dépendre du système utilisé (par exemple, TNM ou la classification de l'American Joint Committee on Cancer - AJCC).
Un professionnel de santé, souvent un oncologue ou un pneumologue, à l'aide d'une série d'examens tels que biopsies, examens d'imagerie (comme le scanner thoracique et le PET scan), analyses de sang et tests de la fonction pulmonaire, peut déterminer le diagnostic précis, le type et le stade du cancer du poumon.
#images(
filename:"images/stad_du_cancer.png",
caption:[
Stade du cancer du poumon.
],
width: 70%,
height:34%
// ref:
)
=== Methodes de traitement du cancer du poumon.
Le traitement du cancer du poumon, complexe, dépend de plusieurs facteurs : le type et le stade du cancer, la présence de métastases, et les caractéristiques spécifiques du patient#footnote("https://www.fondation-arc.org/cancer/cancer-poumon/traitement-cancer").
- La chirurgie permet d'ôter la tumeur et, si nécessaire, les ganglions lymphatiques proches. En fonction de l'extension de la maladie, différentes opérations, comme la lobectomie, la pneumonectomie ou la résection cunéiforme, peuvent être réalisées.
- La radiothérapie, utilisant des radiations de haute énergie pour détruire les cellules cancéreuses, peut être administrée avant ou après la chirurgie, ou être le traitement principal pour les patients inopérables ou afin de soulager les symptômes.
#images(
filename:"images/radio1.jpg",
caption:[Accélérateur linéaire tomodensitométrie#footnote[https://en.wikipedia.org/wiki/Tomotherapy].
],
width: 50%
// ref:
)
- La chimiothérapie, basée sur des médicaments anticancéreux, peut être administrée avant ou après la chirurgie, ou comme traitement principal en cas de maladie avancée ou métastatique.
- Les thérapies ciblées sont des médicaments qui ciblent directement certaines altérations génétiques ou protéiques des cellules cancéreuses, utilisés pour traiter des sous-types spécifiques de cancer du poumon non à petites cellules.
- L'immunothérapie stimule le système immunitaire du patient pour combattre les cellules cancéreuses. Des inhibiteurs de points de contrôle immunitaire peuvent être utilisés pour traiter certains types de cancers du poumon avancés ou métastatiques.
- La thérapie photodynamique, qui combine l'utilisation d'un médicament photosensibilisant et d'une lumière laser, détruit principalement de petites tumeurs.
- Les soins palliatifs visent à soulager les symptômes, améliorer la qualité de vie et fournir un soutien aux patients atteints d'un cancer du poumon avancé ou métastatique.
Le choix du traitement est dicté par la situation individuelle du patient et doit être discuté avec une équipe médicale spécialisée dans le traitement du cancer du poumon.
== Conclusion.
Nous avons approfondi dans ce chapitre l'anatomie des nodules pulmonaires, détaillant leur signification, causes, importance, variétés et options de traitement. L'anatomie interne et externe des poumons, les diverses maladies pulmonaires et la connexion entre les nodules pulmonaires et le cancer du poumon ont également été discutées.
Ces connaissances revêtent une importance pour diverses raisons : la détection précoce du cancer du poumon, la différenciation entre nodules bénins et malins, l'évaluation du pronostic et l'organisation du traitement. Un diagnostic précis associé à une surveillance constante sont vitaux pour prévenir des traitements ou interventions inutiles chez des patients avec des nodules bénins, et pour une prise en charge rapide des nodules malins.
Grâce à l'Intelligence Artificielle de type Deep Learning et l'ensemble de données _LIDC-IDRI_, on peut bâtir des modèles capables de détecter et classifier les nodules pulmonaires. Ces techniques autorisent une identification des nodules plus tôt et avec plus de précision que jamais, augmentant ainsi les chances de survie pour les patients. De plus, elles facilitent la distinction entre nodules bénins et malins, permettant une meilleure décision quant à la suite du traitement.
En outre, nous avons également utilisé un autre modèle pour classer les nodules comme probablement normaux ou anormaux. Ce modèle a également été confronté à des défis similaires en termes de diversité des nodules et de distribution inégale dans l'ensemble de données. #finchapiter
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/021%20-%20Battle%20for%20Zendikar/009_Nissa's%20Resolve.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Nissa's Resolve",
set_name: "Battle for Zendikar",
story_date: datetime(day: 07, month: 10, year: 2015),
author: "<NAME>",
doc
)
#emph[Nissa has come a long way since leaving her home continent of Bala Ged in her youth. Though she made many mistakes in the past, ever since she bonded with Zendikar's soul, Nissa has learned to suppress her more reckless instincts. She did not need to access the wild essence inside herself when she had the strong and dependable force of an entire world on her side. But when her connection with Zendikar was ripped away, Nissa was left without the power of the land, and without her friend Ashaya, the elemental manifestation of the world's soul. Unable to make sense of her loss, and fearing for the future of the world, Nissa scoured the continent of Tazeem in search of any sign of Zendikar, until finally she understood—she had been looking in the wrong place the whole time. A soul threatened by the Eldrazi would have retreated, and there was only one place powerful enough to offer protection to something so precious: the mighty flower Khalni Heart. Without hesitation, Nissa planeswalked to the place where the new bloom was said to grow, Bala Ged. It was time to go home.]
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
For Zendikar.
Not in the way Gideon meant it, not like the battle cry, but for the deepest part of the land, for the soul of the world. That was why Nissa was doing this. She reminded herself one more time, and she told herself again to open her eyes.
In her rush to planeswalk here to Bala Ged, Nissa hadn't thought about what she would find when she arrived—aside from Khalni Heart, where she was convinced the soul of Zendikar would be waiting for her.
#figure(image("009_Nissa's Resolve/01.jpg", width: 100%), caption: [Blighted Woodland | Art by <NAME>], supplement: none, numbering: none)
But the sight that greeted her, endlessly white, endlessly corrupted, had driven her to snap her eyes shut on her home continent.
Of course, she had known it would be this way. Bala Ged had fallen to the Eldrazi; the whole world knew that. But in all the time since she had heard, she hadn't thought of it like this. She had pictured a ruined land, great swaths of chalky white corruption, dead trees. But those visualizations were based on what she had seen on Tazeem—a falling continent, not a fallen one.
She opened her eyes.
On Bala Ged, there was nothing. How could everything, #emph[everything] , just be—white, empty, gone?
It was impossible.
Yet somehow it was real.
The land wasn't ruined—it had been entirely consumed.
#figure(image("009_Nissa's Resolve/02.jpg", width: 100%), caption: [Crumble to Dust | Art by <NAME>], supplement: none, numbering: none)
There were no dead trees. There were not even vestiges of dead trees; the white landscape was completely flat, the trees had all disintegrated. Everything had disintegrated. And there weren't swaths of corruption; swaths of one thing by definition meant that there also had to be swaths, or at least rivulets, of another thing. And here there wasn't anything but corruption. Aside from Khalni Heart, Nissa reminded herself; there wasn't anything here but Khalni Heart.
If the rumors were true—and they were, they must be—then the heart of Zendikar's power had come here to revive the land, growing a new bud somewhere on this continent. Wherever that was, that's where she would find the soul of the land. That's where Zendikar must have retreated. She told herself to take one step forward, and then another, and another. The chalky corruption cracked and crunched underfoot as she walked, her footprints becoming the first variance the dusty continent had seen since its fall.
#emph[Welcome home] , she thought to herself as she set off across Bala Ged.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
It didn't seem reasonable that she would be able to recognize any particular part of this uniform wasteland—a whole day of walking and she might as well have been marching in place, for all the landscape changed. But Nissa knew exactly where she was standing as she slowed to a stop deep within the continent.
Her feet had trodden here countless times. In fact, there was a time in her life when she thought this would be the only land her feet would ever know. She had imagined that she would be walking on the same paths, gathering around the same fires, picking fruit from the same trees until she was one of the Joraga elders. This had been her village. This right here had been the towering jurworrel tree. And over there the storage tent where the Joraga dried all their meats, and fruits, and tender forest mushrooms. And here, the largest of the firepits, the one where they burned the nettled bloodbriar vines in the fall while Chief Numa led the chants.
Nissa could see it all, she could hear it, she could even smell her mother's stew. The scent of it triggered her memories. It should have been a welcome thing to remember, she wished it was, but of all the times her mother had made stew, her mind took her back to that one night, the last night, the only night she didn't want to think of ever again. She had woken up from a vision to the smell of the stew . . . and to voices. It was the voices that had convinced her to leave. And she had stolen away in the night.
Nissa could see herself slipping off into the shadows. She turned away from the sight, from the elf she had been. She hadn't thought of that elf in a long while. In fact, she had done all she could to forget that elf. That elf had made so many mistakes—horrible mistakes—after leaving this village. Mistakes that still haunted Nissa, mistakes that would haunt her forever.
#figure(image("009_Nissa's Resolve/03.jpg", width: 100%), caption: [Art by Izzy], supplement: none, numbering: none)
But she wasn't that elf anymore. And the only reason she wasn't was because of Zendikar's soul. It was her connection with the land that had changed her, saved her. It was Zendikar that kept her focused, balanced, and sure. It was Zendikar that guided her. She needed Zendikar.
In that moment, Nissa realized that she had come here to Bala Ged to save the world's soul not just for the land, for the plane, for the people, and not just for its power: She had come here to save the world's soul so she could save herself. Without it she would once again become the elf she had been the last time she was here—wild, reckless, and sure to misstep.
She wouldn't be that elf again, she couldn't be. No. Nissa vowed that she would not leave Bala Ged without Zendikar.
#v(0.35em)
#line(length: 100%, stroke: rgb(90%, 90%, 90%))
#v(0.35em)
All the distance Nissa put between herself and her village didn't seem to matter. Though she tried to push the memories out of her mind, she couldn't stop the flashes and recollections. She felt as though she was being stalked by that unseasoned, tender-footed elf. Worse, she felt as though she was melding with the memories of it.
Everything was suddenly familiar. Even though the land was a solid mass of monotonous white corruption, she knew exactly what path she was cutting through the Tangled Vales; she had hunted here countless times. She knew where to step to avoid the traps the packs of humans set for the gnarlids—and she skirted them even though they weren't there, even though she tried to stop her feet from responding to the unwelcome reminiscence. Her knees instinctively braced themselves to climb a hill that didn't exist. And when she had taken enough steps to have reached the hilltop, her mouth watered and her stomach growled, anticipating she would make a snack of the thick-growing mushrooms at the summit as she always did. Then, when she heard the shrill chatter of a gomazoa, she ducked to avoid it—the ghost of a memory of a deadly hunter.
#figure(image("009_Nissa's Resolve/04.jpg", width: 100%), caption: [Guard Gomazoa | Art by <NAME>], supplement: none, numbering: none)
She pushed it from her mind, but the call followed her, mocking her inability to separate reality from unwanted memory. Her hand moved to her sword on instinct. Foolish elf. There was nothing there—Nissa came up short.
The thing she had seen out of the corner of her eye wasn't a memory. And it wasn't a gomazoa either. But it was close enough: The midsize Eldrazi had tentacles and a soft, fleshy body, just like the predator from her past.
Nissa was lunging at it, blade out, before her conscious mind told her to move. She had done this before. Right here on this ground. More times than she could count. One slice up through its center, and a second across its front side. She quartered the monstrosity so quickly that the echo of its sharp cry persisted for a beat after its life had ended.
Something inside Nissa stirred. She stood, breathing heavily, above the body of the Eldrazi. She hadn't fought like that in what felt like a lifetime. She had forgotten the rush of wielding her blade with such precision and force.
There was more force inside her. More power that she could—#emph[no] . Nissa swallowed hard, forcing down the thread that threatened to unravel her.
She was not that elf. This was not that Bala Ged. And the thing in front of her wasn't a gomazoa. It was an Eldrazi.
#figure(image("009_Nissa's Resolve/05.jpg", width: 100%), caption: [Rush of Ice | Art by Deruchenko Alexander], supplement: none, numbering: none)
It was an Eldrazi!
Nissa had never been so thrilled to see one of these monstrosities in her life, nor would she ever be again, but now, here on this wasted continent, there was only one thing that the presence of this Eldrazi could mean: life.
There must be something here for it to feed on. There had to be, or it wouldn't be here.
Nissa didn't know much about the otherworldly monstrosities that had descended upon Zendikar; for the most part, they proved inscrutable. But she did know one thing: They were ceaselessly hungry, on a never-ending path of devouring destruction. They only traveled where there was something to consume, and to them that meant life.
Somewhere on Bala Ged, there was life.
#emph[Khalni Heart.]
It had to be Khalni Heart.
Her heart pounding against her ribs and her eyes set on the dimpled trail the scrabbling Eldrazi had left in its wake, Nissa raced across the land. Wherever the monstrosity had come from, whatever it had left behind to pursue and feed on her, that's where she hoped she would find the life she was looking for.
This kind of tracking was effortless for Nissa—the ranger elf she used to be had trailed hundreds of creatures across this very ground. Though the Eldrazi's prints might not stand out against the pockmarked corruption to the untrained eye, Nissa saw the trail like a glowing beacon. She followed it down the path that the Umung River used to take through the Vales—now just more chalky corruption. She ran through the Guum Wilds—she never would have dared to run with such haphazard abandon through what had once been the thickest and most poisonous part of the jungle. And she made a beeline toward the caves where the surrakar used to nest.
When she realized that's where she was headed, Nissa slowed just slightly. A shiver ran down her spine at the thought of the territorial, reptilian beasts.
#figure(image("009_Nissa's Resolve/06.jpg", width: 100%), caption: [Surrakar Marauder | Art by <NAME>], supplement: none, numbering: none)
Her mind was on their deep tunnel system that ran under Bala Ged. Had that been corrupted, too? Had the Eldrazi gone beneath the surface? Or had they neglected the tunnels, leaving those things that were hidden below to survive?
Nissa wasn't sure what she hoped for. What would she rather face, a pack of hungry surrakars or more desecrated land?
She didn't have the answer, at least not one she was willing to admit, and she didn't have long to consider it—it was at the partially collapsed and corrupted mouth of a surrakar tunnel, where the Eldrazi tracks circled around, that she saw the first sign of life.
A delicate blanket of pale green moss, one that looked like it was barely holding on, lined the crumbling opening.
Nissa dropped to her knees and ran her fingers across the stubble of green. It was soft, fragile, and a little bit warm.
#emph[Zendikar.]
Her spirit brimmed, and impulsively she reached down into the land, searching for any sign of the world's soul—but retracted just as quickly, withdrawing from the vast, echoing emptiness. This had to be the place, but then where was Zendikar? Shouldn't she be able to feel Khalni Heart by now? She pushed the doubt and worry from her mind; it would be here.
The fine film of green extended down into the tunnel below. Nissa wasn't sure if it was a combination of the darkness and her hope, or if it was real, but it appeared that the moss got thicker and more robust deeper into the tunnel. Either way, it was there, like a trail that would lead her home.
Her limbs couldn't move fast enough for her longing. She crawled into the tunnel, clambering along as rapidly as possible in the tight quarters. Her eyes had not deceived her above: The farther into the tunnel she went, the thicker the moss became under her fingers and palms—thicker, but more brittle? Another trace of doubt tickled the back of her mind. Something wasn't right here. She felt unsettled.
As she pushed forward, her senses heightened, alert for what she did not know.
The narrow tunnel opened to reveal a cavern washed in a bluish glow. That was odd. She narrowed her eyes, straining to see farther ahead, and her ears pricked up, tilting first one way and then another. But she could ascertain no further clues as to what the blue light was, so she crawled into the high-ceilinged cavity and pushed herself to her feet.
Her breath caught and her mind reeled, trying to assemble the pieces of what she was seeing. The blue light was coming from a tight circle of hedrons linked together with a network of crisscrossing, glowing leylines of power. The leylines were arranged in a pattern she had never seen before—it was unnatural.
#figure(image("009_Nissa's Resolve/07.jpg", width: 100%), caption: [Reclaiming Vines | Art by <NAME>], supplement: none, numbering: none)
Why was this here? What—who—had done this?
Not a surrakar. She was fairly sure they had no interest whatsoever in arranging hedrons.
An Eldrazi?
Her skin crawled; she could no longer dismiss her worry.
She stalked slowly around the circle, eyes tracking, hairs on her arms standing on end. Nothing was right here, nothing had been right since she'd entered the cave.
The force that had stirred within her when she slew the Eldrazi above bubbled up once more. It was ready for whatever lay ahead—which meant it was up to Nissa to hold it back. This was not the time; too much was at stake. She quieted it and turned her attention to the hedrons.
Each hedron was propped up at its base with a mound of dirt that looked to have been raked together, intentionally, with someone's (or something's) fingers—or claws.
At first, it seemed like the ring of hedrons was complete, but then Nissa came upon a gap, one that looked to be exactly the size of a single hedron.
And it was through that gap that Nissa saw it: Khalni Heart#emph[.]
#emph[Zendikar.]
Her heart leapt—and with the next beat plummeted. The young flower was lying on a slab of stone, its half-wilted petals draped over one side and its roots, thick with chunks of dried, clinging dirt, dangling over the other.
At the sight of the exposed roots, an agonizing memory flashed through Nissa's mind. The pain, the ripping sensation. Suddenly she was back on the ridge at the edge of the Vastwood Forest of Tazeem. It was as though her bond with Zendikar was being broken all over again.
Zendikar's soul had not retreated to Khalni Heart freely; someone had done this to it. Even as the Eldrazi plagued the land, someone had uprooted the land's soul and trapped it here to die. Who could be so cruel?
Stronger than the shock that threatened to paralyze her, Nissa's instincts drove her actions. Her legs moved, carrying her forward toward the flower. Her arms reached out in a bid for protection. But before she could breach the hedron prison, a gust of wind blew across her skin, and something hard and hot slammed into her side. She flew across the cave and skidded along the ground.
Gasping to reclaim the breath that had been knocked out of her, Nissa pushed herself up to her hands and knees only to be swatted down again.
She tumbled and rolled across the cave floor, landing on her back—looking straight up at a demon.
#figure(image("009_Nissa's Resolve/08.jpg", width: 100%), caption: [Ob Nixilis Reignited | Art by <NAME>], supplement: none, numbering: none)
"Why are you here?" The demon's deep voice was somehow both resonant and empty. He loomed over her; his wings, only half spread, filled the width of the cave, blocking her view of the hedron prison and the flower. Long, sharp barbs lined his arms and legs, and five thick horns framed his head. "Who sent you?"
This demon was the one who had done it. Looking into his glowing red eyes, Nissa knew it without a doubt. He was the one who had uprooted Zendikar. He had stolen her friend from her, had caused her immeasurable pain, had harmed the world's soul. And for that, Nissa hated him.
"Answer me!" the demon raged. Veins of hot, lava-like magic shot across his chest and down his arms. "How did you find me?"
He darted at her. In one fluid motion, Nissa drew her sword, but the demon was fast, too. He clamped his hand around her wrist, bending it back and wrenching her fingers from her weapon.
As her blade clattered onto the rock, the demon threw the weight of his body at her, forcing her back and down as though he meant to bury her right there in the ground. "Was it Nahiri?"
Nissa struggled against his weight. He was nearly three times her size, so he would have the advantage—or at least he would believe he had the advantage. Elves were among the lightest of the races on Zendikar, but a well-practiced elf could take down any of the heavier races—or creatures—of the world. And Nissa was a well-practiced elf, or at least she had been. The elf she was before, the one who had lived here on Bala Ged, had once grappled with a spiked baloth and come out victorious.
#figure(image("009_Nissa's Resolve/09.jpg", width: 100%), caption: [Spiked Baloth | Art by Daarken], supplement: none, numbering: none)
This demon was no different from the baloth. He was one creature, one animal, and she could take him down. Nissa gauged his movements as they wrestled, and it didn't take her long to identify his center of gravity. Once she found it, she played against it, gaining more of an advantage with each move she made. When she had enough leverage, she tucked her feet up and kicked his chest in just the right place to knock him off balance, launching him away from her.
The demon staggered back, catching himself in midair with a powerful flap of his leathery wings.
He made to come at her again, but Nissa was quicker this time; the movements and instincts of combat were coming back to her. Having retrieved her sword, she thrust the blade at him, catching the side of his leg even as he dodged, drawing blood.
His eyes contracted and he bellowed. But Nissa didn't flinch.
He hovered above her with a look on his face that she couldn't quite read. There was hatred there, that much was clear, but there was also something else, something disconcerted. He hissed. "If Nahiri thinks she can stop me now, she is sorely mistaken."
Nissa didn't know what he was talking about and she didn't care. She lunged with her sword again, but she was unprepared for his counterstroke. The demon spun on her, the burning force inside him welling up until it burst out of his palm, blasting straight at her chest. It was a life-draining power that tapped straight into Nissa's essence—and fed the demon's darkness as it did.
Though she had grown adept at ignoring the power inside her, even suppressing it, it had not declined. And now, as it was threatened, as it was pulled away from her, a deep-seated, racking wave of pain crashed over her.
Nissa gasped and lurched, staggering under the sickening feeling of weakness. If she did not act, this would be the end. The demon would drain her, and next Zendikar.
She knew what she had to do. He left her with no choice. She would just use a fraction of it, just for a moment.
It wasn't easy to wield at first. Though the power was anxious to be unleashed, Nissa felt out of place using it, like she was navigating the dark room of a stranger's house. She stumbled and floundered as she channeled it up through her chest and out into her arm.
Lifting her sword felt like lifting an entire jaddi tree, but she held the blade up and forced her essence down through it. The more the power flowed, the more she recognized it. Something inside her was waking up, and it was thrilled that morning had finally come.
She angled the charged blade between her chest and the demon's blast of draining energy and pushed on it with all the strength within her. Suddenly, the full force of Nissa's essence came rushing back to her—and with it all of the memories, all of the horrors, the missteps, the mistakes. How many times had she wielded this power only to ruin everything? How often had she caused more harm than good? She couldn't trust herself.
But it was too late for that. The demon's attack was reflected off the power infused in her blade, and it shot straight back at him. The force of the blow sent both Nissa and the demon rocketing backward, crashing into opposite walls of the cave.
Nissa's head spun and her fingers tingled with power, impatient power. She jumped to her feet as the demon stalked toward her.
"Impressive," he said. "Your looks deceive. You're dressed like a simple Joraga." He sniffed the air around her. "But you smell like the Blind Eternities. Planeswalker."
Nissa tensed. Was he a Planeswalker, too? He must be. She focused her senses on him, feeling for his energy. There was something there at the edges of his being, but it wasn't quite right, and she couldn't identify why.
"I shouldn't have expected any less from Nahiri's emissary," he said. "But I have to ask, why did she send you? Why didn't she come herself?"
"I don't know what you're talking about." Nissa held back the urge to rush at the demon—but just barely. The well of power inside her was exhilarated, and it would not be restrained for long.
"Perhaps it was because Nahiri was afraid to face me, worried that once this is done, I will wield more power than any single Planeswalker has controlled in a very long time." The demon glanced back at the flower, and Nissa followed his gaze, her heart beating for Zendikar. "The power of an entire world will all be mine."
#figure(image("009_Nissa's Resolve/10.jpg", width: 100%), caption: [Ob Nixilis, Unshackled | Art by <NAME>], supplement: none, numbering: none)
"That power isn't for you." Nissa's words came out strong and sure, buoyed by the surging force in her veins. "Khalni Heart belongs to the land."
"Don't be naive," the demon snapped. "Power belongs to those who take it. I took it. So it's mine."
"Then I'll take it back." Nissa could no longer stop herself; her wild essence spurred her on, and she dove toward the opening between the hedrons. She had come for Zendikar, and she would not leave without it—but the demon shot another blast, and Nissa was forced to dodge.
"You don't want to die here, elf," he said. "It's not worth it. Not for whatever Nahiri has promised you."
"I don't know who Nahiri is," Nissa shot back. But the demon was right, she didn't want to die here. What was she doing? She was showing blatant disregard for her life, for the life of Khalni Heart, which was right there in front of her, vulnerable and fading. It was the volatile energy inside that was directing her actions. That shouldn't have happened. She was only supposed to have accessed it for a moment; she had promised herself that. She wasn't that elf anymore. She was the elf who was in control, the elf who silenced the erratic and unstable impulses that rose up from within. The elf who depended on her bond with the land to draw the power that she needed, power that she could trust, power that didn't make mistakes.
That sure-footed elf was the elf who had come here to save Zendikar, and that was the only elf who would succeed. With effort, she drove her prodding, eager essence downward, biting back its will for her to dive straight at the demon again. It wouldn't work. There were other ways past him than by sheer force. She had to think. She had to focus.
The problem was, there was only one way into the ring of hedrons, so the demon would always know which way she was going to go. But if there were another hole in the circle . . . yes! That was the kind of elf she was.
"If Nahiri didn't send you, then why are you here?" The demon leered at her.
Nissa nodded past him to Khalni Heart, an excuse to survey the ring of hedrons. "I'm here to save that flower. I'm here for Zendikar."
"For Zendikar?" The demon barked a laugh. "Either you are lying or you're delusional. Have you seen Zendikar lately? There's nothing left to save. Soon the Eldrazi will consume everything."
"They won't." Nissa set her sights on a hedron to the demon's left.
"You say that with such confidence."
"Yes." Nissa tensed, ready to run.
"And who's going to stop the Eldrazi?" the demon asked. "You?"
"Yes," Nissa said. "Me." She charged.
#figure(image("009_Nissa's Resolve/11.jpg", width: 100%), caption: [<NAME> | Art by <NAME>], supplement: none, numbering: none)
The demon moved to block the entrance to the prison, but that was not where she was headed.
She launched herself into the air, somersaulting toward the hedron to his left, a clear path in front of her. She readied her blade for the strike.
But as the hedron came into range, she knew she would not succeed. Echoes of a distant memory played in her mind. She had broken a hedron once before. A hedron in a cave, much like this one. However, it had required the power of her essence. If she struck the rock now with only her bare blade, she would be lucky to leave a mark.
She needed more power, more of her.
It was unclear if it was by choice—it was unclear if she had a choice at all—but as her blade crashed into the hedron, the essence within Nissa burst out. And then the demon crashed into her.
They rolled across the ground, struggling against each other, evenly matched. Nissa kept her eyes on the hedron, waiting for it to crack, waiting for the cascade of chaos she knew would follow. Waiting to see if she had acted in time.
A heartbeat later, a fissure of power erupted on the hedron's surface, spidering out down its sides, and the next instant, the massive rock shattered. As it did, the pattern of leylines that had been connected to it began to tremble and quiver, breaking down. The reverberations sent the other hedrons rocking. The prison was losing its integrity. Soon it would collapse entirely, and most likely bring the rest of the cave down with it.
Now was Nissa's only chance. She saw what she had to do, and she tapped into her power again. This time she used it to fling the demon off of her. She sprang to her feet and darted for Khalni Heart.
"No!" the demon roared. "I won't let you do this!"
He lunged after her, but he hesitated between Nissa and the precariously teetering hedrons. She saw the doubt in his eyes and then the flash of decision as he launched himself at the nearest angular stone, wrapping his thick arms around it, straining to hold it up.
#figure(image("009_Nissa's Resolve/12.jpg", width: 100%), caption: [Khalni Heart Expedition | Art by <NAME>an], supplement: none, numbering: none)
Nissa leapt past him and reached for Khalni Heart.
The moment her fingers touched the flower—it was everything.
#emph[Zendikar.]
The word, the presence, the soul echoed within her.
And then the demon's hand closed around hers, squeezing so hard she thought she would strangle the flower. "That was foolish." The fire within him raged. "More than foolish."
But he was no longer supporting the quaking hedrons. The leylines splayed as the stones crashed around them, falling in a cascade.
The demon looked to Nissa, hot hatred radiating outward from his glare. "And now you'll pay for it." His fury poured from him into Nissa, locking her in place like a harness. She struggled to free herself, but with every breath, he drained more of her strength to fight back.
His singular focus was to kill her right there, destroy her. She could feel it. She could see it in his eyes.
"No matter how much you might want this," the demon lifted their joined hands and Khalni Heart, "I want it more. And I will have it."
His rage burned stronger with every weakening beat of Nissa's heart. "If you want to live, now is the time to planeswalk away."
Nissa panicked. The edges of her vision were going dark. Her eyes darted to Khalni Heart. Her ebbing essence reached for the power of Zendikar, the power that was right there in her hands. With it she could crush the demon, she could win—all she had to do was take it.
No. Nissa stopped herself, reining in her desperation. Zendikar didn't have power to give her, not now, when it was uprooted and unconnected to the land. If she pulled on it, she would drain it, she would destroy the flower, and she would bring an end to Zendikar.
She wasn't that elf anymore, the one who acted without knowing the consequences. She wasn't going to make that kind of mistake.
Then what? Fall to the demon?
No. She wasn't that elf either.
She was something in between who she had been long ago and who she thought she had become. Neither was completely true. It had been a mistake to dam down the force inside her for so long—she was powerful, more powerful even than this demon, and that wasn't something she should hide. But she had not been wrong to learn control, to learn caution. It was never the power that had been wrong, never the passion. She had always done things for the right reasons, always with the right intentions. But she had made mistakes because she didn't have the awareness of the world around her, the deeper understanding required to act with care.
But now she did.
She had learned from Zendikar. She could see the patterns and connections, she could feel the bigger picture. This cave, these hedrons, the power of Khalni Heart, the draining essence of the demon. She could also see the whole of Zendikar, the Eldrazi, the other Planeswalkers, the camp of survivors. And she could see the Multiverse, all of the myriad worlds.
#figure(image("009_Nissa's Resolve/13.jpg", width: 100%), caption: [Blinkmoth Nexus | Art by <NAME>], supplement: none, numbering: none)
She had a place in it all. She had a power that belonged. One that she was meant to use—today, right now, to save Zendikar.
What she was about to do was dangerous. Possibly the most dangerous thing she had ever done. But it was not a risk. She knew exactly what would happen. And she was prepared.
Nissa collected all the power left within her, everything the demon had yet to drain, and she pulled it away from him. She could feel his grip on the other side of it, feel him straining against her, but she forced it down through her arms, through her fingertips, and into Khalni Heart.
As her essence rushed into the flower, it came alive. Its petals lifted, its leaves unfurled, it brightened. And finally its roots began to grow. They reached downward toward the ground.
"What are you doing?" The demon yanked back on her essence. She could see the confusion in his eyes.
Nissa felt like a willow's branch, tugged down by the demon and pulled up through the strength of her center. The roots of Khalni Heart had almost reached the ground. She sent one final wave out into Zendikar's soul, and then her vision darkened and her body slackened.
The demon ripped the flower out of her limp fingers, and Nissa fell to her knees.
"This world is mine!" he snarled. "This power belongs to me."
But it didn't.
The roots had reached the ground. The world's soul had returned to the land. Zendikar belonged to no one. The land surged upward, sending chunks of rock flying as it reached for Khalni Heart. It pulled the flower down, out of the demon's hands, and into the world's embrace.
"No!" The demon dropped to his knees, scrabbling at the ground with grotesque nails. But it was too late. The land had already sealed over the heart of power. The flower was gone. It was safe.
The whole cave began to shudder as the strength of Zendikar surged up through Nissa's palms, filling the emptiness inside her, blending with the single drop of her own essence that remained.
The demon was sent lurching. He reached for the wall to steady himself, but the wall burst open. He shot up into the air, dodging the rock. "What have you done?"
Nissa got to her feet and turned to face him. "If you want to live, now is the time to planeswalk away." She reached for her bond with Zendikar, drawing on both the power inside her and the power of the world, calling up an extension of her being, a perfection of her form. As she swung at the demon, the dirt and detritus moved with her, driving a fist of land straight into his chest. He was sent careening back into the collapsing rock wall.
Nissa leapt from one shattering piece of land to the next, each fragment of Zendikar alternatingly cradling her landing and lending her its power to spring off. As the world crashed down on the demon, Nissa rose up, and so too did the world's soul, her friend.
#emph[Ashaya.]
When she reached the surface, Nissa's feet touched down on a soft, lush carpet of moss. She breathed in the smell of vibrant life. Next to her, the towering elemental, made of the remnants of the tunnel and the collapsing land, did the same.
Nissa looked up at her friend. Ashaya sent a surge of fervor down to Nissa, and Nissa sent her own essence back. They were one, and also they were each their own, stronger for the power they shared. Now it was time to use that power to save Zendikar.
#figure(image("009_Nissa's Resolve/14.jpg", width: 100%), caption: [Ashaya, the Awoken World | Art by Raymond Swanland], supplement: none, numbering: none)
Nissa and Ashaya would return to Sea Gate, they would meet Gideon's army, and they would join in his battle cry, for the words had meaning once more.
"For Zendikar!"
Together, they set off across the continent, matching each other stride for stride.
|
|
https://github.com/extua/nth | https://raw.githubusercontent.com/extua/nth/main/CHANGELOG.md | markdown | MIT No Attribution | ## 1.0.1 - 2024-06-20
Only minor manifest changes in this update, the package code is unchanged.
### Changed
* Added 'text' category and keywords for integration with Typst Universe (commit [30869a7](https://github.com/extua/nth/commit/30869a7843c2c03307699394b510d628ed9df18c)).
* Added other authors to license statement (commit [1ff47b0](https://github.com/extua/nth/commit/1ff47b0efec88caf7a404a4e8eafe48e101cd163)), and link to author github accounts in package manifest (commits [e1ea73a](https://github.com/extua/nth/commit/e1ea73af9b7a9940bf71883413dd9cb5031f2fea) and [a729a64](https://github.com/extua/nth/commit/a729a640c3d2f7e89e3b1390b9a37f6ed28c9889)).
## 1.0.0 - 2023-12-21
### Changed
* **Breaking** separated functionality, now `nth` only gives ordinals and `nths` gives ordinals in superscript (commit [eff87f3](https://github.com/extua/nth/commit/eff87f3f2a2a20cf05198fbd7d4e5fa2d30858d1), fixes [#1](https://github.com/extua/nth/issues/1) reported by [emilyyyylime](https://github.com/emilyyyylime)).
## 0.2.0 - 2023-10-02
### Fixed
* Added missing brace to if statement (commmit [bbe6251](https://github.com/typst/packages/commit/bbe6251c1511ff97d92988aeb55ff66470cbd0b9) in Typst repo) ([jeffa5](https://github.com/jeffa5)).
### Changed
* Corrected a typo in the description in typst.toml (commit [2d5cbca](https://github.com/typst/packages/commit/2d5cbcada47a7fb1d00f2d3f7f67c11132e79429) in Typst repo) ([fnoaman](https://github.com/fnoaman)).
## 0.1.0 - 2023-09-15
:seedling: Initial release.
|
https://github.com/sitandr/typst-examples-book | https://raw.githubusercontent.com/sitandr/typst-examples-book/main/src/basics/math/alignment.md | markdown | MIT License | # Alignment
## General alignment
By default display math is center-aligned, but that can be set up with `show` rule:
```typ
#show math.equation: set align(right)
$
(a + b)/2
$
```
Or using `align` element:
```typ
#align(left, block($ x = 5 $))
```
## Alignment points
When equations include multiple alignment points (&), this creates blocks of alternatingly _right-_ and _left-_ aligned columns.
In the example below, the expression `(3x + y) / 7` is _right-aligned_ and `= 9` is _left-aligned_.
```typ
$ (3x + y) / 7 &= 9 && "given" \
3x + y &= 63 & "multiply by 7" \
3x &= 63 - y && "subtract y" \
x &= 21 - y/3 & "divide by 3" $
```
The word "given" is also left-aligned because `&&` creates two alignment points in a row, _alternating the alignment twice_.
`& &` and `&&` behave exactly the same way.
Meanwhile, "multiply by 7" is left-aligned because just one `&` precedes it.
**Each alignment point simply alternates between right-aligned/left-aligned.** |
https://github.com/Skimmeroni/Appunti | https://raw.githubusercontent.com/Skimmeroni/Appunti/main/Metodi%20Algebrici/Codici/Introduzione.typ | typst | Creative Commons Zero v1.0 Universal | #import "../Metodi_defs.typ": *
Prende il nome di *sistema di comunicazione* la struttura di seguito
schematizzata:
#set math.mat(delim: none)
$ mat(
space, space, space, space, "rumore", space, space, space, space;
space, space, space, space, arrow.b, space, space, space, space;
"Trasmettitore", attach(-->, t: m), "Codificatore", attach(-->, t: x),
"Canale", attach(-->, t: y), "Decodificatore", attach(-->, t: tilde(m)),
"Ricevitore";
) $
La descrizione dei componenti é qui riportata:
- Trasmettitore: emette il messaggio $m$;
- Codificatore: traduce il messaggio $m$ nella parola $x$
in modo che possa attraversare il canale;
- Canale: mezzo attraverso il quale viaggiano le parole;
- Decodificatore: trasforma la parola $y$ in uscita dal canale
nel messaggio $tilde(m)$;
- Ricevitore: riceve il messaggio $tilde(m)$;
- Rumore: disturbi di vario genere che potrebbero alterare le parole.
In una situazione ideale, il segnale inviato $x$ ed il segnale ricevuto
$y$ dovrebbero coincidere. In uno scenario piú realistico, i due segnali
saranno piú o meno diversi, in quanto ogni canale di comunicazione é
soggetto a rumore, e quindi parte dell'informazione giunta a destinazione
differirá dall'originale. In termini molto generali, i tipi di errori
che possono presentarsi nella trasmissione di un segnale $x$ e nella
ricezione del segnale $y$ sono tre:
- Parte dell'informazione contenuta in $x$ viene alterata;
- Parte dell'informazione contenuta in $x$ viene perduta;
- Il segnale $x$ si ritrova ad avere piú informazioni dell'originale
quando viene ricevuto.
Essendo la presenza di tali errori inevitabile, l'interesse é quello di
costruire canali di comunicazione che, pur essendo vulnerabili al rumore,
sono comunque in grado di tollerarlo, di modo che il messaggio ricevuto
$tilde(m)$ sia una buona approssimazione di quello inviato $m$.
|
https://github.com/MRoiban/math-f303-exos | https://raw.githubusercontent.com/MRoiban/math-f303-exos/main/main.typ | typst | #import "@preview/equate:0.2.0": equate
#import "@preview/showybox:2.0.1": showybox
#import "@preview/lovelace:0.3.0": *
#import "@preview/ilm:1.1.2": *
#show: ilm.with(
title: [Math Exam Preparation],
author: "<NAME>",
date: datetime(year: 2024, month: 07, day: 22),
abstract: [],
preface: [],
figure-index: (enabled: true),
table-index: (enabled: true),
listing-index: (enabled: true)
)
#let pseudocodeblock(title, code) = box[#text(
font: "FiraCode Nerd Font Mono",
ligatures: true
)[
#showybox(
shadow: (
offset: 3.5pt
),
title: title,
[#code]
)
]]
#let CQFD = box[$space square.filled$]
#pseudocodeblock("Euclid's Algorithm", [
#pseudocode-list(hooks: .5em)[
+ *def* euclid_division(a,b):
+ sum = 0
+ *whilst* sum <= a:
+ sum += b
+ *return* a - sum + b
]
#pseudocode-list(hooks: .5em)[
+ *def* pgcd(a, b):
+ *if* b == 0:
+ *return* a
+ r = euclid_division(a, b)
+ *return* pgcd(b, r)
]
])
#showybox(
shadow: (
offset: 3.5pt,
),
title: "Division by 9",
[*For $a=10^0a_0+10^1a_1+...+10^n a_n$ prove that $9 bar a equiv 9 bar sum_(i=0)^n 10^i a_i$.*\ \
We want to show that if a number $n$ is divisible by 9 then the number modulo 9 should equal 0.
$
n % 9 = 0 space space space space &#[if 9 $bar$ n and vice-versa]
$
We want then to prove that $(sum_(i=0)^n 10^i dot a_i)%9=0$ to prove that $9 bar sum_(i=0)^n 10^i dot a_i$.
$
(sum_(i=0)^n 10^i dot a_i)%9&=0\
&= (a_0+10^1 dot a_1 + ... +10^n dot a_n)%9 \
&=(a_0)%9+(10^1 dot a_1)%9+...+(10^n dot a_n)%9 \
&= 0 + 0 + ... + 0 \
&= 0 #CQFD
$ <sum-mod-9>
We showed that $9 bar n equiv 9 bar sum_(i=0)^n 10^i dot a_i$],
)
= Exercices
== Exercice 1
$9 bar 99 &equiv 9 bar (10^0 dot 9 + 10^1 dot 9)$
We know that $99 % 9 = 0$. Now we want to prove that the sum
$
(sum_(i=0)^1 10^i dot a_i)%9&=0 \
&= (9 + 10^1 dot 9) % 9 \
&= (9%9)+(90%9) \
&= 0+0\
&= 0 #CQFD
$
== Exercice 4
Pour les paires (a, b) suivantes, calculer pgcd(a, b) à l’aide de l’algorithme d’Euclide et trouver x, y tels que ax + by = pgcd(a, b).\
+ a = 1287, b = 4004
#let pgcd(a, b) = box[pgcd(#a, #b)]
D'abord calculons le pgcd(1287, 4004)
$
&#pgcd("1287","4004") &&= 0 + 1287 \
&#pgcd("4004","1287") &&= 3861 + 143 \
&#pgcd("1287", "143") &&= 1287 + 0 \
&#pgcd("143", "0") &&= 143 #CQFD
$
Trouvons maintenant $(x,y)$ pour calculer l'equation
$
1287x + 4004y&=143 \
1287x + 4004 dot 1&= 143\
4004 - 143 &= 1287x \
3861 &= 1287x \
3861/1287&=x=3 #CQFD
$
On a trouvé comme solution, $x=3$ et $y=1$.
#pagebreak()
= Graphes
#showybox(
shadow: (
offset: 3.5pt,
),
title: "Euler's Formula",
[
On dit qu'un graphe est planaire lorsque la formule d'Euler est
satisfaite:
$
v-e+a=2
$
Oú $bar V bar=v, bar E bar=e$ et $a$ est le nombre de faces.
]
)
== Exercices
=== Exercice 11
On a trois maisons et trois usines. La première usine fournit de l’eau, la deuxième
du gaz et la troisième de l’électricité. On désire relier chacune des trois maisons aux trois usines
pour qu’elles aient accès à l’eau, au gaz et à l’électricité. Une contrainte supplémentaire est que les
tuyaux ne doivent jamais se croiser. Est-ce possible ?
#align(center)[#image("img/image_372.png", height:30%, width: auto)]
#let showbox(title, body) = box()[
#showybox(
shadow: (
offset:3.5pt
), title: title,
[#body]
)
]
On sait qu'on peut utiliser la formule d'Euler pour vérifier la planarité d'un graphe, on montrant la planarité du graphe on a aussi prouvé qu'il n'existe aucun croisement entre les arrêtes du graphes (Donc, il n'y a aucun croisement entre les tuyaux!).
$
bar V bar - bar E bar + f &= 2 \
6 - 9 + f &= 2 \
f &= 2 -6 + 9 \
f &= 5
$
Après avoir calculer la formule d'Euler, on a trouvé qu'il faut que notre graphe contient 5 faces.
#showbox("Preuve par l'absurde",[
Imaginons que la formule d'Euler est respectée et donc il y a un nombre de faces equivalent a 5 dans notre graphe.
Dans un graphe biparti $K_(3,3)$ on sait qu'il n'est pas possible de créer un face avec le nombre minimal de 3 arrêtes, nous auront à la place un quadrilatère formé par 4 arrêtes.
Donc, on peut calculer le nombre minimal de faces à partir de ces données
$
2 dot (bar E bar) / 4 &equiv 2 dot 9/4 \ &= 4.5
$
Ceci rentre en contradiction avec le nombre de faces necessaire pour prouver que le graphe est planaire, donc, ce n'est pas possible de ne pas avoir des tuyaux qui ne se croisent pas. #CQFD
])
=== Exercice 12
Soit $G$ un graphe dont les sommets sont les entiers $1, 2, 3, ..., n$ et tel que l’arête
$p q$ existe si et seulement si $p != q$ et $p + q$ est impair.
(a) Montrer que χ($G$) = 2, autrement dit que le graphe est biparti.
#figure(
image("img/image_373.png", height: 30%),
caption: [Le graphe G]
)
#showbox(
"Preuve par l'absurde",
[
On sait que toute arrête entre 2 sommets $(a,b)$ a existe si $a + b in I$ avec $I$ l'ensemble des nombres impairs et $P$ l'ensemble des nombres pairs.
Alors imaginons il existe une arrête entre 2 nombres paires ou impaires, leur somme serra d'office paire car
$
P + P &= P \
I + I &= P
$
Ceci va en contradiction avec la définition de notre graphe et donc on va necessiter d'une 3eme couleur, alors χ($G$)$>2$. #CQFD
]
)
(b) Que se passe-t-il si “impair” est remplacé par “premier” dans la définition ? Donner l’allure et
le nombre chromatique de ce graphe.
$
p &!= q\
p + q &in #[Prime]
$
#figure(
image("img/image_374.png", height: 10%),
caption: [Le graphe $G prime $]
)<G-prime>
Dans ce genre de graphe, nous avons tout les nombres premiers comme impaires sauf le nombre 2.
Donc, le graphe G a priori suit une coloriation simmilaire à la situation de base, impliquant que la coloration soit $chi(G)<=2$.
De plus, prenons le graphe $G prime$ dans la @G-prime, ce graphe contient au minimum 1 arrête car $1+2=3$ et donc necessite 2 couleur. Donc, $chi(G prime)=2$.
En tenant compte de $chi(G)<=2 and chi(G prime)=2$ on conclue que $chi(G)=2$ #CQFD
\
\
(c) Que se passe-t-il si “impair” est remplacé par “pair” dans la définition ? Donner l’allure et le
nombre chromatique de ce graphe.
$
p &!= q\
p + q &=in #[Paire]
$
On sait que la somme de nombre pair est paire et la somme de nombre impair est paire aussi
$
P + P &= P \
I + I &= P
$
Ceci nous donnera 1 graphe ayant 2 composantes connexes, une partie contenant les nombres pairs et l'autre les nombres impairs.
On sait qu'il faudra $chi(G prime prime)=ceil(n/2)$ couleurs pour chaque sous graphe.
=== Exercice 13
Trouver un contre-exemple à l’énoncé (faux) suivant :\
#align(center)[Tout graphe simple à 8 sommets et 2-régulier est eulérien]
*Solution:*
#figure(
image("img/image_375.png", height: 15%),
caption: [Un graphe ayant 2 composantes connexes]
)
=== Exercice 14
Quel est le nombre chromatique du graphe de Petersen ?
*Solution*
Le graphe de Petersen a besoin de $chi(G)=3$ couleurs pour effectuer un coloriage des sommets.
=== Exercice 15
Soit G un graphe simple. Montrer que G est complet si et seulement si $bar E bar = binom(bar V bar,2)$
*Solution*
Il y a double implication, si le graph G est complet, ça signifie que le nombre d'arrêtes devrait être équivalent à $bar E bar = binom(bar V bar,2)$. Et si le nombre $bar E bar = binom(bar V bar,2)$, ceci signifie alors que le graph G est complet.
Il faudra alors prouver ces deux implications, l'une par l'une.
*(1) Implication: G complet $arrow$ $bar E bar = binom(bar V bar,2)$*
Si le graph G est complet, ça signifie que pour chaque sommet, il y a $bar V bar -1$ sommet connectés. Et comme le graph est complet, chaque sommet sera lui aussi connecté à tout autre sommet. Donc si on a un total de $n$ sommets, alors on aura $bar V bar dot (bar V bar -1) $ connexion au total.
Il faut aussi tenir en compte que chaque sommet sera compté deux fois. Donc, après, on devra diviser par deux pour avoir le nombre total d'arrêtes $ bar E bar$.
$
bar E bar &= binom(bar V bar, 2)\
&= frac(bar V bar dot (bar V bar -1), 2)
$
*(2) Implication: $bar E bar = binom(bar V bar,2) arrow$ G complet*
Ce binôme nous dit que le nombre total d'arrêt $bar E bar$ est équivalent en nombre de combinaisons possibles entre chaque sommet. Donc, ceci implique qu'il est à un nombre total de connexions possible entre chaque sommet. qui est équivalent au nombre d'arrêtes $bar E bar$.
Et donc, si cette égalité est vérifiée, alors on conclut que le graph G est complet. #CQFD
=== Exercice 16
Pour quelles valeurs de $n ∈ NN _0$ existe-t-il un graphe à $n$ sommets dont tous les sommets sont de degré exactement 3 ? Justifier votre réponse.
*Solution*
On sait que dans un graphe complet, chaque sommet sera connecté à tout autre sommet. Donc si on a $N$ sommet, tout sommet sera connecté à $N - 1$ sommet. Donc si on veut avoir un degré exactement égal à 3, on aura 4 sommets.
|
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/003%20-%20Gatecrash/004_Persistence%20of%20Memory.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Persistence of Memory",
set_name: "Gatecrash",
story_date: datetime(day: 23, month: 01, year: 2013),
author: "<NAME>",
doc
)
Sarusin sat in a dimly lit room far beneath the cobbled streets of Ravnica. He knew by the air that he was underground—the smell and sounds were different underground. Where he was exactly he had no idea, which was strange, as Sarusin knew the tunnels under the Seventh District quite well. He should; he grew up in them.
Now he looked about, but nothing seemed familiar. He was somewhere else, although he could not remember how he got there. Just as he moved to get up out of the chair, a soft voice poured out of the darkness at the edge of the candlelight.
"Don't get up." Something about the voice made Sarusin stay in his seat. Something soothing, yet deadly.
#figure(image("004_Persistence of Memory/01.jpg", width: 100%), caption: [Balustrade Spy | Art by Jaime Jones], supplement: none, numbering: none)
"You have been chosen for a very important assignment." A pale man emerged from the darkness. Danger oozed from the man—his bone-white skin shone in stark contrast with his black eyes, black hair, and black leather. Sarusin was a fairly seasoned Dimir agent but he could not control himself and instinctually recoiled. A vampire. "I am here to give you the tools to carry out that assignment, so consider me your... teacher." The vampire bowed before Sarusin with his arms outstretched, but he never took his cold, dead eyes off the agent.
"Where am I?" Sarusin felt his voice emerge as if muttered from another mouth.
"You are in a place unknown to anyone. Even I did not know about this place until you told me." The vampire reached back into the blackness and pulled out a leather carrying case before setting it on the table under the candlelight.
Sarusin's head hurt and his limbs felt a little numb. "What do you mean? I've never been here in my life."
From the leather case the vampire pulled a vial of glowing liquid. As Sarusin looked closer, he noticed it was not the liquid glowing, but rather something within it—something that looked like a patterned strip of paper. The vampire unstoppered the vial and with a pair of delicate, silver tweezers, he plucked the glowing strip of intricately patterned paper from the liquid and held it before Sarusin.
"This strip contains all your memories of this place, how I extracted them from you, how we arrived here, and how we met. I am here to teach you the method of memory excision."
The vampire introduced himself as <NAME>. Sarusin realized he would not leave the place with any knowledge of the vampire. He knew that any information about Mirko would be extremely valuable and briefly thought about secretly writing down that information when he could, but he quickly pushed such dangerous thoughts from his mind. Underneath the civilized demeanor, Mirko was like a hungry snake coiling around a helpless mouse, and Sarusin found his nervous fingers unconsciously twisting a leather tassel on his tunic into tight knots.
"Memories are not as fragile as one might think," Mirko began. "They are a disease. A pleasurable memory, one of a desire fulfilled or an ambition realized, can become an obsession. A dark memory, one engraved in fear and pain, can stalk one to the grave." Mirko held up the strand of glowing memory.
"No memory is innocent. Right now, your mind is trying to reconnect the pathways that I have severed. If I have not been diligent in my work you will begin to reconnect and reform memories from residual associations, random thoughts. Soon you would have vague impressions about our meeting and our journey here and my work will have failed. In the case of our work, the mind of your target is your most powerful enemy and curiosity is its weapon of choice."
Sarusin heard more of psychic skimmers and excisors—mages who specialized in memory assassination and knowledge brokering—the deeper into the rabbit hole of the Dimir network he moved. The other guilds of Ravnica would pay handsomely to gain an advantage over their rivals—especially the Izzet League, who were always restlessly seeking new information.
"How do I learn?"
#figure(image("004_Persistence of Memory/02.jpg", width: 100%), caption: [Mental Vapors | Art by <NAME>], supplement: none, numbering: none)
Mirko opened up the case again and produced another glowing flask. "Here are all the memories you will need." Mirko removed the sealed cap and drew out the long strand of glowing memory. "These memories were removed rather... hastily... so they might be a bit disorienting."
"Wait," Sarusin said abruptly. "You mean those are..."
"Yes. They are the memories of your predecessor. A powerful excisor who became careless. Which reminds me..." With superhuman speed, Mirko had Sarusin in a vise-like grip, his face a mask of murderous undeath. "Do not become careless."
Mirko shoved the trembling man back into his seat, the human-like guise returning like a veil. "Are you ready?"
"How are you going to—"
Sarusin had no time to finish. Mirko pushed the memories into his mind like driving an icicle into his head. As images and knowledge flooded into his awareness like a torrent of debris down a flooded sluiceway, he was somehow aware of his physical body writhing in its chair, his head bursting as Mirko's cold, dead hand pinned him to his chair.
#figure(image("004_Persistence of Memory/03.jpg", width: 100%), caption: [Mind Grind | Art by Daarken], supplement: none, numbering: none)
Sarusin saw—learned—years of training, secret assignments, victims, and techniques, all in a matter of moments. He experienced these flashes as if they were his own memories, but there were some experiences where he felt a mind that was not his own: a mind obsessed with power and control. An ambitious mind far beyond what Sarusin had ever dared to glimpse. Sarusin struggled to keep this mind separate from his own, but he began to lose track of which were his memories and which were the memories of the other. He struggled under the weight of the information, the images, the "other" reality, memories filled with avarice that clawed and chewed at the bars of their new prison.
#figure(image("004_Persistence of Memory/04.jpg", width: 100%), caption: [Last Thoughts | Art by <NAME>], supplement: none, numbering: none)
The victim lay slumped in a chair as the Dimir mage pulled the last few inches of the memory strand from the victim's head. He teased the memory from its domain much like an expert gardener would extract the roots of a prized plant from its earthly home.
He sealed the spell and went to the mirror. For a brief flicker, someone else gazed back at him. A stranger. The thoughts didn't line up with the face that he saw.
He gripped the side of the washbasin. The "other" was slipping in again.
He fiddled with a leather tassel on his tunic, as some part of him tried to cling to something familiar, but the memories began to trickle in. He could feel the dam weakening under the pressure of a new identity forming in his mind. A more powerful identity.
This new body would do nicely.
|
|
https://github.com/Kasci/LiturgicalBooks | https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/SK/zalmy/Z024.typ | typst | K tebe, Pane, dvíham svoju dušu, \* tebe dôverujem, Bože môj:
Nech nie som zahanbený \* a nech moji nepriatelia nejasajú nado mnou.
Veď nik, čo dúfa v teba, nebude zahanbený. \* Ale nech sú zahanbení tí, čo sa pre nič za nič dopúšťajú nevery.
Ukáž mi, Pane, svoje cesty \* a pouč ma o svojich chodníkoch.
Veď ma vo svojej pravde a uč ma, \* lebo ty si Boh, moja spása, a v teba dúfam celý deň.
Rozpomeň sa, Pane, na svoje zľutovanie \* a na svoje milosrdenstvo, ktoré trvá od vekov.
Nespomínaj si na hriechy mojej mladosti a na moje priestupky, \* ale pamätaj na mňa vo svojom milosrdenstve veď si, Pane, dobrotivý.
Pán je dobrý a spravodlivý: \* ukazuje cestu hriešnikom.
Pokorných vedie k správnemu konaniu \* a tichých poúča o svojich cestách.
Všetky cesty Pánove sú milosrdenstvo a vernosť \* pre tých, čo zachovávajú jeho zmluvu a jeho príkazy.
Pre tvoje meno, Pane, \* odpusť mi môj hriech, i keď je veľký.
Ako je to s človekom, čo sa bojí Pána? \* Ukáže mu cestu, ktorú si má vyvoliť.
Z blahobytu sa bude tešiť jeho duša \* a jeho potomstvo bude dedičom zeme.
Pán bude dôverným priateľom tým, čo sa ho boja, \* a zjaví im svoju zmluvu.
Moje oči sa neprestajne upierajú na Pána, \* veď on mi vyslobodzuje nohy z osídel.
Pozriže na mňa a zmiluj sa nado mnou, \* lebo som sám a úbohý.
Uľav mi v úzkosti srdca \* a vytrhni ma z mojich tiesní.
Pozri na moju pokoru a na moje trápenie \* a odpusť mi všetky priestupky.
Pozri, ako sa moji nepriatelia rozrástli \* a nenávidia ma ukrutne.
Ochraňuj moju dušu a vysloboď ma; \* nech nie som zahanbený, že sa utiekam k tebe.
Nech ma ochráni nevinnosť a statočnosť, \* veď sa pridŕžam teba.
Bože, vysloboď Izraela \* zo všetkých jeho súžení. |
|
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/002%20-%20Return%20to%20Ravnica/007_Slaughter%20Games.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Slaughter Games",
set_name: "Return to Ravnica",
story_date: datetime(day: 17, month: 10, year: 2012),
author: "<NAME>",
doc
)
Maritta slammed the door and slammed down the crossbar. It landed with a solid thud, barring her family's door and protecting them from The Rakdos outside. The guild was on parade, filling the streets with a dreadful cacophony of dragging chains, mad cackling, and the screams of agony by those who were swept up in their gruesome marching carnival.
Maritta crumpled and fell with her back to the wall, reaching out to pull her two children close. She whispered soothing words to her terrified children, trying to reassure them that they were safe now from the monsters stomping past their home.
The mob paraded by, filled with deranged glee. Homes, businesses, temples, and even government buildings, closed and barred their doors as the vanguard of the Rakdos approached. It was a terrifyingly long procession, composed of almost all of the Rakdos guild's ranks.
#figure(image("007_Slaughter Games/01.jpg", width: 100%), caption: [Gore-House Chainwalker | Art by Dan Scott], supplement: none, numbering: none)
Amidst the bloody parade, the carnival was in full swing with bladed stilt walkers, a mobile aerial-chain act, body-pierced high-flying trapeze artists, and other ghastly sights.
Every member of Rakdos carried a murderous grin, being deliriously happy, for today marked the beginning of their Slaughter Games. The competition had been announced as three of Rakdos' rings battled over a recently vacated territory, and to make the most of the conflict, it was put up as prize for this Slaughter Games.
The Slaughter Games consume the guild for as long as it takes, until the victors stand bloodied but victorious. Only a fraction of the Rakdos followers will the games, to do so is to put life and limb on the line. They willfully put their life at risk for the spectacle of the games out of devotion for their demonic leader.
Darux had been a champion Spiker for four years' Slaughter Games, though the games aren't annual, so he had actually been a winner through seven Slaughter Games, until last year when he was dethroned by an upstart from Massacre Girl's ring: Vildika. A tall and tightly corded female human, who got the killing blow on a particularly agile victim that had dodged Darux's deadly swing of the hammer, only to be caught by one of Vildika's bladed boots in a graceful spinning kick. Darux found himself defeated and Vildika crowned champion for the year's games.
Darux's previous ringleader was the very unusual Stroko, a goblin who devoted himself to Rakdos. Stroko had made good use of Darux as a Spiker, he kept the little peace which benefited Stroko and caused the chaos which would further Stroko's goals. After Darux was defeated he was worthless to Stroko and with great derision he insulted Darux amidst a Slaughter Games feast. Darux, outraged, rose to his feet so quickly that he knocked over the feast table, scattering food and drink everywhere. He tore off his vest that bore the sigil of Stroko's ring and threw it down before storming out.
He would start his own ring.
#figure(image("007_Slaughter Games/02.jpg", width: 100%), caption: [Rakdos Ringleader | Art by <NAME>], supplement: none, numbering: none)
He left the tent alone. Many bristled at the poor treatment of Darux, but none had been outraged enough to follow him during his exit from Stroko's ring. It had taken him some weeks, but he had grown his own upstart ring. Darux had battled for territory and carved out a niche not too far from the festival grounds.
Finally, the Slaughter Games had arrived once again and Darux now marched past Maritta's door, his ring marching around him. He wore a vest with a sigil of his own on his broad shoulders. He hung chains of his status around his shoulders, using large links to intimidate all who beheld his already massive frame. Further, he carried his spiked hammer on one shoulder, with his other hand leading the chains of his ring's supplicants.
Darux may be a spiker, a pierced titan towering over the members of his ring, but he had discovered he also had a good mind for business. As angry as he was at Stroko's insult, he had learned a good deal from him. As chaos and frivolity reigned among the cult's ranks, it was the higher ups who were tasked with carefully managing it to the prosperity of all. It was up to the ringmasters to organize, fund, and let the carnival continue in order to please Rakdos himself. And though he did not appear, every ringmaster knew that Rakdos watched these games with interest.
Because of this, Darux hoped to find his ring elevated after they proved themselves at the Slaughter Games.
Only a few weeks ago he had recruited Vildika away from Massacre Girl. She walked beside him now, head held proudly high. She wore a form fitting and low cut dress with rows of piercings on her delicate features. In just these few weeks since her arrival Vildika had proven herself a valuable ally and confidant in the matters of the ring, and he had found himself falling for her.
#figure(image("007_Slaughter Games/03.jpg", width: 100%), caption: [Deviant Glee | Art by <NAME>], supplement: none, numbering: none)
As the ringmaster, Darux had begrudgingly chose not to compete, instead allowing Vildika to represent his ring in the games. He bristled as he thought how he would be a spectator this year, but he also knew that it was for the best. He was earning Rakdos' approval through his work outside of the arena now.
As the enormous archway into the festival grounds neared he looked through it's high arch and saw an apparent waterfall of blood. Animal, human, centaur, and perhaps even merfolk, any being who had been swept up in the pregame activities, was now used to welcome Rakdos' followers to the Slaughter Games. Darux grasped the spiked hammer in his massive fist and lifted it above his head as his ring entered the grounds, surrounded by shouts and jeers.
Though the games were only for the strongest of wills, it drew countless onlookers. They stood on the edge of the grounds, quick to retreat and scatter for fear of suddenly finding themselves the latest plaything in the games. They had all come to see the horrifying games as they played out, and they were never disappointed.
#figure(image("007_Slaughter Games/04.jpg", width: 100%), caption: [Rakdos Ragemutt | Art by <NAME>], supplement: none, numbering: none)
Darux led his ring to the area he had chosen for their camp, directing them as to where to setup their tents and hammer the stakes. Once the procession had finished and all the various rings were settled, dark had fallen on Ravnica. The fairgrounds were lit by numerous fires, and the normally loud and cacophonous guild had quieted somewhat as they prepared for the games the next day.
The other ring members were gone and it was just Darux and Vildika sitting together next to the fire. Darux sharpened his spiked hammer before slamming it down on the remnant carcass of the beast that had been their dinner, testing it's point. Vildika had removed her boots and was reclining next to him, pricking her fingers absentmindedly as she watched the blood well.
"Do you miss <NAME>?" Darux asked questioningly between strokes of the whetstone. He was honestly curious. She had joined him willingly but he knew also that they had been close for many years. "I mean her, and her ring."
Showing little emotion Vildika replied, "Rarely." And after a moment's pause she added, "I joined your ring because it was clear that she no longer saw me as anything but a combatant in the games, a trophy. I was her trophy to parade around, not a member to share the carnival with." Emotion had crept into her voice as she spoke, anger intermingling with sadness.
Darux considered her response, it wasn't unsurprising. It was common for ringleaders to take their Slaughter Game victors and raise them onto a dais. Stroko had done the same to him for years, but in those times he had enjoyed it. He was celebrated, known, and he had whatever it was that he wanted - except for closeness to anyone but Stroko. Oh sure he had companions to enjoy the bloody carnivals and circus, and he never wanted for much, but he had had plenty of time to reflect back on who he had been and compare with who he was now.
"Are you ready to compete tomorrow?" Darux still could not hide the fact he wished he was in the competition.
Vildika's sharp laugh rang through the ring's tents, "Have you seen the spikers from other rings? They're pathetic. Even Erzadalt, that hulk that Reneir has been grooming for years. He's hardly ready and I'll strike him down without a worry. It almost doesn't seem sporting this time around." She pricked her index finger in three quick motions, watching the blood well before it slid down her finger into her palm.
#figure(image("007_Slaughter Games/05.jpg", width: 100%), caption: [Slaughter Games | Art by <NAME>], supplement: none, numbering: none)
Darux nodded, he had felt the same way for many years, completely confident in his victory. And even last time he had been confident in his victory, at least until Vildika surprised everyone.
"How much did you wager on me?" Curiosity clear in her voice. Ringleaders always made wagers with one another over the games, sometimes for money, sometimes for people, and sometimes for promises.
"More than I did on anyone else." Darux had wagered across all of his combatants and games participants, but he had wagered the majority of his ring's stockpile on Vildika. A move his moneykeepers were none too happy with.
Vildika, pricked her finger one more time and clenched the bloody fingers into a fist. She allowed herself to smile. Tomorrow, the games would finally begin.
|
|
https://github.com/talal/ilm | https://raw.githubusercontent.com/talal/ilm/main/README.md | markdown | MIT No Attribution | # ‘Ilm
> ‘Ilm (Urdu: عِلْم) is the Urdu term for knowledge. It is pronounced as [/ə.ləm/](https://en.wiktionary.org/wiki/%D8%B9%D9%84%D9%85#Urdu).
A versatile, clean and minimal template for non-fiction writing. The template is ideal for
class notes, reports, and books.
It contains a title page, a table of contents, and indices for different types of figures;
images, tables, code blocks.
Dynamic running footer contains the title of the chapter (top-level heading).
See the [example.pdf](https://github.com/talal/ilm/blob/main/example.pdf) file to see how it looks.
## Usage
You can use this template in the Typst web app by clicking "Start from template" on the
dashboard and searching for `ilm`.
Alternatively, you can use the CLI to kick this project off using the command
```sh
typst init @preview/ilm
```
Typst will create a new directory with all the files needed to get you started.
This template uses the [Iosevka] font for raw text. In order to use Iosevka, the font must
be installed on your computer. In case Iosevka is not installed, as will be the case for
Typst Web App, then the template will fall back to the default "Fira Mono" font.
## Configuration
This template exports the `ilm` function with the following named arguments:
| Argument | Default Value | Type | Description |
| --- | --- | --- | --- |
| `title` | `Your Title` | [content] | The title for your work. |
| `author` | `Author` | [content] | A string to specify the author's name |
| `paper-size` | `a4` | [string] | Specify a [paper size string] to change the page size. |
| `date` | `none` | [datetime] | The date that will be displayed on the cover page. |
| `date-format` | `[month repr:long] [day padding:zero], [year repr:full]` | [string] | The format for the date that will be displayed on the cover page. By default, the date will be displayed as `MMMM DD, YYYY`. |
| `abstract` | `none` | [content] | A brief summary/description of your work. This is shown on the cover page. |
| `preface` | `none` | [content] | The preface for your work. The preface content is shown on its own separate page after the cover. |
| `table-of-contents` | `outline()` | [content] | The result of a call to the [outline function][outline] or none. Setting this to `none` will disable the table of contents. |
| `bibliography` | `none` | [content] | The result of a call to the [bibliography function][bibliography] or none. Specifying this will configure numeric, IEEE-style citations. |
| `chapter-pagebreak` | `true` | [bool] | Setting this to `false` will prevent chapters from starting on a new page. |
| `external-link-circle` | `true` | [bool] | Setting this to `false` will disable the maroon circle that is shown next to external links. |
| `figure-index` | `(enabled: false, title: "Index of Figures")` | [dictionary] | Setting this to `true` will display a index of image figures at the end of the document. |
| `table-index` | `(enabled: false, title: "Index of Tables")` | [dictionary] | Setting this to `true` will display a index of table figures at the end of the document. |
| `listing-index` | `(enabled: false, title: "Index of Listings")` | [dictionary] | Setting this to `true` will display a index of listing (code block) figures at the end of the document. |
> [!NOTE]
> The language setting for text (`lang` parameter of `text` function) should be defined before the `ilm` function so that headings such as table of contents and bibliography will be defined as per the text language.
The function also accepts a single, positional argument for the body.
The template will initialize your package with a sample call to the `ilm` function in a
show rule. If you, however, want to change an existing project to use this template, you
can add a show rule like this at the top of your file:
```typ
#import "@preview/ilm:1.2.1": *
#show: ilm.with(
title: [Your Title],
author: "<NAME>",
date: datetime(year: 2024, month: 03, day: 19),
abstract: [#lorem(30)],
bibliography: bibliography("refs.bib"),
figure-index: (enabled: true),
table-index: (enabled: true),
listing-index: (enabled: true)
)
// Your content goes below.
```
[iosevka]: https://typeof.net/Iosevka/
[bibliography]: https://typst.app/docs/reference/model/bibliography/
[outline]: https://typst.app/docs/reference/model/outline/
[bool]: https://typst.app/docs/reference/foundations/bool/
[content]: https://typst.app/docs/reference/foundations/content/
[datetime]: https://typst.app/docs/reference/foundations/datetime/
[dictionary]: https://typst.app/docs/reference/foundations/dictionary/
[paper size string]: https://typst.app/docs/reference/layout/page#parameters-paper
[string]: https://typst.app/docs/reference/foundations/str/
|
https://github.com/cecoeco/indic-numerals | https://raw.githubusercontent.com/cecoeco/indic-numerals/main/README.md | markdown | MIT License | <div>
<a href="https://github.com/cecoeco/indic-numerals/blob/main/LICENSE.md"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg"></a>
</div>
## indic-numerals
<i>convert arabic numerals to indic numerals and vice versa</i>
```typst
#import "@preview/indic-numerals:0.1.0": arabic-to-indic, indic-to-arabic, tamil-to-arabic, arabic-to-tamil
#indic-to-arabic("௦௧௨௩௪௫௬௭௮௯") // Output: 0123456789
#arabic-to-indic("0123456789", "tamil") // Output: ௦௧௨௩௪௫௬௭௮௯
#tamil-to-arabic("௦௧௨௩௪௫௬௭௮௯") // Output: 0123456789
#arabic-to-tamil(0123456789) // Output: ௦௧௨௩௪௫௬௭௮௯
``` |
https://github.com/freundTech/typst-matryoshka | https://raw.githubusercontent.com/freundTech/typst-matryoshka/main/doc/matryoshka.typ | typst | MIT License | #import "@preview/mantys:0.1.4": *
// Vendored because of https://github.com/jneug/typst-mantys/pull/20
#let cmdref(name) = {
link(cmd-label(name), cmd-(name))
}
// End Vendored
#import "/lib.typ"
#let date = datetime(year: 2024, month: 07, day: 02)
#let matryoshka = package[matryoshka]
#show: mantys.with(
..toml("/typst.toml"),
title: [matryoshka],
subtitle: [Nested compilers],
date: datetime.today(),
abstract: [
#matryoshka, named after the famous nesting dolls, is a typst compiler as a typst plugin.
It allows you to compile typst documents form within typst.
This is especially useful for documentation authors, who might want to display example code and resulting document in their documentation.
#matryoshka renders typst code to svg and then embeds that svg into your original document.
],
examples-scope: (matryoshka: lib),
)
= About
#matryoshka, named after the famous nesting dolls, is a Typst package that bundles a full Typst compiler as a Typst plugin.
This allows you to render Typst documents from within your Typst documents.
Why would you want to do this?
If you are a documentation author you might want to show Typst source code and the resulting document side-by-side in your documentation.
Without #matryoshka you would have to save your example code into separate files, compile it manually and then finally load both the source code and the generated image from your main document.
#matryoshka simplified this process.
Just write the example code directly into your document and use a `#show` rule to show both the code and the resulting document.
#example()[
````typ
#show <example>: it => {
set grid.cell(inset: 1em, align: horizon)
grid(
columns: 2,
gutter: 1em,
grid.cell(stroke: 1pt, it),
grid.cell(fill: silver, matryoshka.compile(it.text))
)
}
```typ
#align(center, text(17pt)[
*A fluid dynamic model
for glacier flow*
])
#grid(columns: (1fr, 1fr), align: center)[
<NAME> \
#link("mailto:<EMAIL>")
][
Dr. <NAME> \
#link("mailto:<EMAIL>")
]
#pagebreak()
#lorem(100)
```<example>
````
]
= Usage
== Using MATRYOSHKA
MATRYOSHKA is imported using
#codesnippet[```typ
#import "@preview/matryoshka:0.1.0"
```]
You can then use the #cmdref("compile") and #cmdref("compile-pages") commands to render Typst code.
While #cmdref("compile") returns #dtype("content") directly, #cmdref("compile-pages") returns an #dtype("array"), which can be used when more control over how the pages are displayed is needed.
#codesnippet[```typ
#matryoshka.compile("= Hello World")
```]
Because pages are #doc("visualize/image") elements they are affected by #doc("visualize/image") set and show rules.
#codesnippet[```typ
#set image(width: 3cm)
#matryoshka.compile("= Hello World")
```]
Note that in contrast to a normal Typst compiler, MATRYOSHKA automatically uses a page height of #value(auto). You can change this using a set rule in the code you want to compile.
== Available Commands
#tidy-module(
read("/lib.typ"),
name: "matryoshka",
include-example-scope: true,
)
|
https://github.com/Mc-Zen/quill | https://raw.githubusercontent.com/Mc-Zen/quill/main/docs/architecture.md | markdown | MIT License | # Architecture
The main algorithm used in `quantum-circuit` for circuit layout is quite intricate and is described here broadly for a better overview. The algorithm specifically takes care of the following things:
- Not drawing wires through gates: this way we can also use transparent gates.
- Computing the bounding box of the circuit: it also treats labels that can be attached to almost anything.
- Computing the position of automatically placed items.
- Custom spacing between rows and columns (so-called gutters).
- Correctly adjusting the wire distance according to the gate heights: especially for the case of multi-qubit gates.
## Notes
### Differentiation between single-qubit and multi-qubit gates
`quill` differentiates between ordinary single-qubit gates (such as a Hadmard gate) and multi-qubit-gates. The latter are generalized gates that can
a) span across multiple qubits,
b) have a control wire towards some target qubit,
c) have both.
This differentiation is used because multi-qubit gates require much more care and processing.
### Anatomy of a cell
```
cell gutter
┌─────────┬──┐ ┐
│ ┌───┐ │ │ │
wire ─┼──┤ H ├──┼──┼─ │ cell height
│ └───┘ │ │ │ ┐
└─────────┴──┘ ┘ ┘ 0.5*row-spacing
└─────────┘
cell width
└──┘
0.5*column-spacing
```
A quantum circuit is made up of a matrix of cells. Gates are by default placed in the middle of a cell (exception for example `lstick`) and wires _always_ run through vertically centered through the cell.
The padding of the cell is determined by the value of `column-spacing` and `row-spacing`. These lengths can be specified in `quantum-circuit()` and are added to the size of the gate to compute a temporary cell size. The largest cell in a row and column determines the final cell width and height. If `equal-row-heights` is true, then all rows are resized to match the largest row. To the right of each cell (or rather column) is an optional gutter that has zero width by default. Additional row gutters can increase the spacing between rows.
As an example, this code
```typ
#quantum-circuit(
1, $H$, 10pt, ctrl(1), 1, [\ ], 15pt
2, 5pt, $X$, 1
)
```
produces a circuit according the following schematic:
```
col 0 col 1
┌─────────┬──┬─────────┬┐
│ ┌───┐ │ │ ││
wire 0 ─┼──┤ H ├──┼──┼────o────┼┼─
│ └───┘ │ │ │ ││
├─────────┼──┼────┼────┼┤
├─────────┼──┼────┼────┼┤ ← 15pt row gutter
│ │ │ ┌─┴─┐ ││
wire 1 ─┼─────────┼──┼──┤ X ├──┼┼─
│ │ │ └───┘ ││
└─────────┴──┴─────────┴┘
↑ ↑
10pt gutter 0pt gutter
```
Note, that the `5pt` gutter is overridden by the `10pt` gutter in the same column.
## Description of the `quantum-circuit()` layout algorithm
The algorithm is roughly divided into two parts. First, we iterate over all children, determine their position and compute the layout. In the second step, the actual circuit is created by composing the different item groups:
- decorations
- horizontal and vertical wires
- single-qubit-gates and multi-qubit gates.
### Preprocessing
First, "auto"-gates are processed, i.e., we replace `str` and `content` items (like `$H$`) with gates.
### Build Matrix
All gates are arranged in a grid — the _matrix_. By default, gates are placed automatically, advancing the column index but gates can also be explicitly placed in a specific cell. In the first pass through all children, we:
- Determine the matrix position of automatically placed items.
- Add an entry to the matrix for each gate that contains the `size` of the gate, whether the gate is in `box` mode and some gutter value for optional spacing after the corresponding column. Empty cells simply have a size of 0. The matrix is automatically resized to accommodate for new gates. Each cell can only host one item.
- Store all column gutters (specified by `length` children after a gate).
- Store row gutters separately (specified by `length` children after a `[\ ]`).
- Store all `setwire()` instructions in an array to be processed later.
- Put all normal (non-controlled or multi-qubit) gates in an array `single-qubit-gates`.
- Put multi-qubit-gates (including controlled gates) in an array `multi-qubit-gates`.
- Store all decorations (such as `slice`, `gategroup`, or `annotate`) together with their cell position in an array.
The matrix requires some post-processing to equalize the row lengths. The column gutters are computed as the maximum gutters per column across all rows.
### Process multi-qubit gates
For all multi-qubit gates that have a `target`, a (vertical) control wire instruction is stored containing column, starting and target wire, as well as the wire style.
If a gate spans across multiple qubits, the size-hints `width` is unconditionally set to the width of the gate for all cells that the gate contains. This is important for wire placement. Additionally, if the `size-all-wires` parameter requires it, the cell height is set to the same value as well.
### Finish layout computation
Now the necessary height of each row and the width of each column can be computed using the size hints stored in the matrix. In both cases the maximum value per column/row is used. For ease of access the center coordinates of each column and row is computed from the row heights, column widths and row/column gutters.
### Build circuit
In this step, the circuit is crafted from the individual components. First, the decorations (`slice`, `gategroup`, `annotate`) are drawn on two layers (one below the circuit which is applied immediately and one above the circuit which is applied later on). Afterwards, the horizontal and verticals wires are drawn. Here, we need to take care not to drawn _through_ a gate and use the size hints from the matrix cells. Then, the gates are drawn and finally the second the decoration layer is applied.
Most items in the circuit feature the attachment of labels at each side. In order to accommodate for their size and to appropriately pad the circuit, the bounds of the circuit need to be updated for each item with labels. These contain gates, decorations, and vertical wires.
### Apply scaling and bounds extension
Finally, the entire circuit is scaled according to the `scale` argument and padded with the bounds that were computed in the building step. |
https://github.com/youwen5/linear-algebra-done-wrong | https://raw.githubusercontent.com/youwen5/linear-algebra-done-wrong/main/notes/main.typ | typst | #import "@preview/unequivocal-ams:0.1.0": ams-article, theorem, proof
#show: ams-article.with(
title: [Notes on Linear Algebra Done Wrong], authors: (
(
name: "<NAME>", organization: [University of California, Santa Barbara], email: "<EMAIL>", url: "https://youwen.dev",
),
),
)
= Chapter 1
== Vector spaces
- Axioms -- familiar rules of algebra, just applied to vectors
- Cannot mix vectors + scalars in axioms
== Linear combinations, bases
- A system of vectors $v_1, v_2, ..., v_n in V$ is called a basis for $V$ if any
vector $v$ admits a _unique_ representation
$ v = sum^p_(k=1) a_k v_k $
- Standard basis in $FF^n$ (where $FF$ is $RR$ or $CC$)
$ e_1 = vec(1, 0, 0, dots.v, 0), e_2 = vec(0, 1, 0, dots.v, 0), e_3 = vec(0, 0, 1, dots.v, 0), ..., e_n = vec(0, 0, 0, dots.v, 1) $
- Standard basis for $PP_n$ (the polynomials of degree at most $n$)
$ e_0 := 1, e_1 := t, e_2 := t^2, e_3 := t^3, ..., e_n := t^n $
- A system of vectors $v_1, v_2, ..., v_p in V$ is a _generating system_ (also _spanning system_ or _complete system_)
in $V$ if any vector $v in V$ admits representation as a linear combination of $v_1, v_2, ..., v_p$
- Only difference from def. of basis is that we do not assume the representation
is _unique_
- A linear combination $alpha_1 v_1 + alpha_2 v_2 + ... + alpha_p v_p$ is called _trivial_ if $a_k = 0 " " forall k$.
- *Trivial linear combination* is always equal to $0$
- A system of vectors $v_1, v_2, ... v_p in V$ is called _linearly independent_ if
only the trivial linear combination of $v_1, v_2, ..., v_p$ equals $0$.
- In other words, the system is linearly independent $<==>$ $x_1 v_1 + x_2 v_2 + ... + x_p v_p = 0$ has
only the trivial solution $x_1 = x_2 = ... x_p = 0$
- If a system is not linearly independent, it is _linearly dependent_
- A system of vectors $v_1, v_2, ..., v_p$ is called linearly dependent if
there exist scalars $alpha_1, alpha_2, ..., alpha_p$, where
$ sum^p_(k=1) |a_k| != 0 \
"such that" sum^p _(k=1) a_k v_k = 0 $
- Alternatively, a system $v_1, v_2, ..., v_p$ is linearly independent $<==>$ the
equation
$ x_1 v_1 + x_2 v_2 + ... + x_p v_p = 0 $
has a *non-trivial* solution
- Non-trivial meaning _at least one_ $x_k$ is different from 0, or
$ sum^p _(k=1) |x_k| != 0 $
_Remark._ Another notion of linear independence or dependence (best understood
in a Cartesian plane or 3-D space) is whether or not each vector affords an
additional "dimension" of movement. If each vector allows access to a new
dimension, then the only way to remain at $0$ (the origin) is for each vector to
be scaled by coefficient $0$. Otherwise, if two vectors access the exact same
dimensions, they can be scaled in such a way to negate each other, allowing $0$ to
be represented with non-zero coefficients.
#theorem[ A system of vectors $v_1, v_2, ..., v_p in V$ is linearly dependent $<==>$ one
of the vectors, $v_k$, can be represented as a linear combination of the other
vectors
$ v_k = sum^(p)_(j=1 and j != k) beta_j v_j $ ]<linear-independent-combination>
#proof[
Suppose that we have a system $v_1, v_2, ..., v_p$ that is linearly dependent.
Then, for some indices $k$, we must have
$ sum^p_(k=1) |alpha_k| != 0 $
Then we can write the system as
$ alpha_k v_k + sum^p_(j=1 and j!=k) alpha_j v_j = 0 $
Moving terms around, we have
$ v_k = sum^p_(j=1 and j!=k) - alpha_j/alpha_k v_j $
Which is $v_k = sum^(p)_(j=1 and j != k) beta_j v_j$, with $beta_j = - alpha_j/alpha_k$.
]
- Trivially, any basis is a linearly independent system
- Recall that a basis in $V$ allows any vector $in V$ a unique representation as $sum_(k=1)^p a_k v_k$
- This implies $0$ is given a unique representation by the basis. Since the
trivial linear combination always gives zero, regardless of linear
(in)dependence, the trivial linear combination must also be the _only one_ giving $0$,
satisfying the definition of linear independence.
Conversely,
#theorem[
A system of vectors $v_1, v_2, ..., v_n in V$ is a basis $<==>$ it is linearly
independent and complete.
]
#proof[
#let aa = $accent(alpha, ~)$
We seek to show that if a system of vectors is linearly independent and
complete, then it is a basis. Suppose we have a system $v_1, v_2, v_3, ..., v_p in V$,
which is linearly independent and complete.
Consider any vector $v in V$. Since the system is complete, $v$ can be
represented as a linear combination
$ v = sum_(k=1) ^p alpha_k v_k $
This satifies part of the definition of a basis. We need only show that this
representation is _unique_. Say we have another $aa_k$ such that admits
representation as a linear combination
$ v = sum_(k=1) ^p aa_k v_k $
Then,
$
v = sum_(k=1) ^p (alpha_k - aa_k) v_k = sum_(k=1) ^p alpha_k v_k - sum_(k=1) ^p aa_k v_k = v - v = 0 \
$
Because it's linearly independent, only the trivial linear combination can equal $0$,
and
$ sum ^p _(k=1) |a_k| = 0 $
So $alpha_k - aa_k = 0 " " forall k$, $a_k = aa_k$ implying that $aa_k$ does not
admit a separate representation. Thus,
$ v = sum_(k=1) ^p alpha_k v_k $
is unique.
]
#theorem[
Any (finite) generating system contains a basis.
]
#proof[
Suppose $v_1, v_2, v_3, v_p in V$ is a generating set. If it's also linearly
independent, then it's a basis and we are done. Otherwise, it's linearly
dependent, and there is at least one vector $v_k$ which can be represented as a
linear combination of the other vectors.
Thus, we can remove $v_k$ from our set, and it remains complete. If the set is
still linearly dependent, then repeat the process. If we remove all items, then
we have $emptyset$ and it's not a generating system. Therefore, we can eliminate
all $v_k$ which can be represented as the linear combination of other vectors $v_j$,
and we are left with a linearly independent and complete set of vectors, or a
basis.
]
== Linear Transformations. Matrix-vector multiplication
- _Transformation_ $T: X -> Y$ is a rule that for each $x in X$, $y = T(x) in Y$
- The _set_ $X$ is called the _domain_ of $T$, and the set $Y$ is called the _target space_ or _codomain_ of $T$.
*Definition.* Let $V, W$ be vector spaces (over the same field $FF$). A
transformation $T : V -> W$ is called linear if
+ $T(u + v) = T(u) + T(v) " " forall u, v in V$
+ $T(alpha v) = alpha T(v) " " forall v in V "and" forall "scalars" alpha in FF$
- #[Linear transformations $T: RR -> RR$ can be given by
$ T(x) = a x "where" a = T(1) $
Any linear transformation of $RR$ is just multiplication by a constant ]
- #[A linear transformation $T : FF^n -> FF^m$ can also be represented as
multiplication, but by matrix, not scalar]
- #[For $T : FF^n -> FF^m$, it is sufficient to know how $T$ acts on the standard
basis of $FF^n$ to compute $T(x)$ for all vectors $x in FF^n$.]
- #[If you want $A x = T(x)$, then you have the _column by coordinate_ rule
$ A x = sum ^n _(k=1) x_k a_k = x_1 vec(a_(1,1), a_(2, 1), dots.v, a_(m, 1)) + x_2 vec(a_(1,2), a_(2, 2), dots.v, a_(m, 2)) + ... + x_n vec(a_(1,n), a_(2, n), dots.v, a_(m, n)) $
]
|
|
https://github.com/cadojo/vita | https://raw.githubusercontent.com/cadojo/vita/main/src/socials.typ | typst | MIT License | #let socialslist = state("socialslist", ())
#let social(
name, icon: none,
) = {
let social = if icon == none {
name
} else {
box(image("../" + icon, height: 1.5em), baseline: 20%)
h(1em)
name
}
socialslist.update(current => current + (social,))
}
#let socials(header: "Social Media", color: white, size: 11pt) = {
locate(
loc => {
let socialslist = socialslist.final(loc)
if socialslist.len() > 0 {
heading(level: 1, text(color, header))
set text(color, size: size)
block(
align(left)[#socialslist.join("\n")]
)
}
}
)
}
|
https://github.com/fredguth/abnt-typst | https://raw.githubusercontent.com/fredguth/abnt-typst/main/templates/pre.typ | typst | #import "../_config.typ": metadados, estilo
// Definições úteis =================================================
#let base = (lang: "pt", fill: luma(10), tracking: 0pt, stretch: 100%, style: "normal")
#let regular =(..base, font: estilo.fonte.serif, weight: "regular", size: estilo.fonte.tamanho.regular)
#let small = (..base, font: estilo.fonte.serif, weight: "regular", size: estilo.fonte.tamanho.small, style: "italic")
#let sans =(..regular, font: estilo.fonte.sans)
#let mono =(..base, font: estilo.fonte.mono, weight: "regular", size: estilo.fonte.tamanho.tiny)
#let t1 = (..base, font: estilo.fonte.sans, weight: "black", size: estilo.fonte.tamanho.huge)
#let t2 = (..t1, weight: "regular", size: estilo.fonte.tamanho.larger)
#let t3 = (..t1, weight: "light", size: estilo.fonte.tamanho.large)
#let t4 = (..t2, size: estilo.fonte.tamanho.regular)
#let display = (..base, font: estilo.fonte.sans, weight: "medium", size: estilo.fonte.tamanho.small, tracking: estilo.fonte.tamanho.small/6 )
#let pagina_branca = () => [
#pagebreak()
#align(center+bottom, text(..small, [Página intencionalmente deixada em branco.]))
#pagebreak(to: "odd")
]
#let blockquote = (q) => par(leading:0.63em, text(font: estilo.fonte.serif, weight: "regular", size: 90%*estilo.fonte.tamanho.regular, align(right+bottom, pad(left: 4cm, q))))
#let strong = (q) => text(weight: 600, q)
// CAPA (obrigatório) ================================================
// ABNT NBR 14724:2011 §4.1.1 - Capa
// Elemento obrigatório. As informações são apresentadas na seguinte ordem:
// a) nome da instituição (opcional);
// b) nome do autor;
// c) título: deve ser claro e preciso, identificando o seu conteúdo e possibilitando a indexação e recuperação da informação;
// d) subtítulo: se houver, deve ser precedido de dois pontos, evidenciando a sua subordinação ao
// título;
// e) número do volume: se houver mais de um, deve constar em cada capa a especifi cação do
// respectivo volume;
// f) local (cidade) da instituição onde deve ser apresentado;
// NOTA No caso de cidades homônimas recomenda-se o acréscimo da sigla da unidade da federação.
// g) ano de depósito (da entrega).
#v(.5cm)
#set text(..display)
#upper[#metadados.tipo_trabalho]
#v(4cm)
#let bloco_titulo = [
#set text(..t3)
#metadados.autor.nome
#v(.5cm)
#set text(..t1)
#metadados.titulo
#if (metadados.subtitulo != none){[:]}
#set text(..t2)
#v(-.1cm)
#metadados.subtitulo
]
#bloco_titulo
#v(13.2cm)
#let bloco_rodape = [
#set text(..t2, weight: "black")
#grid(gutter:0pt, columns: (1fr, 1fr), align(left + bottom, [#metadados.publicacao.data #text(..t2, [#metadados.publicacao.local])]), align(right+bottom, if (metadados.publicacao.logo_instituicao !=none){image(metadados.publicacao.logo_instituicao)}))
]
#place(bottom + center, bloco_rodape)
// Verso Capa ============+++===========================
#pagina_branca()
// Folha de Rosto (Obrigatório) ==============================
// ABNT NBR 14724:2011 §4.2.1.1 - Folha de Rosto
// Elemento obrigatório. Apresentada conforme 4.2.1.1.1 e 4.2.1.1.2.
// 4.2.1.1.1 Anverso
// Os elementos devem ser apresentados na seguinte ordem:
// a) nome do autor;
// b) título;
// c) subtítulo, se houver;
// d) número do volume, se houver mais de um, deve constar em cada folha de rosto a especifi cação
// do respectivo volume;
// e) natureza: tipo do trabalho (tese, dissertação, trabalho de conclusão de curso e outros) e objetivo
// (aprovação em disciplina, grau pretendido e outros); nome da instituição a que é submetido; área
// de concentração;
// f) nome do orientador e, se houver, do coorientador;
// g) local (cidade) da instituição onde deve ser apresentado;
// h) ano de depósito (da entrega).
#v(4.5cm)
#bloco_titulo
#v(3.5cm)
#set text(..display)
#pad(left:5.7cm, upper[#metadados.titulacao_objetivo])
#v(.5cm)
#set text(..t4)
#pad(left:5.7cm)[#metadados.publicacao.preambulo]
#v(4.5cm)
#set text(..t3, size: estilo.fonte.tamanho.regular)
#upper[#metadados.programa_pos]
#v(-.1cm)
#upper[#metadados.departamento]
#place(bottom + center, bloco_rodape)
#pagebreak()
// Verso Folha de Rosto =============================
// ABNT NBR 14724:2011 §4.2.1.1 - Folha de Rosto
// 4.2.1.1.2 Verso
// Deve conter os dados de catalogação-na-publicação, conforme o Código de Catalogação Anglo-Americano vigente.
#set text(..mono)
#let licenca = block(inset: 0pt, width: 12cm,
[
#metadados.titulo #sym.copyright #metadados.autor.nome licenciada sob os termos da Licença Creative Commons
*Atribuição-NãoComercial-SemDerivações 4.0 Internacional*
*CC BY-NC-ND 4.0 DEED*
#v(.4cm)
#grid(columns:(1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr), [],[],image("../arquivos/cc.svg", width: 1cm), image("../arquivos/Cc-by_new.svg", width:1cm),image("../arquivos/Cc-nc.svg", width: 1cm), image("../arquivos/Cc-nd.svg", width:1cm),[],[])
])
// ! Ficha não está funcionando para mais de um orientador e orientador/coorientador
#let desc_trabalho = if ("Mestrado" in metadados.tipo_trabalho or "Mestrado" in metadados.titulacao_objetivo) [Dissertação (Mestrado - #metadados.titulacao_objetivo)] else if ("Tese" in metadados.tipo_trabalho or "Tese" in metadados.titulacao_objetivo) [Tese (Doutorado - #metadados.titulacao_objetivo)] else [#metadados.titulacao_objetivo]
#let ficha = rect(width: 12cm, height: 7.5cm, inset: 0.5cm, [
#align(top + left, [
#grid(columns:(2cm, 1fr), [#linebreak() #metadados.codigo_cutter]
,[
#set par(first-line-indent: 2em)
#metadados.autor.sobrenome_nome
#metadados.titulo #if (metadados.subtitulo != none){[: #metadados.subtitulo]} / #metadados.autor.nome ; orient. #metadados.supervisao.orientadores.at(0).nome -- #metadados.publicacao.local, #metadados.publicacao.data.
#let total_pages = locate(loc => counter(page).final(loc).at(0))
#total_pages p.
#desc_trabalho -- #metadados.publicacao.instituicao, #metadados.publicacao.data.
#metadados.publicacao.palavras-chave
#v(2cm)
#align(right+bottom, [#metadados.codigo_cdu])
])
])
])
// Licença de Uso (opcional) -------------------------------
#align(center + bottom, [
#licenca
#v(2cm)
// Ficha Catalográfica (obrigatório) -----------------------------
// Em geral, a biblioteca da universidade provê uma ficha catalográfica em pdf que deve ser
// inserida no documento. O template aqui atende a maioria das exigências.
#ficha
])
#pagebreak(to: "odd")
// Folha de Aprovação (obrigatório) =============================
// ABNT NBR 14724:2011 §4.2.1.3 - Folha de aprovação
// Elemento obrigatório. Deve ser inserida após a folha de rosto, constituída pelo nome do autor do
// trabalho, título do trabalho e subtítulo (se houver), natureza (tipo do trabalho, objetivo, nome da
// instituição a que é submetido, área de concentração) data de aprovação, nome, titulação e assinatura
// dos componentes da banca examinadora e instituições a que pertencem. A data de aprovação e
// as assinaturas dos membros componentes da banca examinadora devem ser colocadas após a
// aprovação do trabalho.
// Departamentos costumam prover seu próprio modelo de folha de aprovação. Cheque se precisa mudar
// o template ou se é melhor inserir um arquivo pdf.
#set text(..t2, weight:"black")
Folha de Aprovação
#pagina_branca()
// Dedicatória (opcional) =============================
// ABNT NBR 14724:2011 §4.2.1.4 - Dedicatória
// Elemento opcional. Deve ser inserida após a folha de aprovação.
// #set text(font: estilo.fonte.serif, weight: "regular", style: "oblique", size: estilo.fonte.tamanho.regular)
// #align(right+bottom, pad(left: 7cm, [
// Dedico este trabalho aos meus pais, Juju e Ismael; aos meus irmãos, Ismael, Márcia e Marta; aos meus filhos, Júlia, Adriano e Felipe; ao meu marido, José Romero; e à minha neta Luísa.
// ]))
#blockquote[
#emph[Dedico este trabalho aos meus pais, Juju e Ismael; aos meus irmãos, Ismael, Márcia e Marta; aos meus filhos, Júlia, Adriano e Felipe; ao meu marido, José Romero; e à minha neta Luísa.]
]
#pagina_branca()
// Agradecimentos (opcional) =============================
// ABNT NBR 14724:2011 §4.2.1.5 - Agradecimentos
// Elemento opcional. Devem ser inseridos após a dedicatória.
#set par(
leading: .63em,
justify: true,
first-line-indent: 0em,
)
// #show par: set block(spacing: estilo.espacamento.entreparagrafos * estilo.fonte.tamanho.regular)
#set text(..t2, weight:"black")
Agradecimentos
#v(1cm)
#set text(..regular)
Agradeço à Universidade de Brasília, onde tive a honra de fazer meu primeiro curso de graduação e desde então tornou-se uma referência de grande importância na minha vida. E à Faculdade de Comunicação – professores, direção, coordenação e servidores da pós-graduação –, por me receber e oferecer todas as condições para concluir o mestrado com tranquilidade e segurança.
Agradeço ao meu orientador, Professor <NAME>, pela disposição em me conduzir ao longo de dois anos de estudo e pesquisa, sempre disponível para o diálogo, para a discussão, para a indicação de autores e textos que tornaram possível a compreensão do meu objeto de estudo.
Agradeço a esta banca, que colaborou de forma decisiva para a conclusão deste trabalho, com críticas e sugestões inestimáveis.
Agradeço aos meus colegas, que dividiram comigo todos os momentos e sentimentos que um curso de mestrado proporciona. E homenageio, em especial, <NAME>, de quem não pude me despedir, mas que deixou saudade, respeito e a certeza de que a vida, às vezes, nos traz desafios só vencidos com muita coragem.
Agradeço aos meus amigos, cuja companhia eu sacrifiquei ao longo desses dois anos, mas que, mesmo assim, não desistiram de mim.
E agradeço, de todo o meu coração, aos meus familiares, que me incentivaram sempre, colaboraram emocional e materialmente para que eu pudesse fazer o mestrado e se interessaram sinceramente pela minha trajetória acadêmica.
Ao meu marido, agradeço de maneira especial, pela paciência infinita e pelo apoio, sem o qual eu não poderia ter realizado o objetivo de dar sequência à vida acadêmica.
A todos e a cada um de vocês, meu muito obrigada!
#pagina_branca()
// Epígrafe (opcional) ==================================
// ABNT NBR 14724:2011 §4.2.1.6 - Epígrafe
// Elemento opcional. Elaborada conforme a ABNT NBR 10520. Deve ser inserida após os agradecimentos.
// Podem também constar epígrafes nas folhas ou páginas de abertura das seções primárias.
#align(center, image("../arquivos/image3.jpg", width: 3.960774278215223in, height: 2.970580708661417in))
#blockquote[#emph[Na sociedade dos meios de comunicação de massa, o pensamento vê-se atrelado à imagem. Quantas vezes não relacionamos o que nossos olhos veem com imagens já vistas?]
--- Sérgio de Sá]
#pagina_branca()
// Resumo (obrigtório)===============================
// ABNT NBR 14724:2011 §4.2.1.7 - Resumo em língua vernácula
// Elemento obrigatório. Elaborado conforme a ABNT NBR 6028.
#set text(..t2, weight:"black")
Resumo
#set text(..regular)
#v(1cm)
A fotografia de <NAME>, menino sírio de 3 anos de idade morto numa praia da Turquia em 2 de setembro de 2015, chocou o mundo e tornou-se símbolo da atual crise migratória que tem gerado milhões de refugiados. Essa fotografia inspirou um movimento artístico nas redes sociais digitais que reproduziu, em forma de ilustrações, a imagem de Aylan morto na praia e transformou o tema "refugiados" em um dos assuntos mais discutidos na internet em 2015. Trouxe também mais uma vez a discussão sobre o poder transformador da imagem, sobretudo da fotografia icônica. Propõe-se discutir o suposto estatuto transformador da imagem e identificar os elementos presentes na fotografia de <NAME> responsáveis por inquietar o mundo em favor e contra os refugiados, bem como as características de uma sociedade em que as tecnologias digitais criam condições para que os indivíduos atuem ativamente na propagação de conteúdos, alterando irreversivelmente a forma como nos comunicamos. Por meio de leitura de imagem, do estudo do imaginário e da sociedade em rede, e com uso de metodologia qualitativa, procedeu-se à análise das reproduções artísticas da fotografia de Aylan, sustentada em teóricos dos campos estudados. A pesquisa recuperou a trajetória da imagem e do imaginário no Ocidente e localizou no tempo e no espaço o drama dos refugiados, com destaque para a guerra civil na Síria, bem como associou tais aspectos à emergência da sociedade em rede e das tecnologias digitais que põe em xeque as formas tradicionais de exercício do poder, uma vez que esse exercício depende do controle da comunicação. Constatou que a imagem em estudo inquietou indivíduos e grupos, gerou iniciativas empáticas transitórias em defesa dos refugiados, mas divide a opinião de estudiosos do tema sobre seu poder transformador. Concluiu que a sociedade digital nos obriga a rever o conhecimento construído ao longo dos últimos séculos, considerando que vivemos em contexto radicalmente diferente, o que exige mais que a histórica iconoclastia e a desconfiança quanto ao poder da imagem.
#strong[Palavras-chave]: Imagem e imaginário; Fotografia icônica; <NAME>; Redes sociais; comunicação mediada.
// Abstract ==================================
#pagebreak()
#set text(..t2, weight:"black")
Abstract
#v(1cm)
#set text(..regular)
The photo of <NAME>, a 3-year-old Syrian boy killed on a beach in Turkey on September 2, 2015, shocked the world and became a symbol of the current migratory crisis that has generated millions of refugees. This photograph inspired an artistic movement in digital social media that reproduced, in the form of illustrations, the image of Aylan dead on the beach and turned the theme \"refugees\" into one of the most discussed subjects on the internet in 2015. It also brought once more discussion about the transforming power of the image, especially iconic photography. This study proposes to discuss the supposed transforming status of the image and identify the elements in the photograph of Aylan Kurdi responsible for disturbing the world in favor of and against refugees, as well as the characteristics of a society in which digital technologies create the conditions for individuals to actively engage in the propagation of content, irreversibly altering the way in which we communicate. Through reading of image, the study of the imaginary and of network society, and using a qualitative methodology, we proceeded to the analysis of reproductions of Aylan\'s photography, supported by the work of academics of the fields mentioned above. The research recovered the trajectory of the image and the imaginary in the West and localized in time and space the drama of refugees, with emphasis on civil war in Syria. It also associated these aspects to the emergence of the network society and digital technologies that challenge traditional forms of power, since this exercise depends on the control of communication. We found that the studied image disturbed individuals and groups, generated transitional empathetic initiatives in defense of refugees, but divides the view of scholars of the theme about its transforming power. It concluded that the digital society compels us to review the knowledge built over the last centuries, considering that we live in a radically different context, which requires more than the historical iconoclasm and distrust of the power of the image.
#strong[Keywords]: Image and imaginary; Iconic photography; <NAME>; Social media; mediated communication.
#pagebreak()
// Listas ====================================
// Sumário (obrigatório) ======================
// ABNT NBR 14724:2011 §4.2.1.13 - Sumário
// Elemento obrigatório. Elaborado conforme a ABNT NBR 6027.
// 5 Regras gerais de apresentação
// O sumário deve ser apresentado conforme 5.1 a 5.6.
// 5.1 A palavra sumário deve ser centralizada e com a mesma
// tipologia da fonte utilizada para as seções primárias.
#set text(..t2, weight:"black")
#align(center, [Sumário])
#v(1.5cm)
// 5.2 A subordinação dos itens do sumário deve ser destacada pela apresentação tipográfica utilizada no texto.
// 5.3 Os elementos pré-textuais não devem constar no sumário.
// 5.4 A ordem dos elementos do sumário deve ser conforme 5.4.1 a 5.4.4.
// 5.4.1 Os indicativos das seções que compõem o sumário, se houver, devem ser alinhados à esquerda, conforme a NBR 6024.
// 5.4.2 Os títulos, e os subtítulos, se houver, sucedem os indicativos das seções. Recomenda-se que sejam alinhados pela margem do título do indicativo mais extenso.
// 5.4.3 O(s) nome(s) do(s) autor(es), se houver, sucede(m) os títulos e os subtítulos.
// 5.4.4 A paginação deve ser apresentada sob uma das formas abaixo:
// a) número da primeira página (exemplo: 27);
// b) números das páginas inicial e final, separadas por hífen (exemplo: 91-143);
// c) números das páginas em que se distribui o texto (exemplo: 27, 35, 64 ou 27-30, 35-38, 64-70).
// 5.5 Se houver um único sumário, podem ser colocadas traduções dos títulos após os títulos originais, separados por barra oblíqua ou travessão.
// 5.6 Se o documento for apresentado em mais de um idioma, para o mesmo texto, recomenda-se um sumário separado para cada idioma, inclusive a palavra sumário, em páginas distintas.
#set text(..t4, size: 12pt)
#outline(depth: 2, title: none, indent: auto)
// #outline(depth: 2)
// #pagina_branca()
// # Abstract {.unnumbered}
//
|
|
https://github.com/LugsoIn2/typst-htwg-thesis-template | https://raw.githubusercontent.com/LugsoIn2/typst-htwg-thesis-template/main/lib/abstract.typ | typst | MIT License | #import "textTemplate.typ": *
#let abstractPages(body, lang: "", abstract-font: "Arial") = {
let languageText = textTemplate(pagetype: "abstract" ,lang: lang)
heading(numbering: none, outlined: false)[#languageText.at(0)]
set text(
font: abstract-font,
size: 12pt,
lang: lang,
)
set par(justify: true,)
// --- -------------- ---
// --- -------------- ---
// ----- Abstract -------
body
v(1fr)
} |
https://github.com/polarkac/MTG-Stories | https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/006%20-%20Magic%202014/001_Prisoner of the Skep; or, How I Encountered the Slivers—and Lived to Tell the Tale!.typ | typst | #import "@local/mtgstory:0.2.0": conf
#show: doc => conf(
"Prisoner of the Skep; or, How I Encountered the Slivers—and Lived to Tell the Tale!",
set_name: "Magic 2014",
story_date: datetime(day: 26, month: 06, year: 2013),
author: "<NAME>",
doc
)
#emph["One emitted a strange series of buzzing clicks and guttural commands, then clawed arms emerged from all of them. Is there no limit to their adaptations?"]
—Hastric, Thunian scout
Being a Report on an Urgent Threat to All Civilized Nations#linebreak #emph[by Hastric, scout in the employ of Ardestan]
A seeming eternity of struggling through the savagery of a benighted land at last brought me to the borders of the territory I had sought for so long. Ragged, starving, and harried by bloodsucking vermin of every description, I no longer resembled the bold adventurer who had set out to find glory and fortune in the wide wilderness. Shelter and sustenance were my primary needs now.
I surveyed my surroundings. I had come at last to the shores of the Eastern Sea, an ill-starred realm that had seen much conflict in past ages. The echoes of ancient mage wars still rang here, preserved in weird formations of unnatural stone and amber shapes that sprouted like some unholy forest from the wave-battered cliffs. Every rock, it seemed, held ancient monsters birthed in a primordial chaos, now preserved as eternal shadows in the tortured earth.
Strange marks scarred the stones and the thin, sour soil. They resembled the scars left by beasts to mark their territory, as bruins claw the trees. But these bore no resemblance to any spoor I had encountered in my many expeditions, and I began to fear I was among beings unlike anything familiar. The scoring seemed to change midway through an individual's passage, growing deeper and farther apart, then nearly vanishing as they became finer and smaller. I had crouched down by a cliff to examine a set of tracks more closely, reaching to extract my notebook and pen so as to record them with as much exactitude as I could, when a sound from above alerted me to danger. I started to look up.
Too late.
I was struck with all the weight of a basher's cudgel, and all sensibility fled for a time.
Awareness returned, along with an unholy head-ache and a weird, shrieking gabble. I cracked open my eyes to find myself partly buried amid loose earth, slabs of shale, and other detritus, at the bottom of a subterranean cavern. Dim light filtered through a small opening high above, where the earth had apparently given way. My small blade, the only protection I had brought on my journeyings, was not to be found, and was most likely entombed beneath the rockfall.
I apparently had tumbled into some sort of beastly nest. On every surface swarmed beings out of nightmare, with gleaming, gemlike eyes and "hair" more like the squirming tentacles of a jelly-fish or polypod. Many were of bestial appearance, but a few could generously be considered humanoid. All were covered with chitinous plates that glistened and slid about like oiled pieces of machinery. The creatures chittered to each other in a never-ending racket as they pursued rote tasks with no apparent purpose.
As my head cleared, I began to wonder: How had I survived my untoward arrival? I focused for a moment on my physical condition and felt nothing more serious than a few scrapes and an egg-sized swelling at the base of my skull. I tried raising a half-pinned arm, experimentally, and saw, to my horror, that during my unconscious state my natural... inclination had shaped my body to resemble those of my strange companions—the limb tipped by a clawed and jointed member. Instinctively, I began to return my form to its most typical state. As I did so, the chittering grew louder and more excited, and the upper limbs of the nearer creatures began to ripple and re-form themselves. Before my very eyes, they became tentacular, then sported five-fingered hands that clutched at the air.
#figure(image("001_Prisoner of the Skep; or, How I Encountered the Slivers—and Lived to Tell the Tale!/01.jpg", width: 100%), caption: [Predatory Sliver | Art by <NAME>], supplement: none, numbering: none)
Apparently the things had thought me one of their brood and had left me to my own concerns. Though they clearly had some sort of shapeshifting ability, I sensed that too rapid or extreme a change on my part might be perceived as a threat. I relaxed again into the form of the others and rested quietly. The incessant noise returned to its normal low thrum, and the creatures focused again on their ceaseless work. It dawned on me that my circumstances offered a unique opportunity to explore and learn more about this strange colony, as long as I could avoid hostile attention.
On looking more carefully about my surroundings, I noticed something else. Everywhere, in the slabs of shale stone that formed the cavern, I could see myriad fossilized creatures. They were scaled, plated, with crablike claws, long tails, elongated probosces. Something about them was inescapably familiar, and in a flash of intuition I realized that those preserved specimens must have been kin to the beings that surrounded me. What had happened to change them so fundamentally?
Perhaps my investigation could turn up more about their history and origin. Fortunately, my journal was still within reach, the bent quill yet caught amid its pages. If I could hunch my posture and keep my body turned partly away from the others, I might be able to surreptitiously record my experiences.
I began to unearth myself from the rubble, carefully, all the while attempting to mimic the alien movements of those around me. Their unearthly thrumming was beyond my ability, however. There were several openings in the cavern, and I started moving slowly toward one of them, when the hive was thrown into disorder by the sudden appearance of a monstrous specimen of their kind. It boomed at the smaller creatures in an imperious fashion, and they scuttled about into a formation at its feet. When I remained, irresolute, the giant turned its horrid face to me and repeated its dreadful command. I decided to join the general movement rather than risk suspicion.
#figure(image("001_Prisoner of the Skep; or, How I Encountered the Slivers—and Lived to Tell the Tale!/02.jpg", width: 100%), caption: [Striking Sliver | Art by <NAME>], supplement: none, numbering: none)
The large one moved purposefully into a tunnel, followed by the flock of smaller beings and myself. I quickly lost track of the many twists and turns and branching ways we followed, until we finally arrived in another chamber. I squinted in the light, which, though feeble, was nevertheless brighter than my previous location. Around me rose tier upon tier of shelves built out of a curving wall seemingly crafted from amber slabs. A sickly yellow glow filtered through those plates, in which were suspended inhuman forms. Myriad openings snaked off in every direction, including up and down.
As my eyes adjusted, I saw that scores of other creatures filled the place. Many were like the drones (or "thrums," as I had begun to think of them) that surrounded me. Others, somewhat larger, crouched against its walls, scratching at the soft stone, while more yet creaked and clicked in what sounded like a chant. Beyond were shapes that confounded my eye: translucent globes that grew like pustules from the walls, nightmare shapes twisting within their membranes. They resembled nothing so much as eggs, but what embryos would they hatch? Other thrums crawled over and between the swelling pods, evidently tending to them as worker bees within a hive.
Under me was stone, within which gaped the form of another ancient horror. The petrified behemoth was clearly akin to those that filled the walls, but it was even more insectile and alien than the fossils I had seen before. It was also immense, greater in size than a dragon. Of more immediate import were the heaped shreds of armor and clothing, and the fragments of bone, that mutely told the fate of others who had preceded me into this monstrous den.
I became aware of strange marks in the shale walls: some sort of crude carvings amid the ever-present fossils. Intent as I was in studying my surroundings, I did not at first realize that the leader was "addressing" the group again. At its signal, the thrums spread out across the chamber and began to sway in time to the chanting. I imitated their motions as best I could, wondering all the while what purpose this gathering served.
The noises ceased. A new figure had entered the chamber, not as large as the one that had led us here, but which exuded obvious authority. Its form was closer to human than those I had seen up to this point. All eyes were on it as it began to declaim in a clicking, fluid speech. Although I could not understand the barbarous sounds, there was obvious organization that suggested at least a somewhat higher level of intelligence. (I have dubbed this form "primes" and the more bestial versions "predators.") It turned around and around as it spoke, gesturing at its audience, at the walls, at the horror in the stone floor. Its form twisted and shifted constantly, at times resembling the preserved specimens that loomed in the amber, at others the various forms that surrounded me. It alternately grew heavier, more thickly armored, with oversized claws and fangs; then stretched out into a more serpentine form; then returned to its original shape.
#figure(image("001_Prisoner of the Skep; or, How I Encountered the Slivers—and Lived to Tell the Tale!/03.jpg", width: 100%), caption: [<NAME> | Art by Chase Stone], supplement: none, numbering: none)
I perceived that it was leading a call-and-response, the spectators moving in precise patterns and answering its clattering in ritual fashion. A particular sequence of clicks and buzzes was repeated over and over. Was this some sort of religious ritual? Perhaps the strange performance was recounting the story of the creatures' origin or arrival on this world. Or maybe it was a war dance!
Though the thought of escape was uppermost in my mind, I realized that I had a duty to warn the civilized world of this uncanny threat. The more I could learn of their history and nature, the better I could arm society against them. Then, while the hive was occupied, I might best be able to explore its secrets. Only after studying all I could might I seek clean daylight again.
Swaying along with the crowd as best I could, though my throat could not form the barbarous sounds they made, I slowly moved toward one of the entrances. I slipped partly into the tunnel, apparently without attracting noticed. I fumbled out my notebook and hurriedly sketched out some of what I saw. Some dried ink yet remained on the pen's nib, which I moistened with my tongue—sufficient for a crude record at least. I would have dipped it in my own blood if necessary.
I backed away farther from the singing hall, and soon was plunged into endless dark. Only by touch was I able to progress, fearing at every moment that my hands would encounter some plated monster. My ears strained for the sound of the omnipresent hum, which I turned away from whenever I found a suitable passage. I sensed the weight of the rock above me, felt the air grow thick, and knew that I descended. Gradually, I picked my way downward. The alien scent of the hive, whose tang had filled my consciousness for so long that I had ceased to notice it, began to thin. In its place was a new smell: salt water, sea wrack. Somewhere nearby there must be an outlet. I let my senses guide me onward, though I still shivered at the thought of nearby horrors.
Slowly I grew aware of a change in the texture of the primeval blackness. The smell of the sea grew stronger, and I began to make out the vague shapes of my surroundings. Step by step I edged forward, until I came to an opening into a new cave, quite unlike those I had seen till then and evidently uninhabited. It seemed much older, somehow. Bluish light faintly illuminated the expanse from a small opening on the far side, and I could hear, echoing within the gloomy confines, the beat of surf on shore.
I stood on a veritable pavement of fossils like those I had seen suspended in amber, as well as among heaps of long-dry bones and carapaces both in the shape of my captors and those of bats, fish, and insects. On the walls were daubed some shapes that suggested insects and small flying animals, as well as the ever-present fossils, in slabs arranged to show them prostrate. A long gap, and then some uncouth scratchings, imbued with pigment, that depicted beings like those that swarmed above. The first ones in the sequence were small, four-legged but with the unmistakable tendrils these creatures all shared, then more and more varieties and sizes, including the bipedal specimens that seem to direct the colony's activities. Some flew with bat wings, others sported great horns, yet others had finned feet like those of frogs; there seemed numberless adaptations of shape.
Whatever had transformed the progenitor race had evidently occurred in this seaside cave—and for all I knew, many others like it. Evidently, those ancient predators had eaten the smaller creatures, but how did that connect to their peculiar evolution? The strange dance I had observed might have been intended to reproduce this event in some way. Perhaps a strange disease, or a magical curse of some sort, had been carried by the food animals? Or the plated horrors might themselves have come here from another world—borne on a storm of the Æther, perhaps—and been irrevocably changed by their arrival here.
My whole being rebelled against the idea, but cold, logical deduction led me to the inescapable conclusion: This great hive was built, not found, by the brutish-looking things that now inhabited it—or at least by their forebears. Although they clearly had no sophisticated intelligence, they were clever and organized enough to present a terrible threat.
My reverie was broken by rasping cries behind me, as a number of the horrors burst through the tunnel I had followed. There was no more time to study the mystery, and I sprinted for the sea-cave's egress, adopting as I did so a form better suited to an aquatic escape. Some of the creatures bristled, hedgehog-like, as the various plates and spines of their bodies elongated and then were launched as deadly missiles. Clouds of darts flew about me as I leapt into the water, and one pierced my leg. But my disguise preserved me, and as I slipped beneath the blessed waves I could no longer hear the chittering screams.
#figure(image("001_Prisoner of the Skep; or, How I Encountered the Slivers—and Lived to Tell the Tale!/04.jpg", width: 100%), caption: [Thorncaster Sliver | Art by <NAME>], supplement: none, numbering: none)
I append now for your edification a summary of the characteristics and forms of the beings I encountered, as well as the hurled plate that injured me, with its mysterious fluid still evident, if coagulated. You will find also detailed sketches of that great nest or hive, which in their clattering tongue they name the Skep. I have dubbed these strange creatures "slivers." Uncouth though they may be, they constitute a serious danger to civilized folk everywhere. The more we can learn of them and their strengths and weaknesses, the better we can prepare to exterminate them. For the sake of progress.
#grid(
columns: (1fr, 1fr),
gutter: 2em,
figure(image("001_Prisoner of the Skep; or, How I Encountered the Slivers—and Lived to Tell the Tale!/05.jpg", height: 30%), caption: [], supplement: none, numbering: none),
figure(image("001_Prisoner of the Skep; or, How I Encountered the Slivers—and Lived to Tell the Tale!/06.jpg", height: 30%), caption: [], supplement: none, numbering: none),
)
|
|
https://github.com/markcda/unitech-typst | https://raw.githubusercontent.com/markcda/unitech-typst/master/examples/sw-psychology/01-semester-work.typ | typst | MIT License | #import "00-university-template.typ": *
#show: student_work.with(
title: "Контрольная работа - Психологическое содержание управления социальным графом - <NAME>.",
header: "unitech-2023-header.png",
department_name: "Кафедра гуманитарных и социальных дисциплин",
institute_name: "Институт проектного менеджмента и инженерного бизнеса",
work_type: "контрольная работа",
discipline_name: "Социально-психологические основы управленческой деятельности",
theme: "Психологическое содержание управления социальным графом",
author: (name: "<NAME>", sex: "male", degree: "студент", group: "ИБО-ТС-22", nwa: "<NAME>"),
adviser: (name: "<NAME>", sex: "female", degree: "доцент кафедры гуманитарных и социальных дисциплин,\nкандидат психологических наук, доцент", nwa: "<NAME>"),
city: "Королёв",
year: "2023",
table_of_contents: true,
links: (
(type: "book", author: "<NAME>.", title: "Основы теории коммуникации", publisher: "Юрайт", year: "2023"),
(type: "book", author: "<NAME>.", title: "Введение в теорию социального взаимодействия", publisher: "РГСУ", year: "2015"),
(type: "book", author: "<NAME>., <NAME>.", title: "Теория игр. Искусство стратегического мышления в бизнесе и жизни", publisher: "\"Манн, Иванов и Фербер\"", year: "2022"),
(type: "web", title: "<NAME>. Критерий свободы действий в консеквенциализме - 2019 г", link: "https://teletype.in/@titoffklim/r1LUnZrnS", access_date: "28.12.2023"),
(type: "web", title: "<NAME>. Невербальная коммуникация - 2021 г", link: "https://teletype.in/@titoffklim/r1LUnZrnS", access_date: "28.12.2023"),
(type: "web", title: "<NAME>. Социальный граф общества - 2015 г", link: "https://cyberleninka.ru/article/n/sotsialnyy-graf-obschestva", access_date: "28.12.2023"),
(type: "web", title: "<NAME> - 2018 г", link: "https://cyberleninka.ru/article/n/netvorking", access_date: "28.12.2023"),
(type: "web", title: "<NAME> - креативный навык, соединяющий идеи с ресурсами - 2018 г", link: "https://cyberleninka.ru/article/n/netvorking-kreativnyy-navyk-soedinyayuschiy-idei-s-resursami", access_date: "28.12.2023"),
(type: "web", title: "4Brain: Теория коммуникации", link: "https://4brain.ru/blog/communication-theory/", access_date: "28.12.2023"),
(type: "web", title: "Бизнес-секреты: Нетворкинг-мероприятия", link: "https://secrets.tinkoff.ru/razvitie/netvorking-meropriyatiya/", access_date: "28.12.2023"),
),
)
= Введение
Управление социальным графом -- одно из ключевых направлений наибольшего количества стратегий в этике консеквенциализма с критерием расширения свободы действий (далее - КРСД). Так как ценность любого действия многомерна и не может быть оптимизирована по всему пространству полезности для индивида, человек избирает стратегию -- опорный метод, при помощи которого он может оценить только часть эффектов действия или бездействия, а остальные -- отбросить как ненужные. Так, интеллект, по Алексу Висснер-Гроссу, определяется формулой $ "F" = T \u{2207} S_t "," $ а свобода действий -- это возможность выполнить действие, но не обязательное его выполнение.
Как мы знаем из истории, наибольшие победы человечества, включая технический прогресс и научные достижения, являются совокупными усилиями множества людей. Но люди, которые живут лучше всего, необязательно участвуют в этих победах, а, напротив, умеют такими людьми руководить или предоставляют им иные возможности. В число этих людей входят различные бизнесмены, миллионеры, государственные служащие и так далее. Всех их объединяет одно: _наличие связей_. В данной работе будет раскрыто психологическое содержание управления социальным графом, его подграфами различного назначения, основные правила управления связями, а также раскрыто понятие нетворкинга в современном контексте и план и содержание практических мероприятий по организации нетворкинга.
#set heading(numbering: "1.")
= Общая характеристика сетевого взаимодействия -- нетворкинга -- как процесса
В более широком смысле менеджмент социальных графов относится к теории коммуникации -- междисциплинарному направлению научного знания, предмет которого -- коммуникация, а также её роль и место в обществе. В своё время <NAME> выделил семь подходов к теории коммуникации:
1. Кибернетический: коммуникация как процесс обработки и передачи информации.
2. Феноменологический: коммуникация как формирование отношений между людьми (как вербальное, так и невербальное общение).
3. Семиотический: рассматривает коммуникацию как взаимодействие через систему знаков.
4. Риторический: рассматривает коммуникацию как практическое искусство дискурса.
5. Критический: процесс, в котором все предложения могут быть оспорены.
6. Социально-культурный: коммуникация – это производство и воспроизведение общественного порядка.
7. Социально-психологический: коммуникация как способ взаимодействия и воздействия при помощи психологических знаний на поведение человека, групп людей; общества в целом.
В дальнейшем была представлена модель коммуникации Шеннон-Уивера, которая используется в концепции источника информации, передатчика, сигнала, канала, приемника, сообщения, информационного адресата, вероятности ошибки, скорости передачи данных, пропускной способности канала, а также шума (энтропии). В классическом понимании процесс передачи информации по этой теории выглядит следующим образом:
1. Источник информации: тот, кто производит сообщение (Шеннон и Уивер изучали речь по телефону).
2. Кодировщик (передатчик): то, что преобразует сообщения в сигналы (поддающиеся передаче). Здесь имеется в виду преобразование звуков человеческой речи в электрический сигнал.
3. Канал как средство передачи сигнала: например, телефонный кабель.
4. Ресивер или декодер: то, что реконструирует сообщение из сигнала.
5. Приемник: к примеру, человек, получающий сообщение.
Исходя из вышеперечисленного, Шеннон создал что-то вроде мини-словаря коммуникаций:
1. Источник: источник информации, который «производит сообщение или последовательность сообщений, что должны быть переданы принимающему терминалу».
2. Отправитель: Шеннон называет этот элемент трансмиттером (передатчиком), который «каким-то образом воздействует на сообщение, чтобы создать сигнал, подходящий для передачи по каналу».
3. Канал: по Шеннону канал является «просто средством, которое используется для передачи сигнала от передатчика к приемнику».
4. Приемник: для Шеннона приемник «выполняет обратную операцию, осуществляемую передатчиком, который восстанавливает сообщение».
5. Назначение: для Шеннона целью является «человек или предмет, для которого предназначено сообщение».
6. Сообщение: это концепция или информация, которая отправляется получателю в устной, письменной, записанной или визуальной форме.
7. Энтропия (шум): это внешние факторы, которые искажают сообщение, нарушают его целостность и возможность восприятия приемником.
Шеннон и Уивер понимали, что средства коммуникации могут давать сбои, поэтому описали три уровня проблем, которые характерны для этой модели:
1. Проблема эффективности: насколько эффективно значение сообщения влияет на поведение.
2. Семантическая проблема: как передается смысл.
3. Техническая проблема: насколько точно может передаваться сообщение.
В настоящее время к проблемам добавилась и острая проблема межкультурной коммуникации. Появление Интернета сделало проблему, возникающую между представителями разных культур, более наглядной. Это непонимание влечет за собой конфликтные ситуации. <NAME> выделяет три правила межкультурной коммуникации:
1. Для достижения понимания при общении нужно обучать участников активному слушанию.
2. Информация, передаваемая на невербальном уровне, представляет большие трудности для интерпретации членами другой культуры.
3. Необходимо научиться предвидеть и предотвращать возможные ошибки при коммуникации с представителями разных культур.
Представителя иной культуры нужно изучать отдельно, потому что отношение к паузам, молчанию, темпу речи у других национальностей может быть разное. В некоторых странах принято обращаться по имени, в других – по фамилии, в странах СНГ – по имени-отчеству. Помимо этого, какие-то темы могут быть приветливо встречены в одной стране и быть совершенно неприемлемыми в другой.
Теория коммуникации предлагает свое определение таких важных терминов, как «язык» и «культура»:
1. Язык – это совокупность всех слов народа и верное их сочетание для передачи мыслей, система общения, состоящая из мелких фрагментов и набора правил.
2. Культура – закрепленные в совокупности «кодов» общественного производства человеческой жизни отношения, выступающие, например, в виде традиций, обычаев, верований.
Язык и культура незнакомой страны – это то, что требуется изучать в первую очередь, чтобы не попасть в неловкие или конфликтные ситуации.
Также была развита теория массовой коммуникации –- процесса производства и воспроизводства массового сознания средствами массовой коммуникации (СМК). Сначала это было радио, периодическая печать, телевидение, теперь к нему добавился Интернет и другие средства электронной коммуникации. Современное общество с его политикой, экономикой и культурой неразрывно связано с массовой коммуникацией. А с появлением интернета и его возможностями (например, системой обратной связи) влияние СМК на социально-психологическую, производственную и культурно-идеологическую области жизни достигло огромных масштабов.
Для обобщения инструментов коммуникации, направленных на развитие связей, используется термин "управление социальным графом", являющийся более широким понятием, чем "нетворкинг". Социальный граф -- это набор каналов двусторонней коммуникации, каждый из которых может обладать определённой _удельной полезностью_ -- свойством, расширяющем свободу действий индивида, обладающего этим социальным графом и умеющего им управлять и использовать. Вершинами такого социального графа являются люди, которые осуществляют процессы коммуникации.
Таким образом, процесс нетворкинга -- это процесс установления деловых каналов двусторонней коммуникации между индивидами, позволяющий им расширять свободу действий за счёт друг друга.
Формирование социального графа может происходить ненамеренно, а контакты могут иметь различную направленность. Так или иначе, канал двусторонней коммуникации в социальном графе является _знакомством_. В одном канале двусторонней коммуникации может происходить общение по одной или нескольким тематикам; в зависимости от этого формируется _близость_ элемента социального графа. Близкие друзья -- это пример подграфа в социальном графе индивида. От близких друзей мы можем получать как различную материальную помощь, так и психологическую поддержку, положительные эмоции, знания и иную информацию, которая способна расширять нашу свободу действий. Важно отметить, что дружеские отношения не являются прямым объектом нетворкинга, так как друзья не обязательно могут иметь деловые каналы двусторонней коммуникации.
Для установления взаимоотношений между индивидами используется обычное общение, которое, в силу эволюционных особенностей развития человеческой психологии и приобретённых с жизненным опытом навыков коммуникации, сводится к теории игр. В особенности это проявляется в деловых коммуникациях: если одному партнёру канал связи необходим, а другому -- бесполезен, то социальный граф не будет расширен. Чтобы иметь возможность использовать удельную ценность вершины социального графа, при установлении знакомства следует рассказать о своей ценности и проявить вежливость, позволив обращаться к себе за помощью в таких-то ситуациях. Для этого требуется выяснить сферу деятельности и потребности делового партнёра.
Идеальный социальный граф:
- разделён по сферам деятельности, и дружеские отношения отделены от деловых, а деловые одной категории - от деловых другой;
- имеет вложенность, благодаря которой, не имея прямых связей с партнёрами твоего партнёра, всё равно можно расширять через них свободу действий;
- имеет "карту" -- владельцу такого графа понятно, у кого и что он может запрашивать;
- не имеет ресурсных конфликтов -- владельца графа не тревожит более одного индивида в один момент времени;
- не имеет односторонних отрицательных связей -- соотношение отдаваемого и получаемого количества свободы действий не должно иметь производную, значение которой продолжительное время не равно нулю.
= Польза и применение нетворкинга
Польза нетворкинга заключается в возможности получать без временных затрат на обучение и производство _определённые блага_, которые производят _деловые связи_ за счёт *вашего обещания выполнить их запрос* по их просьбе в любой (разумный) момент времени.
Грубо говоря, деловые связи позволяют получать то, что требуется, без значительных затрат ресурсов со своей стороны. Стоимость затрат ресурсов определяется как число затраченных ресурсов и времени со своей стороны плюс число потенциальных ресурсов и времени, которое может потребоваться для решения проблемы делового партнёра. В силу определённых навыков и умений затраты ресурсов и времени для решения проблемы делового партнёра должно быть существенно меньше затрат, которые вы могли бы понести без наличия такого двустороннего канала деловой коммуникации.
Поскольку расширение свободы действий существенно зависит только от одного ресурса -- времени, -- а все остальные ресурсы приобретаются за счёт него, ценность социального графа также можно оценить как разницу или как отношение между временными затратами. В этом смысле, учитывая ещё и стоимость построения такого социального графа, включающее в себя получение навыков коммуникации и профессиональных, востребованных на рынке навыков, она будет высока на начальных этапах, но стоимость развития социального графа -- и в особенности делового подграфа в ней -- в дальнейшем будет постоянно (и, вероятно, экспоненциально) снижаться.
Таким образом, нетворкинг применим в деловой и профессиональной сфере, когда затраты на освоение новых навыков и прогнозы по затратам на освоение навыков, которые могут появиться в будущем, существенно выше, чем приобретение двунаправленно полезных социальных связей и их использование.
Одна из ключевых отраслей, в которых сейчас нетворкинг имеет значительный вес, -- это отрасль информационных технологий. В отрасли постоянно проводятся различные события -- митапы, конференции, ярмарки вакансий,~-- напрямую связанные с нетворкингом и установлением деловых отношений. Примечательно, что даже без конкретно обозначенных деловых программ и нетворк-сессий люди постоянно обрастают новыми знакомствами на таких мероприятиях, расширяя свой социальный граф, а иногда -- даже его деловое подмножество.
Более того, организаторы нетворкинг-мероприятий имеют дополнительную пользу. Польза для гостей лежит на поверхности. Если на нетворкинг пришел дизайнер-фрилансер, он может найти потенциальных заказчиков. Представитель типографии может познакомиться с другими дизайнерами и предложить им сотрудничество. Все зависит от того, какие цели поставит сам участник. Для организатора же нетворкинг скорее имиджевая история и возможность получить теплую аудиторию для маркетинговых акций. К примеру, студия-организатор собирает контакты участников и может в дальнейшем отправлять рассылки с предложениями услуг.
= План и содержание практических мероприятий, рекомендуемых при организации нетворкинга
Для организации нетворкинга требуется определить следующие составляющие:
1. *Формат нетворкинга.* На офлайн-встречах распространены модерируемые беседы и стены нетворка. Есть также онлайн-форматы и смешанные варианты.
2. *Место проведения.* В рамках крупного мероприятия стоит выделять отдельную зону, так как зона нетворкинга должна располагать к общению.
3. *Время проведения.* В рамках мероприятий на нетворкинг следует выделять отдельное время: можно до начала основного события, или прибавляя время к обеденному перерыву: конкретное время проведения -- на выбор.
В
#ref(label("plan"), supplement: "таблице")
представлен типовой план практических мероприятий организации модерируемых бесед в рамках конференции разработчиков.
#set figure.caption(separator: [. ])
#figure(
text(
size: 10pt,
table(
columns: 4,
inset: 4pt,
align: (x, y) => (horizon, horizon, horizon, left).at(x),
align(center)[*№ п/п*], align(center)[*t*], align(center)[*Мероприятие*], align(center)[*Содержание*],
[1], [-], [Подготовка к нетворк-сессии], [
Цель -- подготовиться к мероприятию.\
Ожидаемый результат -- готовность проводить мероприятие.\
Содержание:
#set enum(indent: 0em)
1. Определение места и времени проведения сессии.
2. Подготовка карточек контактов для участников.
3. Поиск модераторов, имеющих определённые профессиональные знания в области.
4. Создание онлайн-чата для предварительного общения.
],
[2], [2 дня], [Неформальное общение в чате], [
Цель -- предварительное знакомство участников с целью понять, кто из них представляет друг для друга интерес.\
Подготовка участников: организаторы могут попросить подготовить самопрезентации на пару минут.],
[3], [40 минут], [Встреча на конференции в момент\ нетворк-сессии], [
Цель -- провести нетворк-сессию.\
Ожидаемый результат -- собранные контакты, которые могут расширить свободу действий.\
Содержание -- проведение модерируемой беседы.],
[4], [-], [Постнетворкинг], [
Цель -- поддержание активности деловых связей.\
Ожидаемый результат -- активность участников и осуществление взаимопомощи.
]
)
),
caption: [Типовой план практических мероприятий организации модерируемых бесед в рамках конференции разработчиков]
) <plan>
Организаторы мероприятия выделяют отдельную зону для нетворкинга, в которой есть удобные кресла и столики. За каждым столиком идет тематическая беседа. Например, за одним столом участники обсуждают поиск персонала, за другим -- управленческие техники. Темы зависят от аудитории и тематики всего мероприятия.
За каждым столом закреплен модератор. Его задача -- начать обсуждение и поддерживать беседу. Такой формат подходит, если в нетворкинге участвует до 100 человек.
1. Задаёт тематику беседы: модератор знакомит участников нетворкинга, начинает беседу, предлагает участникам рассказать о себе, о своем бизнесе.
2. Наблюдает за диалогом участников: модератор следит, чтобы каждый участник беседы мог высказаться. К примеру, одни участники будут молча слушать, а вторые — перебивать и отходить от темы. Модератор включается в беседу так, чтобы все в равной степени высказали свое мнение и представили себя. Если в беседе есть перевес в сторону одного из участников, модератору не стоит бояться его перебить и сместить фокус на другого участника. Конечно, речь не о грубом прерывании речи, а о мягком своевременном комментарии. Если участник делает короткую паузу, модератор может прокомментировать ее, например высказать свое мнение и тут же задать второму участнику вопрос — что он думает по этой теме или как он из своего опыта решал подобную задачу.
3. Приглашает к беседе новых участников: на мероприятиях есть участники, которые приходят в зону нетворкинга, но по каким-то причинам стоят в стороне. Модератор приглашает таких гостей к беседе. Участники могут отказываться от нетворкинга, если чувствуют себя неловко, не видят в нетворкинге пользы или им сложно идти на контакт с новыми людьми. Наседать и подталкивать к беседе не нужно, иначе человек может еще больше замкнуться или разочароваться в формате. Стоит предложить ему стать слушателем. Часто это уже снимает первый блок, и через какое-то время участники и сами начинают общаться.
Если нетворкинг проходит в обеденное время, задача модератора — пригласить гостей из обеденной зоны в зону нетворкинга. При организации нетворкинга компании стоит подобрать на роль модераторов сотрудников с определенными навыками. Модерировать беседу получится у человека, кому легко дается коммуникация с разными людьми, кто эмпатичен и может почувствовать, когда участникам дискомфортна беседа или становится неинтересно.Из навыков важен четкий менеджмент и опыт работы в организации мероприятий. Модератор понимает, как строится программа мероприятия, как взаимодействовать с другими организаторами, с ведущим, знает тайминг и умеет распределять время между участниками нетворкинга.
#set heading(numbering: none)
= Заключение
Подводя итоги, можно сказать, что проблема управления социальным подграфом деловых связей раскрыта. Был сделан обзор на управление социальным графом, определены базовые понятия социального графа, было определено понятие деловых связей, способы их установления, назначение и применение; был описан процесс нетворкинга, приведён типовой план практических мероприятий организации модерируемых бесед в рамках конференции IT-разработчиков.
Так, ключевыми способами организации нетворк-сессий являются модерируемые беседы и стены нетворка, а также онлайн- и смешанные варианты. Применение нетворкинга же охватывает деловую и профессиональную деятельность, развитие в которой затратно по времени.
|
https://github.com/k0tran/bsbd_labs_s2 | https://raw.githubusercontent.com/k0tran/bsbd_labs_s2/master/reports/lab3.typ | typst | #import "template.typ": *
#show: lab.with(n: 3)
= Начало работы
== БД и директория
Расположение кластера PostgreSQL по умолчанию:
- Linux: `/var/lib/postgresql/<version>/data`
- macOS: `/usr/local/var/postgres`
- Windows: `C:\Program Files\PostgreSQL\<version>\data`
Где version номер версии PostgreSQL.
#pic(img: "lab3/db1.png")[В моем случае используется специальная директория]
== Запуск и перезапуск
Запущен при помощи #link("https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh")[entrypoint]
В случае использования docker образа postgres гораздо разумнее перезапустить контейнер, нежели копаться в его внутренностях.
#pic(img: "lab3/restart.png")[Перезапуск контейнера postgres]
== Создаие
При запуске контейнера можно указать POSTGRES_USER и POSTGRES_PASSWORD. Используя их можно исполнить:
```sql
CREATE DATABASE mydb;
```
Владельцем будет POSTGRES_USER.
#pic(img: "lab3/create_newdb.png")[Создание новой бд и попытка чтения]
Больше чтения и работы с новой бд здесь не продемонстрированно так как это уже было сделано в перовой лабораторной (добавление таблиц, ролей, схем и тп.).
#pagebreak()
// Костыль что бы заголовки были без номера
#set heading(numbering: (..numbers) =>
if numbers.pos().len() <= 0 { return "" }
)
#endhead[Заключение]
В данной лабораторной работе были рассмотрены основные аспекты работы с кластером postgres. Продемострирован способ работы в рамках docker контейнера. |
|
https://github.com/Mc-Zen/quill | https://raw.githubusercontent.com/Mc-Zen/quill/main/examples/fault-tolerant-measurement.typ | typst | MIT License | #import "../src/quill.typ": *
#let group = gategroup.with(stroke: (dash: "dotted", thickness: .5pt))
#quantum-circuit(
row-spacing: 6pt,
fill-wires: false,
lstick($|0〉$), 10pt, group(3, 2, label: (content: "Prepare")), $H$, ctrl(2), 3pt,
group(4, 2, label: (content: "Verify")), 3,
group(7, 3, label: (content: [Controlled-$M$])),
ctrl(4), 2, 10pt, group(3, 2, label: (content: "Decode")), ctrl(2), $H$, meter(), [\ ],
lstick($|0〉$), 1, targ(), 1, ctrl(2), 2, ctrl(4), 1, targ(), 2, [\ ],
lstick($|0〉$), 1, targ(), ctrl(1), 4, ctrl(4), targ(), 2, [\ ],
setwire(0), 2, lstick($|0〉$), setwire(1), targ(), targ(), 1, [\ ], 10pt,
setwire(0), 4, lstick(align(center)[Encoded\ Data], n: 3), setwire(1), 1,
$M'$, 3, [\ ],
setwire(0), 5, setwire(1), 2, $M'$, 2, [\ ],
setwire(0), 5, setwire(1), 3, $M'$, 1,
) |
https://github.com/khalilaouini7/lab-4-compte-rendu- | https://raw.githubusercontent.com/khalilaouini7/lab-4-compte-rendu-/main/Lab-4.typ | typst | #import "Class.typ": *
#show: ieee.with(
title: [#text(smallcaps("Lab #4: ROS2 using RCLPY in Julia"))],
/*
abstract: [
#lorem(10).
],
*/
authors:
(
(
name: "<NAME>",
department: [Senior-lecturer, Dept. of EE],
organization: [ISET Bizerte --- Tunisia],
profile: "a-mhamdi",
),
(
name: "<NAME>",
department: [Dept. of EE],
organization: [ISET Bizerte --- Tunisia],
profile: "khalilaouini7",
),
/*
(
name: "Student 2",
department: [Dept. of EE],
organization: [ISET Bizerte --- Tunisia],
profile: "abc",
),
(
name: "Student 3",
department: [Dept. of EE],
organization: [ISET Bizerte --- Tunisia],
profile: "abc",
)
*/
)
// index-terms: (""),
// bibliography-file: "Biblio.bib",
)
- In this lab you gonna find two part the first part is a execution of the programme and the second part is an explination of code lines
- You are required to carry out this lab using the REPL as in @fig:repl.
#figure(
image("Images/REPL.png", width: 100%, fit: "contain"),
caption: "Julia REPL"
) <fig:repl>
= First part :
in this part we execute the publisher/subscriber prograame and show you the result . so we gonna use ROS2 and julia to give them name first to and link them to a topic by using this two programme after we install ros2
We begin first of all by sourcing our ROS2 installation as follows:
```zsh
source /opt/ros/humble/setup.zsh
```
#let publisher=read("../Codes/ros2/publisher.jl")
#let subscriber=read("../Codes/ros2/subscriber.jl")
#raw(publisher, lang: "julia")
#raw(subscriber, lang: "julia")
In a newly opened terminal, we need to start the publisher programme how start broadcasted a message first . second execute subscriber programme that listens to the messages being by our previous publisher
- * the result of the execution :*
#figure(
image("Images/pub-sub.png", width: 100%),
caption: "Minimal publisher/subscriber in ROS2",
) <fig:pub-sub>
= Second part :
in this part we gonna explain the first programme function and the result showing up
*- first step :*
first of all we gonna lunch and initialition the subscriber / publisher programme :
- the publisher :
```julia
using PyCall
# Import the rclpy module from ROS2 Python
rclpy = pyimport("rclpy")
str = pyimport("std_msgs.msg")
# Initialize ROS2 runtime
rclpy.init()
```
- the subscriber :
```julia
using PyCall
rclpy = pyimport("rclpy")
str = pyimport("std_msgs.msg")
# Initialization
rclpy.init()
```
*- second step *
in this step we will create a node contain the two parts names
- publisher :
```julia
# Create node
node = rclpy.create_node("my_publisher")
rclpy.spin_once(node, timeout_sec=1)
```
- subscriber :
```julia
# Create node
node = rclpy.create_node("my_subscriber")
```
*- thrid step :*
in this step we gonna link up two node to the topic infodev like in fig 3
#figure(
image("Images/rqt_graph.png", width: 100%),
caption: "rqt_graph",
) <fig:rqt_graph>
- the publisher :
```julia
# Create a publisher, specify the message type and the topic name
pub = node.create_publisher(str.String,"infodev", 10)
```
- the subscriber :
```julia
# Create a ROS2 subscription
sub = node.create_subscription(str.String, "infodev", callback, 10)
```
*- fourth step :*
in this step we gonna choose the message and how many time it will broadcasted
```julia
# Publish the message `txt`
for i in range(1, 100)
msg = str.String(data="Hello, ROS2 from Julia! ($(string(i)))")
pub.publish(msg)
txt = "[TALKER] " * msg.data
@info txt
sleep(1)
end
```
```julia
# Callback function to process received messages
function callback(msg)
txt = "[LISTENER] I heard: " * msg.data
@info txt
end
```
*-last step :*
we onna close up the programme and end the brodcast
```julia
# Cleanup
rclpy.shutdown()
node.destroy_node()
```
```julia
# Cleanup
node.destroy_node()
rclpy.shutdown()
``` |
|
https://github.com/tony-rsa/thonifho.muhali.cv | https://raw.githubusercontent.com/tony-rsa/thonifho.muhali.cv/main/src/sections/ru/skills.typ | typst | MIT License | #import "../../template.typ": *
#cvSection("Навыки")
#cvSkill(
type: [Технологии],
info: [#techSkills],
)
#cvSkill(
type: [Языки],
info: [Английский (свободный) #hBar() Русский (родной)],
)
|
https://github.com/Lypsilonx/Game-of-Intrigue | https://raw.githubusercontent.com/Lypsilonx/Game-of-Intrigue/main/Game%20of%20Intrigue.typ | typst | #import "data.typ": *
#import "cards.typ": *
#show heading.where(level: 1): it => {
if it.level == 1 {
set text(size: 2em)
v(1em, weak: true)
} else if it.level == 2 {
set text(size: 1.5em)
}
it
}
#set heading(numbering: "1.")
#show outline.entry: it => {
if it.level == 1 {
v(1.2em, weak: true)
}
strong(it)
}
#set text(font: "Inter Tight")
#set page(
"a5",
background: locate(
loc => {
if loc.page() == 1 or loc.page() == counter(page).final().at(0) {
box(
width: 100%,
height: 100%,
fill: black,
radius: 0.5em,
outset: 5em,
)
} else {
none
}
}
),
footer: [
#locate(
loc => {
if loc.page() == 1 {
set text(fill: white)
place(
center,
[
// Footer text title page
]
)
}
else if loc.page() == counter(page).final().at(0) {
set text(fill: white)
place(
center,
[
Game of Intrigue - Version #version\
Lyx Rothböck 2024\
]
)
} else {
if (calc.odd(loc.page())) {
place(right, counter(page).display("1"));
} else {
place(left, counter(page).display("1"));
}
place(center, [Game of Intrigue #text(size:0.6em)[#version]])
}
}
)
]
)
#show regex("Standing( card(s)?)?"): it => {
set text(weight: "bold")
link(<standing>, [#icon("Standing")#it])
}
#show regex("Role(s)?( card(s)?)?"): it => {
set text(weight: "bold")
link(<role>, [#icon("Role")#it])
}
#show regex("Goal(s)?( card(s)?)?"): it => {
set text(weight: "bold")
link(<goals>, [#icon("Role")#it])
}
#show regex("Perk(s)?( card(s)?)?"): it => {
set text(weight: "bold")
link(<perks>, [#icon("Role")#it])
}
#show regex("Pact(s)?( card(s)?)?"): it => {
set text(weight: "bold")
link(<pact>, [#icon("Pact", color: gray)#it])
}
#show regex("Asset(s)?( card(s)?)?"): it => {
set text(weight: "bold")
link(<asset>, [#icon("Asset")#it])
}
#show regex("Influence( card(s)?)?"): it => {
set text(weight: "bold")
link(<influence>, [#icon("Influence")#it])
}
#show regex("(Social)( card(s)?)?"): it => {
set text(weight: "bold")
link(<social>, [#icon("Social", color: gray)#it])
}
#show regex("(Favour(s)?)( card(s)?)?"): it => {
set text(weight: "bold")
link(<social>, [#icon("Favour", color: gray)#it])
}
#show regex("(Hook)( card(s)?)?"): it => {
set text(weight: "bold")
link(<social>, [#icon("Hook", color: gray)#it])
}
#show regex("(Threat(s)?)( card(s)?)?"): it => {
set text(weight: "bold")
link(<social>, [#icon("Threat", color: gray)#it])
}
#show regex("(Secret)( card(s)?)?"): it => {
set text(weight: "bold")
link(<social>, [#icon("Secret", color: gray)#it])
}
#show regex("Speech( card(s)?)?"): it => {
set text(weight: "bold")
link(<speech>, [#icon("Speech")#it])
}
#show regex("Testimony( card(s)?)?"): it => {
set text(weight: "bold")
link(<speech>, [#icon("Testimony")#it])
}
#show regex("Rebrand( card(s)?)?"): it => {
set text(weight: "bold")
link(<speech>, [#icon("Rebrand")#it])
}
#show regex("Defence( card(s)?)?"): it => {
set text(weight: "bold")
link(<speech>, [#icon("Defence")#it])
}
#show regex("Color(ed)?(( card(s)?)|( Token(s)?))?"): it => {
let gradient_colors = colors * 3
let color_gradient = gradient.linear(..gradient_colors, relative: "parent")
[
#set text(weight: "bold", fill: color_gradient)
#link(<colored>, [#box(icon("Token", color: gray))#it])
]
}
#show regex("(t|T)rade(d|s?)"): it => {
set text(weight: "bold")
link(<trade>, it)
}
#show regex("(i|I)llegal((ly)|( card(s?)))?"): it => {
set text(weight: "bold", fill: white)
link(<illegal>, " " + box(it, fill: red, outset: 0.2em) + " ")
}
#show regex("draw pile"): it => {
set text(weight: "bold")
it
}
#show regex("discard pile"): it => {
set text(weight: "bold")
it
}
#show regex("personal pile"): it => {
set text(weight: "bold")
link(<setup>, it)
}
#show regex("Visible on back"): it => {
set text(weight: "bold")
link(<visible_on_back>, it)
}
#show regex("(P|p)a(y|id)( as)? a fine"): it => {
set text(weight: "bold")
link(<fine>, it)
}
#show regex("announced"): it => {
set text(weight: "bold")
link(<announcement>, it)
}
#show regex("(R|r)emove.*from the game"): it => {
set text(weight: "bold")
link(<removed_from_game>, it)
}
#show regex("(l|L)egality.*check(ed|s)?"): it => {
set text(weight: "bold")
link(<legality_check>, it)
}
#place(
center + horizon,
dx: -0.5em,
dy: -5em
)[
#logo(banner: true)
]
#pagebreak()
#text(size: 3em, weight: "bold")[
Game of Intrigue
]\
Version #version
#set par(leading: 0.5em)
#outline(title: "Chapters", indent: auto)
#pagebreak()
= The Game <the_game>
== Outline <outline>
#outline_text
== Setup <setup>
Separate the Standing cards from the rest.\
Each player gets #standing_card_amount Standing cards. The rest are removed from the game.
Separate the Colored cards from the rest.\
Sort them by Color and give each player one of the piles.\
The Color Token and the Pact card are put on the table in front of the player visible to everyone.\
Each player then shuffles their Colored cards and puts them face down in their personal pile.\
The remaining Colored cards are removed from the game.\
The Role cards are seperated into Goals and Perks and shuffled. Each player is dealt a Goal (into their hand) and a Perk to the *bottom* of their personal pile.\
The rest of the Role cards are removed from the game.
#let start_draw_cards = hand_card_amount - standing_card_amount - 1
Mix the rest of the cards into the draw pile. Each player can now draw a total
of #start_draw_cards cards from the draw pile or their personal pile or a mix of both (e.g. #(calc.ceil(start_draw_cards / 3 * 2)) from the draw pile and #(calc.floor(start_draw_cards / 3)) from the personal pile) and put them in their hand with their Standing cards and their Role.
== Phases <phases>
The game is played in rounds, that are split up into phases. All players collectively decide when to move on to the next phase together.
You can decide on a turn order inside of the phases (like clockwise or counter-clockwise) or spontaneously decide who goes next. After the last phase the next round starts.
The phases are:
=== Trade <trade>
Players can openly or secretly (in another room or with paper notes or via messenger etc.) discuss strategies.
Each player gets *one* Chance to Trade *one card* with a player of their choosing.
You will have to trade to participate in the Announcement phase. So even just trading for the sake of it can be a good strategy. *Bluffing is allowed!*
A trade happens between two players:
1. Player 1 offers a card to Player 2 by openly stating the card and the player they want to trade with (can be a bluff)
2. Player 2 decides if they want to trade. If they do they offer a card to Player 1 (also openly stating which card; can also be a bluff)
3. Player 1 decides if they want to trade
3. If any player wants to object to the trade they can now do so. (Count down from 3 to give other players a chance; The deal is done/protected on the count of 0) Upon an accusation the legality of the traded cards is checked (see Legality check)
4. If both parties decided to trade (and no illegal cards were found in the previous step) they each take the card offered to them.
5. Both players now qualify for the Announcement phase.
After everyone (except one player, if there is an uneven number of players) has traded the phase ends.
_Example:_
#show regex("C[0-9]\([a-zA-Z ]*\)"): it => {
set text(fill: colors.at(int(it.text.at(1))))
it.text.slice(
it.text.match("(").start + 1,
it.text.len() - 1
)
}
#show regex("Col[0-9]"): it => {
let color = colors.at(int(it.text.at(3)))
set text(fill: color)
color_to_string(color)
}
- C0(Max) announces they want to trade an Col1 Favour with C4(Rue)
- C4(Rue) accepts and offers an Asset card (Value 8) to C0(Max)
- C0(Max) accepts the trade
- C0(Max) and C4(Rue) count down from 3
- C1(Alex) objects to the trade because they are Col1 and know they haven't pulled any Favour cards from their personal pile yet, so it must be a bluff. They also know from a previous Secret card that C0(Max) has a lot of illegal cards in their hand.
- The legality of the trade is checked
- No illegal cards were traded
- C1(Alex) decides to pay a fine to C4(Rue)
- C4(Rue) draws a card from C1(Alex)'s hand
- C0(Max) gives C4(Rue) a Testimony card (Value 2) _secretly_
- C4(Rue) gives C0(Max) a Col4 Favour card (Value 3) _secretly_
- C0(Max) and C4(Rue) now qualify for the Announcement phase
- C1(Alex) and the other players can still trade with each other
=== Announcement <announcement>
_Only after a successful trade can a player participate in this phase._
In the Announcement phase players can announce Social and Speech cards.\
1. Each qualifying player can now put one card face down in front of them
2. If anyone wants to announce their card they turn it around for everyone to see
3. Announcements get resolved (See Social cards and Speech cards) in the order of highest to lowest value (same values get sorted by a coin toss or rock, paper scissors). You cannot announce a Social card of your own Color.
4. All the cards in front of the players get put on the discard pile
#pagebreak()
=== Draw <draw>
Each player can now discard (another) one card from their hand and draws cards from the draw pile or their personal pile until they have #hand_card_amount cards in their hand.\
If the draw pile is empty mix the discard pile into it
If a player has 0 Standing they *loose* and have to decide where they want to put their cards:
- on the discard pile
- into a player hand (inheritance)
- the chosen player must discard the amount of cards they received
If only two players are left the player with the most combined card value
*wins*.
#linebreak()
Tipp: Keep your cards hidden as long as possible.\ You almost never have to show your cards to other players (see Visible on back).
#pagebreak()
= Cards <cards>
== Types <types>
=== Standing <standing>
_Value #(standing_card_value)_
You loose when all your Standing is lost.
=== Pact <pact>
_Colored_\
_Can be Illegal_\
This card symbolizes a pact between you and another player. Pacts are placed openly next to your Color Token on the table.\
They can only be traded for another Pact card and only you can trade with your Pact card.
If you have someone else's Pact card you cannot:
- use a Social card on them
- accuse them of illegal trades
=== Asset <asset>
_Can be Illegal_\
_Value #(asset_value_range.at(0))-#(asset_value_range.at(1))_
Assets are worth their value. Thy do not have any special abilities.
=== Influence <influence>
_Can be Illegal_\
_Value #(influence_value_range.at(0))-#(influence_value_range.at(1))_
Influence cards are played during the Trade phase to make another player trade with you.
#pagebreak()
=== Social <social>
_Colored_\
_Can be Illegal_\
_Value #(calc.min(..social_cards.map(card_data => card_data.value)))-#(calc.max(..social_cards.map(card_data => card_data.value)))_
A social card can be a Secret, Hook, Threat or Favour. It can be announced during the Announcement phase to make the player with that Color…
- Favour: Give you a card of a type of your choice (except Standing or Roles) from their hand. If they have that type of card they have to give one to you.
- Hook: Discard 1 Standing
- Threat: Pay a fine to you.
- Secret: Show everyone how many illegal cards they have (Visible on back)
=== Speech <speech>
_Value #(calc.min(..(testimony_values + rebrand_values)))-#(calc.max(..(testimony_values + rebrand_values)))_
Speech cards also come in three different variants: Testimony, Rebrand and Defence. When announced they…
- Testimony: Let you discard X illegal cards from your hand.
- Rebrand: Let you discard X legal cards from your hand.
- Defence: Make you immune to Social cards with less or equal value this Announcement phase
=== Role <role>
Roles can be obtained by drawing all the cards from your personal pile.\
Roles come in two types:
- *Goal*: You win if you fulfill a specific condition
- *Perk*: You get a special ability
#pagebreak()
== Properties <properties>
=== Illegal <illegal>
- Relevant during legality checks in the Trade phase
- Visible on back
=== Colored <colored>
- Belongs to a specific player
=== Value <value>
- A Number from 0-10 (0 is not shown on the card)
- Visible on back
= Vocabulary <vocabulary>
== Legality check <legality_check>
When a player objects to a trade the legality of the traded cards is checked. You can see if a card is illegal by looking at the back of the card (see Visible on back).
If any traded card is illegal:
1. The player offering an illegal card will have to pay a fine to the accuser.
2. The trade does not happen; Everyone keeps their offered cards
If no card is illegal:
1. The accusing player will have to pay a fine to one of the trading players (accusors choice)
2. The trade goes on.
#pagebreak()
== Paying a fine <fine>
You have to let the other player draw a card from your hand or personal pile.\
You can choose to protect up to #standing_card_amount cards from your hand (put them aside) or your personal pile (hold a hand over it) from being drawn from. If you have less than #standing_card_amount cards in your hand and your personal pile is empty, you cannot protect any cards.
== Removed from the game <removed_from_game>
Put them back in the box. They are not to be used this game anymore.
== Visible on Back <visible_on_back>
- The small text on the back of the card contains the card's value and if it is illegal
#let card_example_scale = 70%
#grid(
columns: (card_width * card_example_scale, card_width * card_example_scale),
rows: (card_height *card_example_scale, auto),
align: center,
column-gutter: 2em,
row-gutter: 0.5em,
[
#place(
scale(card_example_scale, reflow: true)[
#render_card_back(value: 99, illegal: true)
]
)
#place(
dx: 3.85em * card_example_scale,
dy: 3.9em * card_example_scale,
)[
#rotate(-skew_angle)[
#skew(-skew_angle)[
#rect(stroke: 0.1em * card_example_scale + red, width: 0.7em * card_example_scale, height: 0.7em * card_example_scale)
]
]
]
#place(
dx: 6.2em * card_example_scale,
dy: 14.85em * card_example_scale,
)[
#rotate(-skew_angle)[
#skew(-skew_angle)[
#rect(stroke: 0.1em * card_example_scale + red, width: 2em * card_example_scale, height: 0.7em * card_example_scale)
]
]
]
],
[
#place(
scale(card_example_scale, reflow: true)[
#render_card_back()
]
)
#place(
dx: 3.85em * card_example_scale,
dy: 3.9em * card_example_scale,
)[
#rotate(-skew_angle)[
#skew(-skew_angle)[
#rect(stroke: 0.1em * card_example_scale + red, width: 0.7em * card_example_scale, height: 0.7em * card_example_scale)
]
]
]
#place(
dx: 6.2em * card_example_scale,
dy: 14.85em * card_example_scale,
)[
#rotate(-skew_angle)[
#skew(-skew_angle)[
#rect(stroke: 0.1em * card_example_scale + red, width: 2em * card_example_scale, height: 0.7em * card_example_scale)
]
]
]
],
[Value: 99, Illegal],
[No Value, Legal]
)
#pagebreak()
= Bonus Rules <bonus_rules>
== Investments
An investment phase is added before the Trade phase.\
Each player can put any amount of cards from their hand into an investments pile. Cards on this pile cannot be played and are openly visible for anyone. They still count towards the players hand size limit, but not towards the value at the end of the game.\
=== Investment Boni
You get the following bonus per 10 total Value put into the investments pile:\
_Either (Decide this for the whole game in advance)_\
Hand size +1 _Or_ Announce +1 card _Or_ Add 1 value to your announced card
=== Investment Resolution
The player with the most total Value in the investments pile is the Auctioneer.\
They get to decide over ties and the turn order.
== Bribery
When you have to pay a fine you can discard cards with the total value of _the value of the illegal card you were fined for + 1_.\
You cannot dicard cards without value.
== Who wants to be a Millionaire?
Remove the Banker Role from the game.\
Anyone can win by holding cards worth more or equal to #(calc.floor(int(goal_hand_size * ((asset_value_range.at(1) + asset_value_range.at(0)) / 2) / 10) * 15)).
== Liar, Liar
Remove the Liar Role from the game. It applies to all players.\
You start with #(standing_card_amount - 1) Standing.
== Co-op
Remove the Leach Role from the game.\
Players, that have a pact together, win together.
#pagebreak()
= Material <material>
== Cards <cards>
#linebreak()
#par(leading: 1em)[
#grid(
columns: 2,
gutter: 1em,
[
- #player_count Color Tokens
- #role_card_amount x Role
- #player_count x #standing_card_amount Standing (#standing_card_value)
- Each Color (#player_count times):\
- 1 x Pact
#for card_data in social_cards {
[- 1 x #(card_data.type) (#(card_data.value)#if (card_data.keys().contains("illegal") and card_data.illegal) {", illegal"})]
}
- #(calc.ceil(asset_copy_amount / 2) * (asset_value_range.at(1) - asset_value_range.at(0) + 1)) x Asset (#(asset_value_range.at(0))-#(asset_value_range.at(1)))
- #(calc.floor(asset_copy_amount / 2) * (asset_value_range.at(1) - asset_value_range.at(0) + 1)) x Asset (#(asset_value_range.at(0))-#(asset_value_range.at(1)), illegal)
- #(influence_copy_amount * (influence_value_range.at(1) - influence_value_range.at(0) + 1)) x Influence (#(influence_value_range.at(0))-#(influence_value_range.at(1)))
- #(testimony_copy_amount * testimony_values.len()) x Testimony (#(calc.min(..testimony_values))-#(calc.max(..testimony_values)))
- #(rebrand_copy_amount * rebrand_values.len()) x Rebrand (#(calc.min(..rebrand_values))-#(calc.max(..rebrand_values)))
- #(defence_copy_amount) x Defence (#defence_value)
],
[
#text[
Color Tokens: #player_count\
Roles: #role_card_amount\
Standing: #(standing_card_amount * player_count)\
#linebreak()
#for _ in range(social_cards.len()) {
linebreak()
}
Colored cards: #(colored_card_count/player_count) per player\ ( = #colored_card_count)\
#linebreak()
#linebreak()
#linebreak()
#linebreak()
Non-colored cards: #non_colored_card_count\
#line()
Total cards: #card_count
]
]
)
]
#pagebreak()
#let roles = for role in role_descriptions {
(
role.at(0),
role.at(1).replace("[Goal]", "").replace("[Perk]", "")
)
}.flatten()
#let goals = roles.chunks(int(roles.len() / 2)).at(0)
#let perks = roles.chunks(int(roles.len() / 2)).at(1)
== Roles <roles>
=== Goals <goals>
#table(
columns: 2,
..goals
)
#pagebreak()
=== Perks <perks>
#table(
columns: 2,
..perks
)
#pagebreak()
|
|
https://github.com/napleon-liu/my-cv | https://raw.githubusercontent.com/napleon-liu/my-cv/main/README.md | markdown | # Chinese Resume in Typst
使用 Typst 编写的中文简历.
样式上, 参考了 [liweitianux/resume](https://github.com/liweitianux/resume) 与 [uniquecv](https://github.com/dyinnz/uniquecv). 同时也参考了一部分 [uniquecv-typst](https://github.com/gaoachao/uniquecv-typst) 的写法.
语法上, 基于以下 Typst 的设计原则编写 (简洁一致与组合原则):
> - **Simplicity through Consistency:** If you know how to do one thing in Typst, you should be able to transfer that knowledge to other things. If there are multiple ways to do the same thing, one of them should be at a different level of abstraction than the other. E.g. it's okay that `= Introduction` and `#heading[Introduction]` do the same thing because the former is just syntax sugar for the latter.
> - **Power through Composability:** There are two ways to make something flexible: Have a knob for everything or have a few knobs that you can combine in many ways. Typst is designed with the second way in mind. We provide systems that you can compose in ways we've never even thought of. TeX is also in the second category, but it's a bit low-level and therefore people use LaTeX instead. But there, we don't really have that much composability. Instead, there's a package for everything (\usepackage{knob}).
## 使用
### 在线编辑
可以使用 Typst 的 Web App,
模板链接: https://typst.app/project/rw1SLr0IIZZnCrkrsypRQF
### 本地编辑
- 安装 Typst:
- macOS: `brew install`
- Arch Linux: `pacman -S typst`
- Windows: 基于 Rust 包管理器安装 `cargo install --git https://github.com/typst/typst`
- 克隆本仓库: `git clone https://github.com/OrangeX4/Chinese-Resume-in-Typst.git`
- 编译: `typst compile resume.typ`
- VS Code 编辑: 安装 `Typst LSP` 插件后即可编辑
## 效果
包含照片:

不包含照片:

## 示例
你可以使用 **简洁** 与 **组合式** 的语法出美观的效果.
```typst
// 设置简历选项与头部
#show: resume.with(
// 字体基准大小
size: 10pt,
// 标题颜色
themeColor: themeColor,
// 控制纸张的边距
top: 1.5cm,
bottom: 2cm,
left: 2cm,
right: 2cm,
// 如果不需要头像,则将下面的参数注释或删除
photograph: "profile.jpg",
photographWidth: 10em,
gutterWidth: 2em,
)[
= 方橙
#info(
color: themeColor,
(
// 其实 icon 也可以直接填字符串, 如 "fa-phone.svg"
icon: faPhone,
content: "(+86) 155-5555-5555"
),
(
icon: faBuildingColumns,
content: "南京大学",
),
(
icon: faGraduationCap,
content: "人工智能",
),
(
icon: faEnvelope,
content: "<EMAIL>",
link: "mailto:<EMAIL>"
),
(
icon: faGithub,
content: "github.com/orangex4",
link: "https://github.com/orangex4",
),
)
#h(2em) // 手动顶行, 2em 代表两个字的宽度
我是 OrangeX4,你也可以叫我 *一只方橙* 或 *方橙*。
现在是南京大学人工智能学院 2020 级本科生,正深陷于学习数学、编程和英语的无边苦海中。
你问为什么我的名字那么奇怪? 大概是我喜欢吃橘子和橙子,又谐音方程,还有和我的名字谐音的缘故吧。
喜欢一切新奇的东西,兴趣十分广泛。
]
```
以及每一个块
```typst
== #faGraduationCap 教育背景
#sidebar(withLine: true, sideWidth: 12%)[
2023.05
2020.09
][
*南京大学* · 人工智能学院 · 人工智能专业
GPA: 4.48 / 5 · Rank: 15%
]
```
```typst
== #faCode 项目经历
#item(
link(
"https://github.com/OrangeX4/Latex-Sympy-Calculator",
[ *Latex Sympy Calculator* ]
),
[ *个人项目* ],
date[ 2021 年 02 月 – 2021 年 04 月 ]
)
#tech[ NodeJS, Python, VS Code ]
一个用于在 VS Code 中使用 LaTeX 数学公式进行「科学计算」的插件
- 使用 ANTLR 将 LaTeX 语句编译为 Sympy 语句
- 通过 Flask 搭建本地 HTTP 服务器与 VS Code 插件进行通信
- 可以进行多种类型的科学计算,如积分求导、矩阵计算、无穷级数计算等
``` |
|
https://github.com/kazewong/lecture-notes | https://raw.githubusercontent.com/kazewong/lecture-notes/main/DeepLearning/Transformer/transformer.typ | typst | #set page(
paper: "us-letter",
header: align(center, text(17pt)[
*Introduction to transformer*
]),
numbering: "1",
)
#set heading(numbering: "1.")
#outline(
indent: 1em
)
#set text(
font: "Times New Roman",
size: 11pt
)
#set par(justify: true)
= Background
In the first part of this lecture, we are going to explore the basic idea behind a transformer with language modeling.
Once you have the foundation down, generalizing the idea to other modality is conceptually straightforward.
I will have some equations here and there for the purpose of examining them and explain the idea. However, for longer equations and algorithms, I think it rather unnecessary for me to retype them, even though I may put some explaination here.
= Transformer Architecture
== Tokenization
Given a sentence, the first step we need is to represent the sentence in a format that a computer can understand, i.e. numbers.
To do that, we need to tokenize the sentence.
There are multiple ways to tokenize a sentence, including character-level tokenization, word-level tokenization, and subword-level tokenization. // Add citation.
The tokenizer is basically a bag of words that each element in that bag has an id, whenever one see the corresponding pattern, then one can replace the pattern with that id. One of the most commonly used tokenizers these days is the subword-level tokenizer, which means we can have token like "th" and "e". So let say my tokenizer has two elements, "th" as 0 and "e" as 1, then the representation of "the" with my tokenizer will be [0, 1].
Now this is a horrible tokenizer since we cannot represent special characters such as the start or the end of a sentence, empty space, or any Chinese character. To construct a useful tokenizer in practice, there are specific procedures to recursively build the vocabulary such that they can cover most of the basis.
The detail of specific tokenization scheme is beyond the scope of this lecture, for interested students, these could be useful material for understanding how tokenizers work @Philip1994 @Sennrich2015NeuralMT.
If we live in a quality civilization which every word has exactly one meaning and one meaning only, then we could just stop at the tokenization level. Unfortunately this is not ture for any languages (at least the ones that I know of). The meaning of a word depends on the context, so representing a token with a single number is limiting how much we are allowed to process the token. Say my tokenizer has a vocabulary size of 100, and I want to multiply their value by 2, you can see quickly why this is a problem, since some tokens now will be indistinguishable from other token after the multiplication. If "success" is mapped to 1 and "failure" is mapped to 2, multiplying by 2 is not a very nice process. In other word, the representation space our tokens live in is too dense, which means tokens will run into each other and collide with each other often. In a physicist word, the two tokens become "degenerate" after the mapping.
== Embedding
To solve this issue, we can go to a higher dimension, where the tokens live in a much sparer space that they will rarely run into each other.
$ bold(e) in N#sub[embed] $
The tokenization matrix is basically a N#sub[feature] X N#sub[token] matrix. When you want to get the embedding of a particular token, which is a vector of length N#sub[token] with 1 at the specific token location and 0 elsewhere, you can multiply the tokenization matrix with your token vector, then one will have the embedding vector.
While this sounds like a fancy way to say just build a look-up table, and in some sense it is, representing the tokenizer and input sequence as matrix and vector allows us to process the sequence on a computer way faster than writing a for-loop.
== Position encoding
If we just feed the vector representing our sentence into a transformer, it will not do what one may expect it to do since it is lacking some understanding of the order of token. Imagine processing the sentence: "<NAME>" with a character level tokenization, since the transformer does not know the order of the token, the representations "I am Lord Voldemort" and "IaLVoldmorte or dm " are indistinguishable from the original sentence.
In order to put the information related to the ordering of the words into the input sequence, we need to "encode" the position of the tokens into a representation which the computer can process.
@Su2021RoFormerET
== Attention Mechanism
The core of a transformer is the attention mechanism, as suggested by the name of the original paper which popularized the transformer architecture: "Attention is all you need" @Vaswani2017AttentionIA. Nowadays there are many different tricks to make the attention mechanism runs more efficiently in a practical setting. Here we are sticking with the vanilla version for simplicity.
The way I like to think about attention is it is essentially learning a soft mask, such that only the relevant
The basic idea of attention in a transformer is well captured by algorithms 3 in @Phuong2022FormalAF.
== Difference between MLP and Transformer
*Disclaimer: these are my thoughts instead of rigourusly proven math. Everyone in the community is still trying to understand how exactly does transformer work, and if I have the answer, I think I will be writing a formal review article instead of this informal lecture notes.*
For attentive students, you might be asking your self: "What is the difference between an MLP and a transformer?" Sure, there is the attention bit, but isn't attention still using MLP do really do the prediction in the end? And the answer is indeed the attention. But the question is really what exactly the attention does to separate itself from an MLP?
The answer lies in the context.
$ tilde(v) = sum_t (e^((q^T k_t) slash sqrt(d#sub[attn])) #h(3pt) bold(v)_t) / (sum_u e^((q^T k_u) slash sqrt(d#sub[attn]))) $
= Multimodal Transformers
One major advantage of transformer is its universality. CNN deals with images, RNN deals with series, but it takes quite a lot of engineering effort to put them together as an unified model.
This is not the case for transformer. As long as you can find a way to represent your data as an embedding vector, then building a transformer for that specific dataset is as easy as any other dataset. And what is more important is once you have an embedding vector for data with a specific modality, you can combine it with data with other modality.
For example, say you have a dataset with annotated images, then you can easily build two transformers for the texts and the images, then combine their result as if you only have one transformer.
This is great for engineering, this means one have a magical hammer that can be used across a large variety of tasks, so one does not have to replicate different engineering effort for different tasks.
As I mentioned above, the main grunt work in throwing a transformer at different data comes in processing the data, i.e. the tokenizer. We have seen the tokenizer for text data so far, what does it means to tokenizer a dataset in the context of other data modality?
== Vision Transformer
In the case of an image, a common strategy is to treat the image as a collection of "patches". In {VisionTransformer paper}, they split the image into a sequence of 16x16 pixel patches, then use a linear model (projection head) to get an embedding out of the patch, i.e. $bold(e) = f(bold(p))$, where bold(p) is the flatten vector of the patch pixel value.
The position encoding is also a bit different from the one in text.
== Audio Transformer
= Applications
== Sequence classification (Encoder only)
== Token prediction (Decoder only)
The downstream task that most of you are probably familiar with is token prediction, either
== Translation and embedding (Encoder and Decoder)
= Alternative architectures
== MLP mixer
Mixer @Tolstikhin2021MLPMixerAA
== State space model
S4 @Gu2021EfficientlyML @Gu2023MambaLS @Cirone2024TheoreticalFO
#bibliography("transformer.bib") |
|
https://github.com/Enter-tainer/typstyle | https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/test.typ | typst | Apache License 2.0 | #link("http://example.com")[test]
|
https://github.com/ChristophVanDeest/FH-Kiel-Typst-Template | https://raw.githubusercontent.com/ChristophVanDeest/FH-Kiel-Typst-Template/main/lib/template.typ | typst | MIT License | #let template(
is-thesis: true,
is-master-thesis: false,
is-bachelor-thesis: true,
is-report: false,
language: "en",
title-de: "",
keywords-de: none,
abstract-de: none,
title-en: none,
keywords-en: none,
abstract-en: none,
author: "",
faculty: "",
department: "",
study-course: "",
supervisors: (),
submission-date: none,
include-declaration-of-independent-processing: false,
body,
) = {
let HEADING_1_TOP_MARGIN = if is-thesis {
104pt
} else {
20pt
}
let PAGE_MARGIN_TOP = 37mm
let title = title-de
if language == "en" {
title = title-en
}
// Set the document's basic properties.
set document(author: author, title: title, date: submission-date)
set page(
margin: (left: 31.5mm, right: 31.5mm, top: PAGE_MARGIN_TOP, bottom: 56mm),
numbering: "1",
number-align: right,
binding: left,
header-ascent: 24pt,
header: context {
// Before
let selector_before = selector(heading.where(level: 1)).before(here())
let level_before = counter(selector_before)
let headings_before = query(selector_before)
if headings_before.len() == 0 {
return
}
// After
let selector_after = selector(heading.where(level: 1)).after(here())
let level_after = counter(selector_after)
let headings_after = query(selector_after)
if headings_after.len() == 0 {
return
}
// Get headings
let heading_before = headings_before.last()
let heading_after = headings_after.first()
// Decide on heading
let heading = heading_before
let level = level_before
if heading_after.location().page() == here().page() {
if heading_after.location().position().y == (HEADING_1_TOP_MARGIN + PAGE_MARGIN_TOP) or heading_after.location().position().y == PAGE_MARGIN_TOP {
// Next header is first element of page
return
} else {
heading = heading_after
level = level_after
}
}
set text(size: 11.5pt)
grid(
rows: 2,
gutter: 5pt,
if heading.numbering != none {
emph(level.display() + " " + heading.body)
} else {
emph(heading.body)
},
line(length: 100%, stroke: 0.7pt),
)
}
)
set par(leading: 9pt)
set text(font: "New Computer Modern", lang: language, size: 10.85pt)
set heading(
numbering: "1.1",
)
// Configure correct spacing between headings and headings or paragraphs
show heading: h => {
let top_margin = 0pt
let bottom_margin = 0pt
let text_counter = text(counter(heading).display())
let text_body = text(h.body)
if h.level == 1 {
text_counter = text(counter(heading).display(), font: "New Computer Modern 08", size: 21pt, weight: 600)
text_body = text(h.body, font: "New Computer Modern 08", size: 21pt, weight: 600)
if is-thesis {
// New page if configured
pagebreak(weak: true)
top_margin = HEADING_1_TOP_MARGIN
} else if here().position().y > HEADING_1_TOP_MARGIN {
// Only apply this when the header is not at the top of the page
top_margin = HEADING_1_TOP_MARGIN
}
bottom_margin = 20pt
} else if h.level == 2 {
text_counter = text(counter(heading).display(), size: 14pt)
text_body = text(h.body, size: 14pt)
top_margin = 20pt
bottom_margin = 20pt
} else {
text_counter = text(counter(heading).display(), size: 9pt)
text_body = text(h.body, size: 10pt)
top_margin = 20pt
bottom_margin = 20pt
}
// Draw headings
v(top_margin)
if h.numbering != none {
grid(
columns: 2,
gutter: 10pt,
text_counter,
text_body
)
} else {
text_body
}
v(bottom_margin)
}
// Cover
import "pages/cover.typ": cover_page
cover_page(
is-thesis: is-thesis,
is-master-thesis: is-master-thesis,
is-bachelor-thesis: is-bachelor-thesis,
is-report: is-report,
title: title,
author: author,
faculty: faculty,
department: department,
study-course: study-course,
supervisors: supervisors,
submission-date: submission-date,
)
// Abstract
if abstract-de != none or abstract-en != none {
import "pages/abstract.typ": abstract_page
if (language == "en") {
abstract_page(
language: "en",
author: author,
title: title-en,
keywords: keywords-en,
abstract: abstract-en,
)
}
abstract_page(
language: "de",
author: author,
title: title-de,
keywords: keywords-de,
abstract: abstract-de,
)
}
// Table of contents.
import "pages/outline.typ": outline_page
outline_page()
// List of Figures
if is-thesis {
include "pages/list_of_figures.typ"
}
// List of Tables
if is-thesis {
include "pages/list_of_tables.typ"
}
// Listings
if is-thesis {
include "pages/listings.typ"
}
// Reset page numbering and set it to numbers
set page(
numbering: "1",
)
counter(page).update(1)
// Main body.
set par(justify: true)
body
// Declaration of independent processing
if include-declaration-of-independent-processing {
pagebreak(weak: true)
import "pages/declaration_of_independent_processing.typ": declaration_of_independent_processing
declaration_of_independent_processing()
}
}
|
https://github.com/maxtremblay/cv | https://raw.githubusercontent.com/maxtremblay/cv/main/sources/fr.typ | typst | #import "template.typ": cv, dateItem, reference, grant
#set text(lang: "fr")
#show: doc => cv(
doc,
name: [<NAME>],
contact: ([t.maxime#sym.at\pm.me], [418-590-3429])
)
= Éducation
#dateItem(
date: [2022],
title: [Doctorat en physique],
subtitle: [
Université de Sherbrooke | Sherbrooke, Québec, Canada
],
body: [
Pour ma thèse,
j'ai conçu et étudié des méthodes de correction d'erreurs et de calcul
quantique tolérant aux fautes.
J'ai également prouver plusieurs théorèmes sur ce sujet.
Tout cela a mené à plusieurs publications et brevets
avec de nombreux collaborateurs.
]
)
#dateItem(
date: [2016],
title: [Baccalauréat en physique],
subtitle: [
Université Laval | Québec, Québec, Canada
],
)
= Expérience
#dateItem(
date: [2022 #sym.dash.em],
title: [Chercheur en information quantique],
subtitle: [Nord quantique #sym.bar.v Sherbrooke, Québec, Canada],
body: [
Je développe des modèles mathématiques et des outils numériques
pour comparer diverses architectures d'ordinateurs quantiques bosoniques
pour le calcul tolérant aux fautes.
Ces outils permettent de prendre des décisions clés pour orienter
les efforts de recherche au sein de la compagnie.
Je participe activement au recrutement pour former une équipe de recherche
en informatique quantique théorique pour la compagnie.
]
)
#dateItem(
date: [2021 #sym.dash.em 2022],
title: [Développeur de logiciels scientifiques],
subtitle: [Xanadu AI #sym.bar.v Toronto, Ontario, Canada],
body: [
J'ai fait plusieurs contributions significatives à un logiciel de
simulations de calcul quantique tolérant aux fautes pour un ordinateur photonique.
L'ensemble de mes contributions ont mené à des simulations cent fois plus rapides.
]
)
#dateItem(
date: [2020],
title: [Stagiaire de recherche en informatique quantique],
subtitle: [Microsoft Research #sym.bar.v Redmont, Washington, États-Unis],
body: [
J’ai conçu des circuits d’extraction du syndrome et une architecture
multi-planaire pour le calcul quantique tolérant aux fautes à l’aide de codes
correcteurs éparses.
J'ai implémenter un logiciel pour la simulation de ces circuits et effectuer les
simulations à l'aide de super-ordinateurs.
Les résultats ont mené à la publication de 2 articles
scientifiques et 2 brevets.
]
)
#dateItem(
date: [2017 #sym.dash.em 2022],
title: [Auxiliaire d'enseignement en physique],
subtitle: [Université de Sherbrooke #sym.bar.v Sherbrooke, Québec, Canada],
body: [
Enseignement des séances d'exercices et de démonstrations et correction des travaux
pour 8 cours au baccalauréat en physique.
]
)
= Publications
#reference(
title: [Finite-rate sparse quantum codes aplenty],
authors: [<NAME>, <NAME>, <NAME>],
publisher: [Quantum journal],
date: [2023],
)
#reference(
title: [Constant-overhead quantum error correction with thin planar connectivity],
authors: [<NAME>, <NAME>, <NAME>],
publisher: [Physical Review Letters],
date: [2022],
)
#reference(
title: [Mitiq: A software package for error mitigation on noisy quantum computers],
authors: [<NAME> et al.],
publisher: [Quantum journal],
date: [2022],
)
#reference(
title: [Bounds on stabilizer measurement circuits and obstructions to
local implementations of quantum LDPC codes],
authors: [<NAME>, <NAME>, <NAME>],
publisher: [arXiv],
date: [2021],
)
#reference(
title: [Méthodes de calcul avec réseaux de tenseurs en physique],
authors: [<NAME>, <NAME>, <NAME>, <NAME>],
publisher: [Canadian journal of physics],
date: [2020],
)
#reference(
title: [Depth versus Breadth in Convolutional Polar Codes],
authors: [<NAME>, <NAME>, <NAME>],
publisher: [Proceedings of the IEEE Information Theory Workshop],
date: [2018],
)
= Brevets
#reference(
title: [Short-Depth Syndrome Extraction Circuits for Calderbank Shor Steane (CSS) Stabilizer codes],
authors: [<NAME>, <NAME>, <NAME>],
date: [2021],
)
#reference(
title: [Short-Depth Syndrome Extraction Circuits in 2D Quantum Architectures for Hypergraph Product Codes],
authors: [<NAME>, <NAME>, <NAME>],
date: [2021],
)
= Implications et bénévolat
= Bourses et prix
#grant(
title: [Bourse d’étude supérieure du Canada au niveau du doctorat],
organization: [Conseil de recherches en sciences naturelles et en génie du Canada (CRSNG)],
date: [2019 #sym.dash.em 2022]
)
|
|
https://github.com/goshakowska/Typstdiff | https://raw.githubusercontent.com/goshakowska/Typstdiff/main/tests/test_working_types/quoted/quoted_updated.typ | typst | #quote[I know that this quote was updated.]
#quote[Only the dead have seen the end of war.] |
|
https://github.com/typst/packages | https://raw.githubusercontent.com/typst/packages/main/packages/preview/unichar/0.1.0/ucd/block-102A0.typ | typst | Apache License 2.0 | #let data = (
("CARIAN LETTER A", "Lo", 0),
("CARIAN LETTER P2", "Lo", 0),
("CARIAN LETTER D", "Lo", 0),
("CARIAN LETTER L", "Lo", 0),
("CARIAN LETTER UUU", "Lo", 0),
("CARIAN LETTER R", "Lo", 0),
("CARIAN LETTER LD", "Lo", 0),
("CARIAN LETTER A2", "Lo", 0),
("CARIAN LETTER Q", "Lo", 0),
("CARIAN LETTER B", "Lo", 0),
("CARIAN LETTER M", "Lo", 0),
("CARIAN LETTER O", "Lo", 0),
("CARIAN LETTER D2", "Lo", 0),
("CARIAN LETTER T", "Lo", 0),
("CARIAN LETTER SH", "Lo", 0),
("CARIAN LETTER SH2", "Lo", 0),
("CARIAN LETTER S", "Lo", 0),
("CARIAN LETTER C-18", "Lo", 0),
("CARIAN LETTER U", "Lo", 0),
("CARIAN LETTER NN", "Lo", 0),
("CARIAN LETTER X", "Lo", 0),
("CARIAN LETTER N", "Lo", 0),
("CARIAN LETTER TT2", "Lo", 0),
("CARIAN LETTER P", "Lo", 0),
("CARIAN LETTER SS", "Lo", 0),
("CARIAN LETTER I", "Lo", 0),
("CARIAN LETTER E", "Lo", 0),
("CARIAN LETTER UUUU", "Lo", 0),
("CARIAN LETTER K", "Lo", 0),
("CARIAN LETTER K2", "Lo", 0),
("CARIAN LETTER ND", "Lo", 0),
("CARIAN LETTER UU", "Lo", 0),
("CARIAN LETTER G", "Lo", 0),
("CARIAN LETTER G2", "Lo", 0),
("CARIAN LETTER ST", "Lo", 0),
("CARIAN LETTER ST2", "Lo", 0),
("CARIAN LETTER NG", "Lo", 0),
("CARIAN LETTER II", "Lo", 0),
("CARIAN LETTER C-39", "Lo", 0),
("CARIAN LETTER TT", "Lo", 0),
("CARIAN LETTER UUU2", "Lo", 0),
("CARIAN LETTER RR", "Lo", 0),
("CARIAN LETTER MB", "Lo", 0),
("CARIAN LETTER MB2", "Lo", 0),
("CARIAN LETTER MB3", "Lo", 0),
("CARIAN LETTER MB4", "Lo", 0),
("CARIAN LETTER LD2", "Lo", 0),
("CARIAN LETTER E2", "Lo", 0),
("CARIAN LETTER UUU3", "Lo", 0),
)
|
https://github.com/The-Notebookinator/notebookinator | https://raw.githubusercontent.com/The-Notebookinator/notebookinator/main/themes/linear/components/glossary.typ | typst | The Unlicense | #import "/utils.typ"
#let glossary = utils.make-glossary(glossary => {
stack(
dir: ttb,
spacing: 15pt,
..for entry in glossary {
(
[
#box(
inset: 0.5em,
fill: gray,
)[== #entry.word]
#h(5pt)
#box(
baseline: -10pt,
width: 1fr,
line(length: 100%),
)
#entry.definition
],
)
},
)
})
|
https://github.com/ludwig-austermann/modpattern | https://raw.githubusercontent.com/ludwig-austermann/modpattern/main/examples/pretty_letter.typ | typst | MIT License | #import "../main.typ": *
#let nice-border(S, T, p) = place(top+left, polygon(
(S, S), (100% - S, S), (100% - S, 100% - S), (S, 100% - S),
(S, S), (T, T), ((T, 100% - T)), (100% - T, 100% - T), (100% - T, T),
(T, T), fill: p
))
#let lred = red.lighten(50%)
#let patsize = (16pt, 8pt)
#set page(
background: {
nice-border(10mm, 20mm, modpattern(
patsize,
{
place(line(start: (0%,0%), end: (100%, 100%), stroke: 2pt))
place(line(start: (100%,0%), end: (0%, 100%), stroke: 2pt))
},
background: lred,
))
nice-border(8mm, 11.2mm, modpattern(
patsize,
line(start: (0%,0%), end: (100%, 100%), stroke: 2pt),
background: lred
))
nice-border(19.8mm, 22mm, modpattern(
patsize,
line(start: (100%,0%), end: (0%, 100%), stroke: 2pt),
background: lred
))
},
margin: 3cm
)
#set par(justify: true)
#show heading: it => {
set text(30pt, fill: modpattern(
(10pt, 5pt),
{
place(line(start: (0%,0%), end: (100%, 100%)))
place(line(start: (100%,0%), end: (0%, 100%)))
},
background: red.lighten(50%)
))
it
}
= Hello Dear People
#lorem(500) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.