repo
stringlengths
26
115
file
stringlengths
54
212
language
stringclasses
2 values
license
stringclasses
16 values
content
stringlengths
19
1.07M
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/projects/highlighter/README.md
markdown
Apache License 2.0
# highlighter-typst Usage with `highlight.js`: ```html <!-- import as cjs, js bundled, wasm bundled --> <script id="script-main" src="https://cdn.jsdelivr.net/npm/@myriaddreamin/highlighter-typst/dist/cjs/contrib/hljs/typst.bundle.js" ></script> <!-- import as cjs, js not bundled, wasm bundled --> <!-- <script id="script-main" src="https://cdn.jsdelivr.net/npm/@myriaddreamin/highlighter-typst/dist/cjs/contrib/hljs/typst-lite.bundle.js"></script> --> <!-- import as esm, js bundled, wasm bundled --> <!-- <script id="script-main" type="module" src="https://cdn.jsdelivr.net/npm/@myriaddreamin/highlighter-typst/dist/esm/contrib/hljs/typst.bundle.js"></script> --> <!-- import as esm, js not bundled, wasm not bundled --> <!-- <script id="script-main" type="module" src="https://cdn.jsdelivr.net/npm/@myriaddreamin/highlighter-typst/dist/esm/contrib/hljs/typst-lite.mjs"></script> --> <!-- import as esm, js bundled, wasm not bundled --> <!-- <script id="script-main" type="module" src="https://cdn.jsdelivr.net/npm/@myriaddreamin/highlighter-typst/dist/esm/contrib/hljs/typst-lite.bundle.js"></script> --> <script> const run = $typst$parserModule.then(() => { hljs.registerLanguage( 'typst', window.hljsTypst({ // TypstHljsOptions codeBlockDefaultLanguage: 'typst', }), ); // esm document.getElementById('script-main').onload = run; // cjs run(); </script> ``` Documentation for `highlight.js` apis: ````ts /** * A function that constructs a language definition for hljs * @param options options for the hljsTypst function. * @returns a language definition for hljs. * See {@link TypstHljsOptions} for more details. * * @example * * Default usage: * ```ts * hljs.registerLanguage('typst', window.hljsTypst()); * ``` * * @example * * Don't handle code blocks: * ```ts * hljs.registerLanguage('typst', window.hljsTypst({ * handleCodeBlocks: false, * })); * * @example * * Handle code blocks with a custom function: * ```ts * hljs.registerLanguage('typst', window.hljsTypst({ * handleCodeBlocks: (code, emitter) => { * return false; * }); * })); * ``` * * @example * * Set the default language for code blocks: * ```ts * hljs.registerLanguage('typst', window.hljsTypst({ * codeBlockDefaultLanguage: 'rust', * })); * ``` */ export function hljsTypst(options?: TypstHljsOptions); /** * Options for the `hljsTypst` function. * @param handleCodeBlocks - Whether to handle code blocks. * Defaults to true. * If set to false, code blocks will be rendered as plain code blocks. * If set to true, a default handler will be used. * If set to a function, the function will be used as the handler. * * When the `hljsTypst` has a code block handler, the code block will be called with the code block content and the emitter. * * If the handler return false, the code block will be still rendered as plain code blocks. * * @param codeBlockDefaultLanguage - The default language for code blocks. * Defaults to undefined. */ export interface TypstHljsOptions { handleCodeBlocks?: boolean | ((code: string, emitter: any) => /*handled*/ boolean); codeBlockDefaultLanguage?: string; } ````
https://github.com/herbhuang/utdallas-thesis-template-typst
https://raw.githubusercontent.com/herbhuang/utdallas-thesis-template-typst/main/content/proposal/introduction.typ
typst
MIT License
#import "/utils/todo.typ": TODO = Introduction #TODO[ // Remove this block *Introduction* - Introduce the reader to the general setting (No Problem description yet) - What is the environment? - What are the tools in use? - (Not more than 1/2 a page) ]
https://github.com/soul667/typst
https://raw.githubusercontent.com/soul667/typst/main/PPT/typst-slides-fudan/themes/polylux/book/src/dynamic/handout.typ
typst
#import "../../../polylux.typ": * #set page(paper: "presentation-16-9") #set text(size: 30pt) #enable-handout-mode(true) // ... #polylux-slide[ Some text. #uncover("3-")[You cannot always see this.] ...Or can you? ]
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/cetz/0.2.0/src/lib/decorations/path.typ
typst
Apache License 2.0
// Library for drawing springs #import "/src/draw.typ" #import "/src/styles.typ" #import "/src/coordinate.typ" #import "/src/vector.typ" #import "/src/process.typ" #import "/src/path-util.typ" #import "/src/util.typ" #import "/src/bezier.typ" #let default-style = ( /// Number of segments segments: 10, /// Length of a single segments segment-length: none, /// Amplitude of a segment in the direction of the segments normal amplitude: 1, /// Decoration start start: 0%, /// Decoration stop stop: 100%, /// Decoration alignment on the target path align: "START", /// Draw remaining space as line ("LINE") or none rest: "LINE", /// Up-vector for 3D lines z-up: (0, 1, 0), /// Up-vector for 2D lines xy-up: (0, 0, -1), stroke: auto, fill: none, mark: auto, ) // Zig-Zag default style #let zigzag-default-style = ( ..default-style, /// Midpoint factor /// 0%: Sawtooth (up-down) /// 50%: Triangle /// 100%: Sawtooth (down-up) factor: 50%, ) // Wave default style #let wave-default-style = ( ..default-style, /// Wave (catmull-rom) tension tension: .5, ) // Coil default style #let coil-default-style = ( ..default-style, /// Coil "overshoot" factor factor: 150%, ) #let resolve-style(ctx, segments, style) = { assert(not (style.segments == none and style.segment-length == none), message: "Only one of segments or segment-length must be set, while the other must be auto") assert(style.segments != none or style.segment-length != none, message: "Either segments or segment-length must be not equal to none") // Calculate absolute start/stop distances let len = path-util.length(segments) if type(style.start) == ratio { style.start = len * style.start / 100% } style.start = calc.max(0, calc.min(style.start, len)) if type(style.stop) == ratio { style.stop = len * style.stop / 100% } style.stop = calc.max(0, calc.min(style.stop, len)) if style.segment-length != none { // Calculate number of divisions let n = (style.stop - style.start) / style.segment-length style.segments = calc.floor(n) // Divides the rest between start, stop or both let r = (n - calc.floor(n)) * style.segment-length if style.align == "MID" { let m = (style.start + style.stop) / 2 style.start = m - n * style.segment-length / 2 style.stop = m + n * style.segment-length / 2 } else if style.align == "STOP" { style.start = style.stop - n * style.segment-length } else if style.align == "START" { style.stop = style.start + n * style.segment-length } } return style } #let get-segments(ctx, target) = { if type(target) == array { assert.eq(target.len(), 1, message: "Expected a single element, got " + str(target.len())) target = target.first() } let (ctx, drawables, ..) = process.element(ctx, target) if drawables == none or drawables == () { return () } let first = drawables.first() return (segments: first.segments, close: first.close) } // Add optional line elements from segments start to mid-path start // and mid-path end to sgements end #let finalize-path(ctx, segments, style, mid-path, close: false) = { let add = style.rest == "LINE" and not close let (ctx, drawables, ..) = process.many(ctx, mid-path) let mid-first = drawables.first().segments.first() let mid-last = drawables.last().segments.last() if add { let start = path-util.segment-start(segments.first()) start = util.revert-transform(ctx.transform, start) let mid-start = path-util.segment-start(mid-first) mid-start = util.revert-transform(ctx.transform, mid-start) draw.line(start, mid-start, mark: none) } mid-path; if add { let end = path-util.segment-end(segments.last()) end = util.revert-transform(ctx.transform, end) let mid-end = path-util.segment-end(mid-last) mid-end = util.revert-transform(ctx.transform, mid-end) draw.line(mid-end, end, mark: none) } // TODO: Add marks on path. } // Call callback `fn` for each decoration segment // on path `segments`. // // The callback gets called with the following arguments: // - i Segment index // - start Segment start point // - end Segment end point // - norm Normal vector (length 1) // Result values get returned as an array #let _path-effect(ctx, segments, fn, close: false, style) = { let n = style.segments assert(n > 0, message: "Number of segments must be greater than 0") let (start, stop) = (style.start, style.stop) let inc = (stop - start) / n let pts = () let len = path-util.length(segments) for i in range(0, n) { let p0 = path-util.point-on-path(segments, calc.max(start, start + inc * i)) let p1 = path-util.point-on-path(segments, calc.min(stop, start + inc * (i + 1))) if p0 == p1 { continue } (p0, p1) = util.revert-transform(ctx.transform, p0, p1) let dir = vector.sub(p1, p0) let norm = vector.norm(vector.cross(dir, if p0.at(2) != p1.at(2) { style.z-up } else { style.xy-up })) pts += fn(i, p0, p1, norm) } return pts } /// Draw a zig-zag or saw-tooth wave along a path /// /// The number of tooths can be controlled via the `segments` or `segment-length` style key, /// and the width via `amplitude`. /// /// ```example /// line((0,0), (2,1), stroke: gray) /// cetz.decorations.zigzag(line((0,0), (2,1)), amplitude: .25, start: 10%, stop: 90%) /// ``` /// /// = Styling /// *Root* `zigzag` /// == Keys /// #show-parameter-block("factor", ("ratio",), default: 100%, [ /// Triangle mid between its start and end. Setting this to 0% leads to /// a falling sawtooth shape, while 100% results in a raising sawtooth]) /// /// - target (drawable): Target path /// - close (auto,bool): Close the path /// - name (none,string): Element name /// - ..style (style): Style #let zigzag(target, name: none, close: auto, ..style) = draw.get-ctx(ctx => { let style = styles.resolve(ctx, merge: style.named(), base: zigzag-default-style, root: "zigzag") let (segments, close) = get-segments(ctx, target) let style = resolve-style(ctx, segments, style) let num-segments = style.segments // Return points for a zigzag line // // m1 ▲ // / \ │ Up // ..a....\....b.. ' // \ / // m2 // |--| // q-dir (quarter length between a and b) // // For the first/last segment, a/b get added. For all // other segments we only have to add m1 and m2 to the // list of points for the line-strip. let fn(i, a, b, norm) = { let ab = vector.sub(b, a) let f = .25 - (50% - style.factor) / 50% * .25 let q-dir = vector.scale(ab, f) let up = vector.scale(norm, style.amplitude / 2) let down = vector.scale(up, -1) let m1 = vector.add(vector.add(a, q-dir), up) let m2 = vector.add(vector.sub(b, q-dir), down) return if not close and i == 0 { (a, m1, m2) // First segment: add a } else if not close and i == num-segments - 1 { (m1, m2, b) // Last segment: add b } else { (m1, m2) } } let pts = _path-effect(ctx, segments, fn, close: close, style) return draw.merge-path( finalize-path(ctx, segments, style, draw.line(..pts, name: name, ..style, mark: none), close: close), close: close, ..style) }) /// Draw a stretched coil/loop spring along a path /// /// The number of windings can be controlled via the `segments` or `segment-length` style key, /// and the width via `amplitude`. /// /// ```example /// line((0,0), (2,1), stroke: gray) /// cetz.decorations.coil(line((0,0), (2,1)), amplitude: .25, start: 10%, stop: 90%) /// ``` /// /// = Styling /// *Root* `coil` /// == Keys /// #show-parameter-block("factor", ("ratio",), default: 150%, [ /// Factor of how much the coil overextends its length to form a curl.]) /// /// - target (drawable): Target path /// - close (auto,bool): Close the path /// - name (none,string): Element name /// - ..style (style): Style #let coil(target, close: auto, name: none, ..style) = draw.get-ctx(ctx => { let style = styles.resolve(ctx, merge: style.named(), base: coil-default-style, root: "coil") let (segments, close) = get-segments(ctx, target) let style = resolve-style(ctx, segments, style) let num-segments = calc.max(style.segments, 1) let length = path-util.length(segments) let phase-length = length / num-segments let overshoot = calc.max(0, (style.factor - 100%) / 100% * phase-length) // Offset both control points so the curve approximates // an elliptic arc let ellipsize-cubic(s, e, c1, c2) = { let m = vector.scale(vector.add(c1, c2), .5) let d = vector.sub(e, s) c1 = vector.sub(m, vector.scale(d, .5)) c2 = vector.add(m, vector.scale(d, .5)) return (s, e, c1, c2) } // Return a list of drawables to form a coil-like loop // // ____ ┐ // / \ │ Upper curve // | | ┘ // ..a...b..|.. ┐ Lower curve // \_/ ┘ // // └──┘ // Overshoot // let fn(i, a, b, norm) = { let ab = vector.sub(b, a) let up = vector.scale(norm, style.amplitude / 2) let dist = vector.dist(a, b) let d = vector.norm(ab) let overshoot-at(i) = if num-segments <= 1 { 0 } else if close { overshoot / 2 } else { i / (num-segments - 1) * overshoot } let next-a = vector.sub(b, vector.scale(d, overshoot-at(i + 1))) let a = vector.sub(a, vector.scale(d, overshoot-at(i))) let b = vector.add(b, vector.scale(d, overshoot-at(num-segments - i))) let m = vector.scale(vector.add(a, b), .5) let m-up = vector.add(m, up) let m-down = vector.sub(vector.scale(vector.add(next-a, b), .5), up) let upper = bezier.cubic-through-3points(a, m-up, b) upper = ellipsize-cubic(..upper) let lower = bezier.cubic-through-3points(b, m-down, next-a) lower = ellipsize-cubic(..lower) if i < num-segments - 1 or close { return ( draw.bezier(..upper, mark: none), draw.bezier(..lower, mark: none), ) } else { return (draw.bezier(..upper, mark: none),) } } return draw.merge-path( finalize-path(ctx, segments, style, _path-effect(ctx, segments, fn, close: close, style).flatten(), close: close), ..style, name: name, close: close) }) /// Draw a wave along a path using a catmull-rom curve /// /// The number of phases can be controlled via the `segments` or `segment-length` style key, /// and the width via `amplitude`. /// /// ```example /// line((0,0), (2,1), stroke: gray) /// cetz.decorations.wave(line((0,0), (2,1)), amplitude: .25, start: 10%, stop: 90%) /// ``` /// /// = Styling /// *Root* `wave` /// == Keys /// #show-parameter-block("tension", ("float",), default: .5, [ /// Catmull-Rom curve tension, see @@catmull().]) /// /// - target (drawable): Target path /// - close (auto,bool): Close the path /// - name (none,string): Element name /// - ..style (style): Style #let wave(target, close: auto, name: none, ..style) = draw.get-ctx(ctx => { let style = styles.resolve(ctx, merge: style.named(), base: wave-default-style, root: "wave") let (segments, close) = get-segments(ctx, target) let style = resolve-style(ctx, segments, style) let num-segments = style.segments // Return a list of points for the catmull-rom curve // // ╭ ma ╮ ▲ // │ │ │ Up // ..a....m....b.. ' // │ │ // ╰ mb ╯ // let fn(i, a, b, norm) = { let ab = vector.sub(b, a) let up = vector.scale(norm, style.amplitude / 2) let down = vector.scale( up, -1) let ma = vector.add(vector.add(a, vector.scale(ab, .25)), up) let m = vector.add(a, vector.scale(ab, .50)) let mb = vector.add(vector.sub(b, vector.scale(ab, .25)), down) if not close { if i == 0 { return (a, ma, mb) } else if i == num-segments - 1 { return (ma, mb, b,) } } return (ma, mb) } return draw.merge-path( finalize-path(ctx, segments, style, draw.catmull( .._path-effect(ctx, segments, fn, close: close, style), close: close), close: close) , name: name, close: close, ..style) })
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/canonical-nthu-thesis/0.1.0/template/thesis.typ
typst
Apache License 2.0
#import "@preview/canonical-nthu-thesis:0.1.0": setup-thesis #let ( doc, cover-pages, preface, outline-pages, body, ) = setup-thesis( info: ( degree: "master", title-zh: [一個標題有點長的 \ 有趣的研究], title-en: [An Interesting Research \ With a Somewhat Long Title], department-zh: "某學系", department-en: "Mysterious Department", id: "012345678", author-zh: "張三", author-en: "<NAME>", supervisor-zh: "李四 教授", supervisor-en: "Prof. <NAME>", year-zh: "一一三", month-zh: "七", date-en: "July 2024", ), style: ( margin: (top: 1.75in, left: 2in, right: 1in, bottom: 2in), ), ) #cover-pages() //////////////////////////////////////////////////////////////////////////////////////////////// // The preface, which contains the abstract, the acknowledgements, and the table(s) of contents. // 前言部分,包含摘要、誌謝、大綱及圖表目錄。 #show: preface = 摘要 此論文模板使用Typst @madje2022programmable\標記語言排版。請參閱隨附的README文件以及位於https://typst.app/docs/的文檔了解如何使用Typst。 // Fake abstract text. Delete it and fill in your actual abstract. 本文深入探討一個未指定領域的主題,深入研究一個模糊的概念及其複雜性。研究方法採用了難以理解的方式進行,所呈現的發現幾乎沒有清晰度或實質性的貢獻。這項工作的意義同樣模糊不清,讓讀者留下更多疑問而非答案。 關鍵詞:未指定領域、模糊概念、難以理解的方法、不清的發現、模糊的意義 #pagebreak() = Abstract This template for master theses / doctoral dissertations uses Typst @madje2022programmable. Refer to the README file and the upstream documentations at https://typst.app/docs/ to know more about Typst. // Fake generic text. Delete it and fill in your actual abstract. #lorem(150) #pagebreak() = 誌謝 // Fake acknowledgements text. Delete it and fill in your actual acknowledgements. 在完成這篇論文的過程中,我得到了許多人的幫助和支持。首先,我要感謝我的指導老師李四,是他悉心的指導和鼓勵,才讓我得以順利完成這篇論文。其次,我要感謝我的父母和家人,是他們無私的愛和支持,給了我堅持下去的力量。此外,還要感謝我的同學和朋友們,是他們在學習和生活上對我的幫助,讓我受益匪淺。 最後,我要感謝所有曾經幫助過我的人。正是有了大家的幫助,我才得以取得今天的成績。 #pagebreak() #outline-pages /////////////////// // The main matter. // 本文部分。 #show: body = Introduction #figure( square(size: 100pt, fill: gradient.linear(..color.map.rainbow)), caption: [A figure to populate the image list], placement: bottom, ) #lorem(300) = Background == Important background #lorem(100) == Previous works #lorem(100) = Methods == An excellent method #figure( table( columns: 4, table.header([], [Apples], [Bananas], [Cherries]), [Alice], [1.0], [2.0], [3.0], [Bob], [1.5], [1.0], [0.5], [Eve], [3.5], [7.5], [1.2], ), caption: [A dummy table to populate the table index page], placement: bottom, ) #lorem(100) == Another method #lorem(100) = Experiments == Setup #lorem(100) == The results #lorem(100) = Conclusion #lorem(200) #bibliography("citations.bib", style: "ieee")
https://github.com/darioglasl/Arbeiten-Vorlage-Typst
https://raw.githubusercontent.com/darioglasl/Arbeiten-Vorlage-Typst/main/Anhang/04_Projektdokumentation/00_index.typ
typst
== Projektdokumentation Hier sind Details zu dem Ablauf der Arbeit zu finden. #include "02_aufgabenstellung.typ" #pagebreak() #include "04_jira.typ" #pagebreak() #include "01_reviews.typ" #pagebreak() #include "05_zeitmanagement.typ"
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/ttt-exam/0.1.0/lib/points.typ
typst
Apache License 2.0
#import "@preview/ttt-utils:0.1.0": grading #import "i18n.typ": * #let total_points = context grading.get_points().sum() // Show a box with the total_points #let point-sum-box = { box(stroke: 1pt, inset: 0.8em, radius: 3pt)[ #set align(bottom) #stack( dir:ltr, spacing: 0.5em, box[#text(1.4em, sym.sum) :], line(stroke: 0.5pt), "/", [#total_points #smallcaps[PTs]] ) ] } // Show a table with point distribution #let point-table = { context { let points = grading.get_points() box(radius: 5pt, clip: true, stroke: 1pt, table( align: (col, _) => if (col == 0) { end } else { center }, inset: (x: 1em, y:0.6em), fill: (x,y) => if (x == 0 or y == 0) { luma(230) }, rows: (auto, auto, 1cm), columns: (auto, ..((1cm,) * points.len()), auto), linguify("assignment", from: ling_db), ..points.enumerate().map(((i,_)) => [#{i+1}]), linguify("total", from: ling_db), linguify("points", from: ling_db), ..points.map(str), total_points, linguify("awarded", from: ling_db), ) ) } }
https://github.com/jamesrswift/typst-chem-par
https://raw.githubusercontent.com/jamesrswift/typst-chem-par/main/src/chem-par.typ
typst
MIT License
#import "stateful.typ": * #import "constants.typ": * #import "rules.typ" #let chem-style = (body) => { show: rules.formulae show: rules.isomers show: rules.enantiomers show: rules.greek show: rules.fischer-dropcaps show: rules.deuterated body }
https://github.com/HEIGVD-Experience/docs
https://raw.githubusercontent.com/HEIGVD-Experience/docs/main/S4/EXP/docs/pres-1min.typ
typst
#import "/_settings/typst/template-qk.typ": conf #show: doc => conf( title: [ Pourquoi une gourde peut sauver le monde? ], lesson: "EXP", col: 1, doc, ) = Pourquoi une gourde peut sauver le monde? - Qui ne possède pas une gourde en ce moment dans cette classe? - Mon objectif durant cette minute de présentation, est de vous convaincre de toutes et tous avoir une gourde sur vous toute la journée! - *À l'image d'un champ sans pesticides, une gourde sans plastique protège non seulement votre corps, mais aussi votre environnement.* - Economie financières (300.-/an et 500.-/an) - Protection de l'environnment (1 bouteille = 100 mL de pétrole et 2 litres d’eau) - Chance d'avoir de l'eau potable partout en Suisse - Une gourde est un investissement à faible cout pour votre porte-monnaie pour la planète et pour votre santé! - Et comme l'a dit un jour un grand sage, buvez de l'eau car dans 20/30 ans il y en aura plus!
https://github.com/weeebdev/cv
https://raw.githubusercontent.com/weeebdev/cv/main/modules/skills.typ
typst
Apache License 2.0
#import "../brilliant-CV/template.typ": * #cvSection("Skills") #cvSkill( type: [Languages], info: [English #hBar() Kazakh #hBar() Russian #hBar() Japanese] ) #cvSkill( type: [Tech Stack], info: [JS/TS/Python/Java/C/C++/Golang #hBar() React/Angular #hBar() SQL/MSSQL/MongoDB #hBar() Git/Docker] ) #cvSkill( type: [Soft Skills], info: [Teamwork #hBar() Communication #hBar() Problem Solving #hBar() Leadership] ) // #cvSkill( // type: [Personal Interests], // info: [Swimming #hBar() Cooking #hBar() Reading] // )
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/enum-numbering_02.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page // Test numbering with closure. #enum( start: 3, spacing: 0.65em - 3pt, tight: false, numbering: n => text( fill: (red, green, blue).at(calc.rem(n, 3)), numbering("A", n), ), [Red], [Green], [Blue], [Red], )
https://github.com/alberto-lazari/unipd-typst-doc
https://raw.githubusercontent.com/alberto-lazari/unipd-typst-doc/main/unipd-doc.typ
typst
MIT License
// Comment-style lecture number annotation (# Lecture n) #let lecture(number) = { set text(gray) [\# Lecture #number] } #let notes() = doc => { set text(font: "Arial") doc } #let unipd-doc(title: none, subtitle: none, author: none, date: none) = doc => { let unipd-red = rgb(180, 27, 33) set page(numbering: "1") set list(marker: ([•], [◦], [--])) set heading(numbering: "1.1.") show heading.where(level: 1): it => { set text(fill: unipd-red) it } align(center, { v(10em) figure(image("images/unipd-logo.png", width: 50%)) v(3em) text(size: 30pt, weight: "bold", fill: unipd-red, smallcaps(title)) v(5pt) text(size: 25pt, weight: "bold", fill: unipd-red, subtitle) parbreak() set text(size: 18pt) author parbreak() date pagebreak() }) show outline.entry.where(level: 1): it => { v(1em, weak: true) strong(it) } outline( title: "Index", indent: 2em, ) doc }
https://github.com/mismorgano/UG-FunctionalAnalyisis-24
https://raw.githubusercontent.com/mismorgano/UG-FunctionalAnalyisis-24/main/tareas/Tarea-02/Tarea-02.typ
typst
#import "../../config.typ": config, exercise, proof #show: doc => config( [Tarea 2], doc) #let cls(S) = $overline(#S)$ #exercise[1.10][Muestra que para todo $p>=1$, $l_p$ es linealmente isometrico a un subespacio de $L_p [0, 1]$] #proof[Definamos para todo $n in NN$ $ f_n = (n(n+1))^(1/p) cal(chi)_[1/(n+1), 1/n] $. Mostraremos que $l_p$ es isometrico a $"span"(f_n)$.] #exercise[1.13][Sea $Gamma$ un conjunto y $p in [0, infinity]$. Muestra que $c_0(Gamma)$ y $l_p(Gamma)$ son espacios de Banach] #exercise[1.15][Sea $cal(L)$ un espacio normado de todas las funciones Lipschitz de un espacio de Banach $X$ que son iguales a cero $0$ en el origen, bajo la norma $ norm(f) = sup{(abs(f(x) - f(y)))/norm(x-y); x, y in X}. $ Muestra que $cal(L)$ es un espacio de Banach.] #exercise[1.18][Sea $Y$ un subespacio cerrado de un espacio normado $X$. Muestra que si $Y$ y $X/Y$ son espacios de Banach, entonces tambien lo es $X$.] #proof[Sea ${x_n}$ una sucesión de Cauchy en $X$. ] #exercise[1.19][Sean $Y, Z$ subespacios de un espacio de Banach $X$ tales que $Y$ es isomorfico a $Z$. ¿Son $X/Y$ y $X/Z$ isomorficos?] #exercise[1.20][Muestra que la distancia $d(bb(x))$ de un punto $bb(x) = (x_i) in l_infinity$ a $c_0$ es igual a $limsup_(i -> infinity) abs(x_i)$. Entonces, la norma en $l_infinity/c_0$ es $norm([x]) = limsup_(i -> infinity) abs(x_i)$ ] #proof[Notemos que $ d(bb(x), c_0) &= inf {norm(x - y) : y in c_0} \ &= sum {sup( abs(x_i - y_i))}$] #exercise[1.21][Sean $norm(dot)_1$ y $norm(dot)_2$ son dos normas en un e.v $X$. Sean $B_1$ y $B_2$ las bolas cerradas unitarias de $(X, norm(dot)_1)$ y $(X, norm(dot)_2)$ respectivamente. Prueba que $norm(dot)_1 <= C norm(dot)_2$ ( esto es, $norm(x)_1 <= C norm(x)_2$ para todo $x in X$) ssi $1/C B_2 subset B_1$.] increible #proof[ Supongamos primero que $norm(dot)_1 <= C norm(dot)_2$. Sea $y in 1/C B_2$ entonces existe $x in B_2$ tal que $y = 1/C x$, por hipotesis tenemos que $ norm(y)_1 = norm(x/C)_1 <= C norm(x/C)_2 = C/C norm(x)_2 = norm(x)_2 <=1, $ por lo cual $y in B_1$ y por tanto $1/C B_2 subset B_1$. Ahora supongamos que $1/C B_2 subset B_1$. Sea $x in X$ consideremos $y = x/(norm(x)_2)$ podemos notar que $norm(y)_2 = 1$ entonces $y in B_2$ por hipotesis se sigue que $1/C y in B_1$ lo cual implica que $ 1>= norm(y/C)_1 = 1/C norm(x/norm(x)_1) = 1/(C norm(x)_2) norm(x)_1, $ por lo cual se cumple que $norm(x)_1 <= C norm(x)_2$, como $x$ fue arbitrario obtenemos que $norm(dot)_1 <= C norm(dot)_2$. ]
https://github.com/pedrofp4444/BD
https://raw.githubusercontent.com/pedrofp4444/BD/main/report/content/[5] Implementação Física/indexação.typ
typst
#let indexação = { [ == Indexação do Sistema de Dados Nesta secção aborda-se a necessidade de aplicar uma metodologia de indexação à base de dados, com o objetivo de otimizar a eficiência das operações de pesquisa e manipulação de dados. O primeiro passo é a avaliação e previsão dos pontos de incidência resultantes da utilização da base de dados. O processo de avaliação inicia-se com a identificação das tabelas e colunas que necessitarão de um índice. Após estudo detalhado da situação, concluiu-se que dado que os utilizadores principais da base de dados serão os detetives, prevê-se que as tabelas Caso e Suspeito sejam frequentemente acedidas, tornando assim os seus identificadores (chaves primárias e estrangeiras) pontos críticos de acesso. Recorre-se à utilização de indexação por três motivos principais: + *Melhoria do desempenho das operações de consulta:* A indexação permite um acesso mais rápido aos registos, uma vez que os índices facilitam a localização eficiente dos dados. Isto é particularmente útil para operações de leitura, que são frequentes e exigem tempos de resposta rápidos. + *Redução da necessidade de leitura de dados repetitivos:* Com a utilização de índices, o sistema pode aceder diretamente aos elementos específicos de uma tabela sem necessidade de percorrer todos os registos. Isto reduz a carga de trabalho no sistema de armazenamento e melhora a eficiência geral. + *Facilitação da escalabilidade do sistema:* À medida que o número de registos aumenta, os índices são projetados para lidar com pesquisas simultâneas de forma eficiente, sem degradar o desempenho geral do sistema de gestão de base de dados. Isto é essencial para manter a performance do sistema em ambientes de alto tráfego e grande volume de dados. Na situação da _Lusium_, após identificar os pontos de maior incidência, prossegue-se a criação dos índices nas chaves estrangeiras das duas tabelas com maior frequência. Note-se que não há necessidade de criar índices para chaves primárias, uma vez que naturalmente já são constituídas num índice no momento da sua criação. #align(center)[ #figure( kind: image, caption: [Aplicação de indexação na base de dados.], block( fill: rgb("#f2f2eb"), inset: 8pt, ```sql -- Criação de um índice para a coluna Terreno_ID na tabela Caso CREATE INDEX index_caso_terreno_id ON Caso(Terreno_ID); -- Criação de um índice para a coluna Caso_ID na tabela Suspeito CREATE INDEX idx_suspeito_caso_id ON Suspeito(Caso_ID); -- Criação de um índice para a coluna Funcionário_ID na tabela Suspeito CREATE INDEX idx_suspeito_funcionario_id ON Suspeito(Funcionário_ID); ``` ) ) ] ] }
https://github.com/crd2333/Astro_typst_notebook
https://raw.githubusercontent.com/crd2333/Astro_typst_notebook/main/src/docs/here/to2/3.typ
typst
--- title: "3.0 Introduction" --- sadfdsfsd
https://github.com/yhtq/Notes
https://raw.githubusercontent.com/yhtq/Notes/main/常微分方程/作业/2100012990 郭子荀 常微分方程 6.typ
typst
#import "../../template.typ": proof, note, corollary, lemma, theorem, definition, example, remark, proposition,der, partialDer, Spec #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: note.with( title: "作业4", author: "YHTQ", date: none, logo: none, withOutlined : false, withTitle : false, withHeadingNumbering: false ) #let ex(n) = $e^(#ignoreOne(n) x)$ = p189 == 1 === (1) 先计算特征值: $ 0 = Det(2 - lambda, 1; 3, 4 - lambda) = (2 - lambda)(4 - lambda) - 3 = lambda^2 -6 lambda + 5 $ 解得特征值 $1, 5$,分别对应特征向量: - $ mat(1, 1;3, 3) xi_1 = 0, xi_2 = vec(1, -1) $ - $ mat(-3, 1;3, -1) xi_5 = 0, xi_5 = vec(1, 3) $ 因此一个基础解矩阵为: $ (ex(1) vec(1, -1), ex(5) vec(1, 3)) $ === (3) $ 0 = Det(2 - lambda, -1, 1;1, 2 - lambda, -1;1, -1, 2 - lambda)\ = Det(2 - lambda, -1, 1;1, 2 - lambda, -1;0, lambda - 3, 3 -lambda)\ = Det(2 - lambda, 0, 1;1, 1 - lambda, -1;0, 0, 3 -lambda)\ = (3-lambda)(1-lambda)(2-lambda) $ 特征值分别为 $1, 2, 3$,分别对应特征向量: - $ mat(1, -1, 1;1, 1, -1;1, -1, 1) xi_1 = 0, xi_1 = vec(0, 1, 1) $ - $ mat(0, -1, 1;1, 0, -1;1, -1, 0) xi_2 = 0, xi_2 = vec(1, 1, 1) $ - $ mat(-1, -1, 1;1, -1, -1;1, -1, -1) xi_(3) = 0, xi_(3) = vec(1, 0, 1) $ 因此一个基础解矩阵为: $ (ex(1) vec(0, 1, 1), ex(2) vec(1, 1, 1), ex(3) vec(1, 0, 1)) $ === (5) $ 0 &= Det(4 - lambda, -1, -1;1, 2 - lambda , -1; 1, -1, 2 - lambda)\ &= Det(4 - lambda, -1, -1;0, 3 - lambda , lambda - 3; 1, -1, 2 - lambda)\ &= Det(4 - lambda, -2, -1;0, 0 , lambda - 3; 1, 1 - lambda, 2 - lambda)\ &= -(lambda - 3)((4 - lambda)(1- lambda) + 2)\ &= -(lambda - 3)(lambda^2 - 5 lambda + 6)\ &= -(lambda - 3)(lambda - 2)(lambda - 3) $ 特征值为 $2, 3$,计算特征向量: - $ mat(2, -1, -1;1, 0 , -1; 1, -1, 0) xi_2 = 0, xi_2 = vec(1, 1, 1) $ - $ mat(1, -1, -1;1, -1 , -1; 1, -1, -1) xi_3 = 0, xi_3 = vec(1, 0, 1), vec(1, 1, 0) $ 从而原矩阵可对角化,一个基础解矩阵为: $ mat(ex(2) vec(1, 1, 1), ex(3) vec(1, 0, 1), ex(3) vec(1, 1, 0)) $ === (7) $ 0 &= Det( 3 - lambda, -2, -1; 3, -4 - lambda, -3; 2, -4, - lambda )\ &= Det( 3 - lambda, -2, -1; 1, - lambda, -3 + lambda; 2, -4, - lambda )\ &= Det( 3 - lambda, -2, -1; 1, - lambda, -3 + lambda; 0, 2 lambda - 4, - 3 lambda + 6 )\ &= (lambda - 2) Det( 3 - lambda, -2, -1; 1, - lambda, -3 + lambda; 0, 2, - 3 )\ &= (lambda - 2) Det( 3 - lambda, 0, -4; 1, - lambda, -3 + lambda; 0, 2, - 3 )\ &= (lambda - 2)(-2 ((3 - lambda)(lambda - 3) + 4) - 3(-lambda)(3- lambda))\ &= (lambda - 2)(2 (lambda^2 - 6 lambda + 9 - 4) - 3lambda(lambda - 3))\ &= (lambda - 2)(-lambda^2 - 3 lambda + 10)\ &= -(lambda - 2)(lambda^2 + 3 lambda - 10)\ &= -(lambda - 2)(lambda + 5)(lambda - 2)\ $ 特征值为 $-5, 2$,分别对应特征向量: - $ mat( 8, -2, -1; 3, 1, -3; 2, -4, 5 ) xi_(-5) = 0, xi_(-5) = vec(1, 3, 2) $ - $ mat( 1, -2, -1; 3, -6, -3; 2, -4, - 2 ) xi_2 = 0, xi_2 = vec(1, 0, 1), vec(0, 1, -2) $ 因此矩阵可对角化,一个基础解矩阵为: $ (ex(-5) vec(1, 3, 2), ex(2) vec(1, 0, 1), ex(2) vec(0, 1, -2)) $
https://github.com/Enter-tainer/typstyle
https://raw.githubusercontent.com/Enter-tainer/typstyle/master/tests/assets/unit/off/content-func-call.typ
typst
Apache License 2.0
#table( columns: /* @typstyle off */ (1fr, auto, auto), inset: 10pt, align: horizon,[], [*Area*], [*Parameters*], [Some image], $ pi h (D^2 - d^2) / 4 $, /* @typstyle off */ [ $h$: height \ $D$: outer radius \ $d$: inner radius ], [Another Image], $ sqrt(2) / 12 a^3 $, [$a$: edge length] )
https://github.com/jens-hj/ds-exam-notes
https://raw.githubusercontent.com/jens-hj/ds-exam-notes/main/lectures/9.typ
typst
#import "../lib.typ": * #show link: it => underline(emph(it)) #set math.equation(numbering: "(1)") #set enum(full: true) #set math.mat(delim: "[") #set math.vec(delim: "[") #set list(marker: text(catppuccin.latte.lavender, sym.diamond.filled)) #show heading.where(level: 1): it => text(size: 22pt, it) #show heading.where(level: 2): it => text(size: 18pt, it) #show heading.where(level: 3): it => { text(size: 14pt, mainh, pad( left: -0.4em, gridx( columns: (auto, 1fr), align: center + horizon, it, rule(stroke: 1pt + mainh) ) )) } #show heading.where(level: 4): it => text(size: 12pt, secondh, it) #show heading.where(level: 5): it => text(size: 12pt, thirdh, it) #show heading.where(level: 6): it => text(thirdh, it) #show emph: it => text(accent, it) #show ref: it => { //let sup = it.supplement let el = it.element if el == none { it.citation } else { let eq = math.equation // let sup = el.supplement if el != none and el.func() == eq { // The reference is an equation let sup = if it.fields().at("supplement", default: "none") == "none" { [Equation] } else { [] } // [#it.has("supplement")] show regex("\d+"): set text(accent) let n = numbering(el.numbering, ..counter(eq).at(el.location())) [#sup #n] } else if it.citation.has("supplement") { if el != none and el.func() == eq { show regex("\d+"): set text(accent) let n = numbering(el.numbering, ..counter(eq).at(el.location())) [#el.supplement #n] } else { text(accent)[#it] } } } } #report-block[ Explore allocation problems! \ #ra Which I have done \ #ra How the system responds to node losses \ #ra Which I have also done ] === Storage Virtualisation #image("../img/9/sv-stack.png", width: 90%) ==== Hypervisor Enables the capability of manipulating and running several OS on the same hardware. #gridx( columns: 2, image("../img/9/sv-without.png"), image("../img/9/sv-with.png") ) ==== Virtualisation Solves - Scalability: Rapidly growing data volume - Connectivity: Distributed data sharing - 24/7 Availability: No single point of failure - High Performance - Easy Management #gridx( columns: 2, image("../img/9/sv-virt.png") ) - Virtualisation simplifies the management of storage resources ==== Benefits - Hides physical storage from applications on host systems - Presents a simplified, logical, view of storage resources to the applications - Allows the application to reference the storage resource by its _common name_ - Actual storage could be on complex, multilayered, multipath, storage networks - `RAID` is an early example of storage virtualisation ==== Types *Host-Based:* - On the host - Through Logical Volume Manager (LVM) - Provides a logical view of physical storage on the host *Switch-Based:* - Implemented on the SAN switches - Each server is assigned a Logical Unit Number (LUN) to access storage resources - Newer powerful switches can operate on the data themselves - *Pros:* - Ease of configuration - Ease of management - Redundancy/high availability - *Cons:* - Potential performance bottleneck on switch - Higher cost #gridx( columns: 2, image("../img/9/sv-host-switch.png") ) - Similar in _topology_ - Question of where the logic is implemented === DAS: Direct Access Storage - Directly attached to the host - No smarts - Manual management - Good enough, but not for _large scale_ systems ==== What - Simplest scenario: one host - `RAID` controller - Smarts - Host Bus Adapter - Not smart - Translate to `RAID` controller #image("../img/9/sv-das.png") === SAN: Storage Area Networks - Deliver content - Server access, not client access ==== What - Specialised high speed network - _Large_ amount of storage - Separate storage from processing - High capacity, availability, scalability, ease of configuration, ease of reconfiguration - Can be _fibre based_, but now also other channels ==== Fibre Channel - Underlying architecture of SAN - Needs specialised hardware - Serial interface - Data transferred across _single piece_ of medium at _high speeds_ - No complex signaling - SCSI over Fibre Channel (FCP) - Immediate OS support - _Hot pluggable:_ devices can be added or removed at will with no ill effects - Privdes data link layer above physical layer; analogous to Ethernet - Sophisticated error detection at frame level - Data is checked and resent if necessary - Up to 127 devices (vs 15 for SCSI) - Up to 10 km of cabling (vs 3-15 ft for SCSI) - *Combines:* - Networks (large address space, scalability) - IO channels (high speed, low latency, hardware error detection) *Original:* - Originally developed for fibre optics - Copper cabling support: not renamed *Layers:* + 0-2: Physical - Carry physical attributes of network and transport - Created by higher level protocols; SCSI, TCP/IP, FICON, etc. *Hardware:* - Switches - Host Bus Adapters (HBA) - `RAID` controllers - Cables ==== Benefits *Scalability:* - Fibre Channel networks allow for number of nodes to increase without loss of performance - Simply add more switches to grow capacity *High Performance:* - Fibre Channel fabrics provide a switched 100 MB/s full duplex interconnect *Storage Management:* - SAN-attached storage allows uniform management of storage resources *Decoupling Servers and Storage:* - Servers can be added or removed without affecting storage - Servers can be upgraded without affecting storage - Storage can be upgraded without affecting servers - Maintenance can be performed without affecting the other part ==== SAN Topologies - Fibre Channel: - Point-to-point - Arbitrated loop; shared medium - Switched fabric *Point-to-point:* #image("../img/9/sv-fc-ptp.png", width: 60%) *Arbitrated loop:* #image("../img/9/sv-fc-loop.png", width: 60%) *Switched fabric:* - This is the most common and _"good"_ one - Ways to combine with NAS #image("../img/9/sv-fc-switched.png") === NAS: Network Attached Storage - A lot of files with different users - NFS, AFS fall here ==== What - A dedicated storage device/server - Operates in a client/server mode - NAS is connected to the file server via LAN #image("../img/9/sv-nas.png") *Protocol:* - NFS: Network File System - UNIX/Linux - CIFS: Common Internet File System - Windows - Mounted on local system as a drive - SAMBA: SMB server for UNIX/Linux - Essentially makes a Linux box a Windows file server *Drawbacks:* - Slow speed - High latency *Benefits:* - *Scalability:* Good - *Availability:* Good - Predicated on the LAN and NAS device working - *Performance:* Poor - Limited by speed of LAN, traffic conflicts, inefficient protocols - *Management:* Decent - Centralised management of storage resources - *Connection:* Homogeneous vs Heterogeneous - Can be either ==== Alternative Form: iSCSI - Internet Small Computer System Interface - Alternate form of NAS - Uses TCP/IP to connect to storage device - Encapsulates native SCSI commands in TCP/IP packets - Windows 2003 Server and Linux - TCP/IP Offload Engine (TOE) on NICs to speed up packet encapsulation - Cisco and IBM co-authored the standard - Maintained by IETF - IP Storage (IPS) Working Group - RFC 3720 === Comparison #gridx( columns: 2, image("../img/9/sv-comp.png"), image("../img/9/sv-comp2.png"), ) - FC: Fibre Channel ==== NAS vs SAN *Traditionally:* - NAS is used for _low volume_ access to large amount of storage by _many users_ - SAN solution for _high volume_ access to large amount of storage, serving data as streaming (typically media like audio/video) - Users are not editing or modifying the data *Blurred Lines:* - Kinda need both - Complement each other
https://github.com/icpmoles/politypst
https://raw.githubusercontent.com/icpmoles/politypst/main/aside/symbols.typ
typst
#let symbols = [ #heading(numbering: none)[List of Symbols] #table( columns: 3, [Variable], [Description],[SI Unit], [$u$],[solid displacement], [m], [$u_f$],[fluid displacement], [m], ) ]
https://github.com/StandingPadAnimations/papers
https://raw.githubusercontent.com/StandingPadAnimations/papers/main/simple-math-proofs/division-by-0.typ
typst
= A Basic Concept First Multiplication is defined as follows: $ a * b = sum_(c=1)^a b $ Such that $a * b$ is equivilent to the following: $ underbrace(b + b + ... + b, a "times") $ = Explaining Why $n/0$ is not $infinity$ The inverse of division is multiplication, such as the following: $ 6 / 2 = 3 $ $ 3 * 2 = 6 $ So if we pretend for a moment that $n/0 = infinity$, then the following is true (where $n$ is any number and $n eq.not 0$): $ n / 0 = infinity $ $ infinity * 0 = n $ However, a fundemental rule in multiplication is that anything times $0$ is $0$, due to the following: $ a * 0 = sum_(c=1)^a 0 = underbrace(0 + 0 + ... + 0, a "times") = 0 $ And $n eq.not 0$, so $infinity * 0 eq.not n$, thus proving that anything divided by $0$ is not infinity. = Explaining Why $0/0$ is undefined Let $n$ and $k$ be numbers such that $n eq.not k$, and let $alpha = n * 0$ and $beta = k * 0$. As anything times $0$ is $0$, $alpha = beta$. Now let's set up the following equation: $ alpha = beta $ Expanded, this would be: $ n * 0 = k * 0 $ So far so good. Now let's try dividing $0$ on both sides: $ (n * 0) / 0 = (k * 0) / 0 $ If we pretend for a moment that $0/0$ is defined, then the following occurs: $ (n * cancel(0)) / cancel(0) = (k * cancel(0)) / cancel(0) $ Leaving: $ n = k $ However, $n$ and $k$ are defined such that $n eq.not k$, so division by $0$ is undefined.
https://github.com/ClazyChen/Table-Tennis-Rankings
https://raw.githubusercontent.com/ClazyChen/Table-Tennis-Rankings/main/history/2024/WS-05.typ
typst
#set text(font: ("Courier New", "NSimSun")) #figure( caption: "Women's Singles (1 - 32)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [1], [SUN Yingsha], [CHN], [3667], [2], [WANG Manyu], [CHN], [3449], [3], [CHEN Meng], [CHN], [3352], [4], [CHEN Xingtong], [CHN], [3229], [5], [ZHU Yuling], [MAC], [3222], [6], [HAYATA Hina], [JPN], [3215], [7], [WANG Yidi], [CHN], [3167], [8], [HARIMOTO Miwa], [JPN], [3155], [9], [CHENG I-Ching], [TPE], [3150], [10], [HIRANO Miu], [JPN], [3131], [11], [ITO Mima], [JPN], [3128], [12], [QIAN Tianyi], [CHN], [3123], [13], [HE Zhuojia], [CHN], [3115], [14], [ZHANG Rui], [CHN], [3098], [15], [KIHARA Miyuu], [JPN], [3067], [16], [JEON Jihee], [KOR], [3060], [17], [KUAI Man], [CHN], [3057], [18], [SZOCS Bernadette], [ROU], [3044], [19], [HASHIMOTO Honoka], [JPN], [3037], [20], [HAN Ying], [GER], [3031], [21], [FAN Siqi], [CHN], [3028], [22], [LIU Weishan], [CHN], [2997], [23], [MITTELHAM Nina], [GER], [2970], [24], [SHI Xunyao], [CHN], [2966], [25], [CHEN Yi], [CHN], [2965], [26], [OJIO Haruna], [JPN], [2964], [27], [YANG Xiaoxin], [MON], [2947], [28], [DIAZ Adriana], [PUR], [2947], [29], [ODO Satsuki], [JPN], [2935], [30], [NAGASAKI Miyu], [JPN], [2927], [31], [SHIBATA Saki], [JPN], [2914], [32], [SHIN Yubin], [KOR], [2902], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Women's Singles (33 - 64)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [33], [SUH Hyo Won], [KOR], [2888], [34], [SATO Hitomi], [JPN], [2886], [35], [JOO Cheonhui], [KOR], [2879], [36], [LEE Eunhye], [KOR], [2875], [37], [POLCANOVA Sofia], [AUT], [2858], [38], [MORI Sakura], [JPN], [2857], [39], [PAVADE Prithika], [FRA], [2831], [40], [PYON Song Gyong], [PRK], [2830], [41], [BATRA Manika], [IND], [2824], [42], [DO<NAME>], [HKG], [2823], [43], [TAKAHASHI Bruna], [BRA], [2810], [44], [PARANANG Orawan], [THA], [2797], [45], [LI Yake], [CHN], [2791], [46], [WU Yangchen], [CHN], [2789], [47], [K<NAME>], [GER], [2778], [48], [EERLAND Britt], [NED], [2772], [49], [<NAME>], [FRA], [2769], [50], [GUO Yuhan], [CHN], [2765], [51], [<NAME>], [IND], [2765], [52], [QIN Yuxuan], [CHN], [2748], [53], [XU Yi], [CHN], [2746], [54], [ZHU Chengzhu], [HKG], [2740], [55], [WANG Xiaotong], [CHN], [2738], [56], [YANG Yiyun], [CHN], [2737], [57], [SAMARA Elizabeta], [ROU], [2733], [58], [PESOTSKA Margaryta], [UKR], [2724], [59], [LEE Zion], [KOR], [2722], [60], [ZENG Jian], [SGP], [2720], [61], [LEE Ho Ching], [HKG], [2718], [62], [XIAO Maria], [ESP], [2716], [63], [NI Xia Lian], [LUX], [2714], [64], [ZHANG Lily], [USA], [2713], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Women's Singles (65 - 96)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [65], [HAN Feier], [CHN], [2712], [66], [QI Fei], [CHN], [2704], [67], [DIACONU Adina], [ROU], [2698], [68], [DRAGOMAN Andreea], [ROU], [2698], [69], [LI Yu-Jhun], [TPE], [2693], [70], [KALLBERG Christina], [SWE], [2691], [71], [MESHREF Dina], [EGY], [2689], [72], [YANG Ha Eun], [KOR], [2686], [73], [KIM Hayeong], [KOR], [2686], [74], [YU Fu], [POR], [2677], [75], [LEE Daeun], [KOR], [2675], [76], [SASAO Asuka], [JPN], [2672], [77], [SHAN Xiaona], [GER], [2667], [78], [FAN Shuhan], [CHN], [2666], [79], [YOKOI Sakura], [JPN], [2664], [80], [WAN Yuan], [GER], [2663], [81], [KIM Nayeong], [KOR], [2657], [82], [CHOI Hyojoo], [KOR], [2654], [83], [CHIEN Tung-Chuan], [TPE], [2652], [84], [ZHANG Mo], [CAN], [2650], [85], [ARAPOVIC Hana], [CRO], [2645], [86], [BAJOR Natalia], [POL], [2636], [87], [WANG Amy], [USA], [2631], [88], [ZHU Sibing], [CHN], [2622], [89], [WINTER Sabine], [GER], [2620], [90], [LIU Hsing-Yin], [TPE], [2618], [91], [LIU Yangzi], [AUS], [2616], [92], [NG Wing Lam], [HKG], [2615], [93], [KIM Byeolnim], [KOR], [2613], [94], [SAWETTABUT Jinnipa], [THA], [2612], [95], [SHAO Jieni], [POR], [2608], [96], [HUANG Yi-Hua], [TPE], [2607], ) )#pagebreak() #set text(font: ("Courier New", "NSimSun")) #figure( caption: "Women's Singles (97 - 128)", table( columns: 4, [Ranking], [Player], [Country/Region], [Rating], [97], [POTA Georgina], [HUN], [2603], [98], [RAKOVAC Lea], [CRO], [2600], [99], [SAWETTABUT Suthasini], [THA], [2591], [100], [MATELOVA Hana], [CZE], [2587], [101], [GHORPADE Yashaswini], [IND], [2587], [102], [ZONG Geman], [CHN], [2584], [103], [MUKHERJEE Ayhika], [IND], [2579], [104], [HUANG Yu-Chiao], [TPE], [2579], [105], [CHEN Szu-Yu], [TPE], [2579], [106], [<NAME>], [IND], [2578], [107], [CIOBANU Irina], [ROU], [2577], [108], [<NAME>], [JPN], [2575], [109], [<NAME>], [JPN], [2574], [110], [<NAME>ia], [AUT], [2574], [111], [<NAME>], [HUN], [2570], [112], [<NAME>], [EGY], [2567], [113], [<NAME>], [IND], [2566], [114], [<NAME>], [FRA], [2565], [115], [<NAME>], [POL], [2560], [116], [<NAME>], [CHN], [2559], [117], [DE NUTTE Sarah], [LUX], [2558], [118], [ZHANG Xiangyu], [CHN], [2558], [119], [<NAME>], [CRO], [2542], [120], [<NAME>ini], [GRE], [2542], [121], [<NAME>], [SRB], [2541], [122], [<NAME>], [KOR], [2537], [123], [<NAME>], [SWE], [2530], [124], [<NAME>-Tzu], [TPE], [2528], [125], [<NAME>], [ROU], [2520], [126], [<NAME>], [SUI], [2517], [127], [HO Tin-Tin], [ENG], [2512], [128], [PLAIAN Tania], [ROU], [2505], ) )
https://github.com/Habib-Ouadhour/Lab-3
https://raw.githubusercontent.com/Habib-Ouadhour/Lab-3/main/lab3/LAB%203-WEB%20APPLICATION.typ
typst
#import "@preview/charged-ieee:0.1.0": ieee #set page(footer: context [ ISET BIZERTE #h(1fr) #counter(page).display( "1/1", both: true, ) ]) #show: ieee.with( title: [#text(smallcaps("Lab #3: Web Application with Genie"))], authors: ( ( name: "<NAME>", department: [Dept. of EE (AII21)], organization: [ISET Bizerte --- Tunisia], email: "<EMAIL>" ), ), index-terms: ("Scientific writing", "Typesetting", "Document creation", "Syntax"), bibliography: bibliography("refs.bib"), ) = Introduction In this lab, I created a basic web application using *Genie* framework in Julia. This application will allow us to control the behaviour of a sine wave, given some adjustble parameters. #figure( image("50237769-removebg-preview.png", width: 30%, fit: "contain"), caption: "Genie" ) <fig:repl> As we know to build and run a web application we need a Julia and HTML codes. #figure( stack( dir: ltr, // left-to-right spacing: 1cm, // space between contents image("Julia_Programming_Language_Logo.svg.png", width: 20%, fit: "contain"), image("HTML5_logo_and_wordmark.svg.png", width:15%, fit: "contain"), ), ) + *Testing Codes :* - Julia : #figure( image("Capture2.PNG", width: 120%, fit: "contain"), caption: "Code of Julia" ) <fig:repl> - HTML : #figure( image("Capture3.PNG", width: 128%, fit: "contain"), caption: "Code of HTML" ) <fig:repl> - Result : ```julia julia> using GenieFramework julia> Genie.loadapp() # Load app julia> up() # Start server ``` #figure( image("Capture6.PNG", width: 110%, fit: "contain"), caption: "Julia REPL" ) <fig:repl> We can now open the browser and navigate to the link #highlight[#link("localhost:8000")[localhost:8000]]. We will get the graphical interface as in _Figure 6_. #figure( image("Capture5.PNG", width: 120%, fit: "contain"), caption: "Graphical interface" ) <fig:repl> = Exercices As we know the mathematique equation of sin wave is: #image("captude.eqt.PNG")So I need to complete the missing variables: #highlight[Phase] and #highlight[Offset] - * First task:* In the first task, I added a slide that modify the _Phase_ *ranging between $-pi$ and $pi$, changes by a step of $pi/100$* #figure( image("Capture7.PNG", width: 71%, fit: "contain"), caption: "Adding slide for Phase" ) <fig:repl> #figure( image("Capture8.PNG", width: 80%, fit: "contain"), caption: "Adding the phase function in Julia" ) <fig:repl> #figure( image("Capture9.PNG", width: 100%, fit: "contain"), caption: "Graphical Interface" ) <fig:repl> - * Second task:* Then in the second task, I added a slide that modify the _Offset_ *varies from $-0.5$ to $1$, by a step of $0.1$.* #figure( image("Capture10.PNG", width: 100%, fit: "contain"), caption: "Adding Slide for Offset" ) <fig:repl> #figure( image("Capture11.PNG", width: 100%, fit: "contain"), caption: "Adding the offset function in Julia" ) <fig:repl> -> Final result of the graphical interface with all the sin wave variables (_Figure 12_). #figure( image("Capture12.PNG", width: 109%, fit: "contain"), caption: "Final Graphical Interface" ) <fig:repl> = Conclusion This lab permit me to learn how to create a web application using Genie in Julia.
https://github.com/bigskysoftware/hypermedia-systems-book
https://raw.githubusercontent.com/bigskysoftware/hypermedia-systems-book/main/-1-copy-ack.typ
typst
Other
#show heading: set text(size: 1em, font: "Yrsa") #set par(first-line-indent: 0pt) #show par: it => block(spacing: 1.6em, it) *Hypermedia Systems*\ #sym.copyright 2023 <NAME>, <NAME>, <NAME> Editor: <NAME> CC BY-NC-SA: This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Read online: https://hypermedia.systems/ Thanks to: - Berkeley Graphics for their permission to use _Berkeley Mono_ and the design of the first edition's cover, - All contributors to the book: https://github.com/bigskysoftware/hypermedia-systems-book/graphs/contributors, - Manning Publications for their support in the initial stages of writing this book, - India Hackle for her valuable feedback and editing. Typefaces: - Jaro (by <NAME>, <NAME>, and <NAME>, for headings) - Linux Libertine (by the Libertine Open Fonts Project, for body text), - Linux Biolinum (by the same, for secondary text), - Berkeley Mono (by Berkeley Graphics, for code and ascii art diagrams). Written and typeset with Typst (#link("https://typst.app")).
https://github.com/chaosarium/typst-templates
https://raw.githubusercontent.com/chaosarium/typst-templates/main/examples/notebook.typ
typst
#import "../notebook/lib.typ": * #show: note_page.with( "Bad Ideas in Practical Computer Science", "Dr. Evil", [], "Meow", "2024", [This is an example abstract. #lorem(40)], [Cranberry Lemon University] ) #import "@preview/finite:0.3.0" #import "@preview/finite:0.3.0": automaton // shorthands #let Pset = [$cal(P)$] #let ar = [#sym.arrow] #let SigmaStar = [$Sigma^*$] #let SigS = [$Sigma^*$] #let Enc(x) = $angle.l #x angle.r$ #let Str(x) = $quote.l.double #x quote.r.double$ = Deterministic Finite Automata We want a good model of computation, but let's first see how far one can go with a simple and restricted model of computation. == Terminology To be able to define computation, we first build models for computation. #def[ Some terminology - *Computational model* — set of rules allowed for information processing - *Machine* — an instance of a computational model. This could be a physical realisation or mathematical representation. We usually work with the latter in TCS. - *Universal Machine / Programme* — a programme that can run many other programmes, such as a laptop. For now, $"Machine" = "Computer" = "Programme" = "Algorithm"$ ] For this chapter, we also assume: 1. There's no universal machine, viz. each machine does one thing 2. We only consider decision problems - the machine either accepts or rejects the input string - focus only on functional problems with some corresponding decision problem == Defining Deterministic Finite Automata (DFA) This is a _restricted_ model of computation. Often in the real world we do have restrictions. At the same time, designing a model that is as simple as possible can bring interesting properties. Restrictions of DFA: - Only one pass over the input string - Very limited memory Notation: - Each node represents a state, usually indicated by $q_i$ for some $i$ - Double circles represent accept state, otherwise it's a reject state - Initial state $q_0$ has arrow coming from nowhere - Transition rules are arrow with alphabet corresponding to the transition - To declutter, it's acceptable to say that missing arrow all goes to reject, etc. #ex[ #automaton(( q0: (q0:0,q1:1), q1: (q2:(0,1)), q2: (q2:1,q3:0), q3: (q0:0,q2:1), ), final: ("q2", "q1"), layout: finite.layout.circular.with( spacing: 2, ), ) ] === Language and DFA #def[ Let $M$ be a DFA and $L subset.eq SigmaStar$. We say that $M$ solves $L$ if: - for all $w in L, M "accepts" w$ - for all $w in.not L, M "rejects" w$ We denote the language for which all strings a DFA $M$ accepts by $L(M)$ ] #ex[ Example languages and DFAs 1. $L(M) = "strings with even number of 1's"$ #automaton(( qeven: (qeven:0,qodd:1), qodd: (qodd:0,qeven:1), ), final: "qeven") 2. $L(M) = "strings with even number of characters"$ #automaton(( qeven: (qodd:(0,1)), qodd: (qeven:(0,1)), ), final: "qeven") 3. $L(M) = "strings that end in 0's and the empty string"$ #automaton(( qeven: (qeven:0,qodd:1), qodd: (qodd:1,qeven:0), ), final: "qeven") 4. $L(M) = "strings that end with 00"$ #automaton(( q0: (q1:0,q0:1), q1: (q2:0,q0:1), q2: (q2:0,q0:1), ), final: "q2") ] Notice we can do various things like: - Maybe build a DFA for some language - Translate DFA into some programme in code - Get the complement of the language by flipping accept and reject states === Formal Definition of DFA We want a few properties: - Every state need to have $|Sigma|$ transitions out of it - There is no direction for states (so you can go back to a previously visited state) - DFA needs to tell you the output for every input #def[ A DFA is $M = (Q, Sigma, delta, q_0, F)$, in which - $Q$ is the set of states - $Sigma$ is the alphabet the DFA operates on - $delta$ is the transition function $delta : Q times Sigma -> Q$. It takes the current state, the characters being read, and outputs the next state. - $q_0$ is the start state - $F subset.eq Q$ is the set of accept states Let $q in Q, w in SigmaStar$, we write $delta^* (q,w)$ to indicate the state after running on $w$, viz. $ delta^* (q,w) = delta(... delta(delta(q, w_1), w_2), ...) $ $M$ *accepts* $w$ if $delta^* (q_0,w) in F$ , otherwise $M$ *rejects* $w$. ] A good way to capture the input and output of $delta$ is perhaps a table. #def[ Computationpath for DFA Given a DFA $M = (Q, Sigma, delta, q_0, F)$ as previously defined, the *computational path* of $M$ on input $w in SigmaStar$ is a sequence of states $r_0, r_1, ..., r_n$ ($r_i in Q$) that the DFA visits as it reads $w$. Note this means $r_0 = q_0$. ] === Applications of DFAs DFA is always linear time, so if we can efficiently build a DFA that solves some decision problem, we get $O(n)$ for free. An example is deciding whether $w$ contains some substring $s$. == Regular and Non-Regular Languages #def[ We define regular languages $sans("REG")$ to be the set of all languages that can be solved by some DFA. $ "regular languages" sans("REG") subset.eq "all languages" sans("ALL") $ ] But is it true in the other direction? Probably not. DFAs have limited memory and only scans in one direction (viz. forgets what it reads), but some language may require more memory to solve. We want to find the simplest counterexample to show that there exists non-regular language. One idea is to make use of the fact that DFAs are bad at counting—because $|Q|$ is finite, they can only keep track of $|Q|$ distinct situations. Key limitations of DFAs: - Finite number of states #ar limited memory - Only reads input in one direction #ar can't go back to check something if not in memory #strategy[ Proving a language $L$ is not regular using the *Pigeonhole Principle* (PHP). 1. Assume that the language is regular and there is a DFA with $k in NN^+$ states that solves $L$. 2. Come up with a *fooling pigeon set* $P$ such that $|P| > k$ 3. By *PHP*, $exists x, y in P$ with $x != y$ must end up at the same state in the DFA, so $x z$ and $y z$ for some $z in SigmaStar$ end up in the same state 4. Pick $z$ such that $x z in F$ xor $y z in F$. Contradiction. Note this strategy also works if one wants to prove a lower bound on the number of states a DFA needs to solve a certain language—assume a DFA with fewer states solves it, and derive a contradiction. ] #thm[ $L = {0^n 1^n | n in NN}$ is not regular. #proof[ AFSOC $L$ is regular and there exists DFA $M = (Q, Sigma, delta, q_0, F)$ that solves $L$ with $|Q| = k, k in NN^+$. Consider $P = {0^i | 0 <= i < k+1}$. Then by PHP: $ exists x = 0^n, y = 0^m in P, x != y, delta^*(q_0, x) = delta^*(q_0, y) $ But then let $z = 1^n$. So $x z in L$ but $y z in.not L$. But $delta^*(q_0, x z) = delta^*(q_0, y z)$. Contradiction. ] ] === Closure Properties of Regular Languages Regular languages are closed under: - Complement - Union - Intersection - Concatenation - Star operation For the proofs below, let $M^1 = (Q^1, Sigma, delta^1, q_0^1, F^1)$ solve $L_1$ and $M^2 = (Q^2, Sigma, delta^2, q_0^2, F^2)$ solve $L_2$. #thm[ Regular languages are closed under complement $ L_1 subset.eq SigmaStar "is regular" => overline(L_1) = SigmaStar without L_1 "is regular" $ #proof[ $M' = (Q^1, Sigma, delta^1, q_0^1, Q^1 without F^1)$ solves $overline(L_1)$. ] ] #thm[ Regular languages are closed under union $ L_1, L_2 subset.eq SigmaStar "are regular" => L_1 union L_2 "is regular" $ Proof idea: construct new DFA with state $Q' = Q^1 times Q^2$, initial state $q_0' = (q_0^1, q_0^2)$ step both DFAs and accept if one of the final states is accept for one of the DFAs viz. $F' = {(q_1, q_2) | q_1 in F^1 or q_2 in F^2}$. ] #thm[ Regular languages are closed under intersection $ L_1, L_2 subset.eq SigmaStar "are regular" => L_1 sect L_2 "is regular" $ Proof idea 1: Write $L_1 sect L_2$ as $overline(overline(L_1) union overline(L_2))$ Proof idea 2: very similar to union, but with $F' = {(q_1, q_2) | q_1 in F^1 and q_2 in F^2}$. ] #thm[ Regular languages are closed under concatination $ L_1, L_2 subset.eq SigmaStar "are regular" => L_1 L_2 "is regular" $ #proof[ Define $M'$ by: $ Q' &= Q^1 times Pset(Q^2) \ Sigma' &= Sigma \ q_0 ' &= cases( (q_0^1, emptyset) "if" q_0^1 in.not F^1, (q_0^1, {q_0^2}) "if" q_0^1 in F^1 ) \ delta'(a, B) &= cases( (delta^1(a, sigma), {delta^2(b, sigma) | b in B}) "if" delta^1(a, sigma) in.not F^1, (delta^1(a, sigma), {delta^2(b, sigma) | b in B} union {q_0^2}) "if" delta^1(a, sigma) in F^1, ) \ F' &= {(a, B) in Q' | exists b in B, b in F^2} $ ] ] #def[ Notice it's useful to have a set of states and step the entire set, so we define a *generalised transition function* $delta_cal(P) : Pset(Q) times Sigma -> Pset(Q)$ by: $ delta_cal(P) (S, sigma) = {delta(q, sigma) | q in S} $ ] #thm[ Regular languages are closed under star operation $ L_1 subset.eq SigmaStar "are regular" => L_1^* "is regular" $ #proof[ We can solve $L_1^+$ by constructing $M'$: $ Q' &= Pset(Q^1) \ Sigma' &= Sigma \ q_0 ' &= {q_0^1} \ delta'(S) &= cases( delta_cal(P)^1(S, sigma) union {q_0^1} "if" delta_cal(P)^1(q, sigma) sect F^1 != emptyset, delta_cal(P)^1(S, sigma) "else" ) \ F' &= {S subset.eq Q^1 | S sect F^1 != emptyset} $ Then we can use closure under union to construction $M''$ for $L_1^+ union {epsilon}$ ] ] === Recursive Definition of Regular Language It turns out the definition simple language is equivalent to that of regular language. Namely: #thm[ A regular language can be recursively defined as: - $emptyset$ is regular - ${sigma}$ is regular for all $sigma in Sigma$ - If $L_1, L_2$ are regular, then $L_1 union L_2$ is regular - If $L_1, L_2$ are regular, then $L_1 L_2$ is regular - If $L_1$ is regular, then $L_1^*$ is regular Proof omitted. ] = Turing Machines (TMs) DFA with tape — the model for computation! == Preamble Recall what we want from a model of computation: 1. As simple as possible 2. As general as possible Observations: 1. Computational devices need to be a finite object. Finite algorithms need to solve arbitrary-length input. 2. It has unlimited memory. That is, it can access more working memory if needed. #blockquote[An algorithm is a finite answer to infinite number of questions] === Coming Up with TMs (Modern Perspective) #ponder[ *Attempt 1:* Define computable by what Python can compute! *Problems:* - But what is Python? 100 pages of definition? - Why Python? What's special about Python among the other programming languages This is general enough, but not simple #blockquote[We want a #underline([totally minimal]) (TM) programming language] ] #ponder[ *Attempt 2:* Upgrade DFA + Tape — enable write to tape and allow moving around tape. ``` STATE 0: switch sigma: case 'a': write 'b'; move LEFT; goto STATE 2; case 'b': ... ... ... ``` That seems to work! ] To represent a TM, we can draw state diagrams similar to those for DFAs. Just put the character to write and the direction to move on the transition. === Coming Up with TMs (Turing's Perspective) #ponder[ Recall that in Hilbert's time, mathematicians were trying to formalise what it means to have a finite procedure, such as in the Entscheidungsproblem. Computers back then were humans, and so a finite procedure would be instructions given to humans so that they could write proofs mechanically. But then we needed to define what the instruction looks like and what instructions a human can follow and execute. ] A TM, then, must capture human computers' workflow. Observe that *a human computer reads and writes symbols on paper*. - Human has finite mental states, thus finite number of states in a TM. - Human computers are deterministic, so kind of like DFAs with deterministic state changes. - Human knows finite number of symbols, and they can have a set of working symbols that is a superset of the input symbols. - Human can work with papers with square cells and put one symbol in one cell. - Human can always grab more papers. - Human can work by reading/writing at one location at a time. (WLOG, if someone really needs to read/write more cells at a time, we can just have larger cells with a larger set of composite symbols) - There is nothing special about 2D papers, so moving Left/Right is sufficient for computation. So then if we define a TM to model a computer with finite number of states, finite number of symbols, and an infinite tape, they can perform equivalent computation as a human computer. Simple and general! === Key Differences Between DFAs and TMs #columns(2, [ *DFAs* - Multiple accept/reject states - Halt at string end - Always terminates - Finite cell access #colbreak() *TMs* - One accept state, one reject state - Halt on accept/reject - May loop forever - Can read/write infinite number of cells ]) == Formal Definition of TMs #let qacc = $q_"acc"$ #let qrej = $q_"rej"$ #let q0 = $q_0$ #let blank = $⊔$ #def[ A turing machine can be described by a mighty 7-tuple $M = (Q, Sigma, Gamma, delta, q0, qacc, qrej)$ - $Q$ is the set of states - $Sigma$ is the set of input characters, such that $blank in.not Sigma$ - $Gamma$ is the set of tape characters, satisfying $Sigma subset Gamma and blank in Gamma$ - $delta : (Q without {qacc, qrej}) times Gamma -> Q times Gamma times {L, R}$ the transition function - $q0 in Q$ is the initial state - $qacc in Q$ is the accept state - $qrej in Q$ is the reject state, it must be that $qrej != qacc$ The TM then operates on an infinite tape, with infinite blank symbols surrounding the input string and the tape head initially at the start of the input string. $M$ can then be thought of as a function $SigmaStar -> {0, 1, infinity}$, with $0$ being reject, $1$ being accept, and $infinity$ being loop forever. ] #note[ One can also set up a TM with a tape that's infinite only in one direction, but this does not make the TM any less powerful. ] #def[ Configuration of a TM A *configuration* of a TM consists of: 1. The content on the tape 2. Its state 2. The location of the tape head We can specify the configuration formally by writing down $u q v in (Gamma union Q)^*$ where $u, v in Gamma^*$ and $q in Q$. The convention is that the tape head is at the first character of $v$, and the state is $q$. We say that a configuration is *accepting* if $q = qacc$ and rejecting if $q = qrej$. ] #def[ Language of a TM $ L(M) = {w in SigmaStar | M "accepts" w} $ Note that $M$ may loop forever for some input, but $L(M)$ only contains those that $M$ accepts. ] == Universality of Computation The idea is that a TM can perform any computation we want just with a finite set of instructions and an infinite scratchpad. === TM Subroutines, Tricks, and Description - Move Left/Right until hitting $blank$ - Shift entire input by one cell to Left/Right - Convert $blank x_1 x_2 x_3 blank$ to $blank x_1 blank x_2 blank x_3 blank$ - Simulate $Gamma$ with ${0, 1, blank}$ viz. alphabet reduction - Mark cells with $Gamma' = {0, 1, 0^circle.filled.tiny, 1^circle.filled.tiny, blank}$ - Copy paste tape segment - Simulate 2 TMs on the same tape - Implement some data structure - Simulate RAM by reading address and moving - ... - Simulate assembly So *a Turing Machine can simulate all our programmes written in other programming languages*. Therefore, to describe a TM, it is sometimes sufficient to describe it at a higher level, knowing that it can compile down to a 7-tuple describing an actual TM. Levels of description: - *Low* - state diagram, 7-tuple - *Mid* - movement, behaviour - *High* - pseudocode === Universal Machines #def[ A universal machine is a machine that can simulate any machine. ] It follows that Turing's TM can simulate any TM, just like how human takes instructions and input, a TM can take the blueprint of another TM, some input, and simulate the input string on the input TM. An important realisaion is that *code is data*, so any algorithm/programme can be encoded and fed into some other machine. The good thing is that we get universal machines, the maybe not so good thing is that we now have to deal with self reference. == The Church-Turing Thesis Is computation equivalent to any physical process? #def[ The $"Church-Turing Thesis"$ states that any computation allowed by the laws of physics can be done by a TM. ] #def[ The $"Church-Turing Thesis"^+$ states that any computational problem solvable by physical process is solvable by a probabilistic TM. ] #def[ The $"Church-Turing Thesis"^(++)$ states that any computational problem efficiently solvable by physical process can be efficiently solved by a Quantum TM. ] Note that the Church-Turing Thesis is not a theorem, but something we believe to be true. At least we don't know of any counterexample yet. == Decidability #def[ A *decidable language* is a language a TM can solve. Let $L subset.eq SigmaStar$, $L$ is dicidable if there exists $M$ a TM such that: - $forall w in L$, $M$ halts and accepts $w$ - $forall w in.not L$, $M$ halts and rejects $w$ In which case we call $M$ a *decider* for $L$. We write $sans("R")$ to indicate the set of all decidable languages. ] #def[ A *decider* TM is a TM that never loops. ] #ex[ Deciding $"isPrime" = {Enc(n) | n "is a prime"}$ One can simply write some code to do it: #proof[ ```py def M(n: int): if n < 2: return 0 for i in [2, 3, ..., n - 1]: if n % i == 0: return 0 return 1 ``` Since we can write code to solve it, we can compile it to a TM that solves it, so it is decidable. ] ] #ex[ Deciding behaviour of DFAs - $"ACCEPTS"_"DFA" = {angle.l D: "DFA", x: "str" angle.r | D "accepts" x}$ is decidable because we can just simulate the DFA and decide - $"SELF-ACCEPTS"_"DFA" = {angle.l D: "DFA" angle.r | D "accepts" Enc(D)}$ decidable, same as above - $"SAT"_"DFA" = {angle.l D: "DFA" angle.r | D "is satisfiable"}$ decidable, we can do a graph search to see if any of the accept states are reachable - $"NEQ"_"DFA" = {angle.l D_1: "DFA", D_2: "DFA" angle.r | L(D_1) != L(D_2)}$ decidable... but a bit more tricky. Proving that $"NEQ"_"DFA"$ is decidable by reduction. #proof[ First, we observe that this is equivalent to deciding if $(L(D_1) union L(D_2)) without (L(D_1) sect L(D_2))$ is empty. But we can rewrite that as $(L(D_1) sect overline(L(D_2))) union (overline(L(D_1)) sect L(D_2))$. By closure properties of regular languages, we can build a DFA to solve that using $D_1$ and $D_2$, and we can use a decider for $"SAT"_"DFA"$ to figure out if that region is empty. We just reduced $"NEQ"_"DFA"$ to $"SAT"_"DFA"$. We write $"NEQ"_"DFA" <= "SAT"_"DFA"$. ] ] === Closure Properties of Decidable Languages #thm[ Decidable language is closed under complement. #proof[ Let $L$ be a decidable language. Let $M$ de a decider for $L$. We can build a decider for $overline(L)$ by: ```sml fn x => (case M x of 1 => 0 | 0 => 1) ``` ] ] #thm[ Decidable language is closed under union. #proof[ Let $L_1, L_2$ be decidable languages. Let `M1`, `M2` be their deciders. We can build a decider for $L_1 union L_2$ by: ```sml fn x => (case M1 x of 1 => 1 | 0 => M2 x) ``` ] ] #thm[ Decidable language is closed under intersection. #proof[ Let $L_1, L_2$ be decidable languages. Let `M1`, `M2` be their deciders. We can build a decider for $L_1 union L_2$ by: ```sml fn x => (case (M1 x, M2 x) of (1, 1) => 1 | _ => 0) ``` ] ] === Semi-Decidability Decidability requires that the decider always outputs $0$ or $1$, but we may relax the requirement and find that some languages are only semi-decidable. #def[ A TM $M$ *semi-decides* $L$ if: $ forall w in SigmaStar, w in L <==> M(w) = 1 $ viz. - $w in L => M(w) = 1$ - $w in.not L => M(w) in {0, infinity}$ Which means our TM always says yes if the input is in the language, but may say no xor loop forever if it's not. A language is *semi-decidable* if there exists a semi-decider for it. We write $sans("RE")$ for the set of all semidecidable languages. ] #corol[ All decidable languages are semi-decidable. ] #corol[ So $sans("REG") subset.eq sans("R") subset.eq sans("RE") subset.eq sans("ALL")$. ] #thm[ A language $L$ is decidable iff both $L$ and $overline(L)$ are semi-decidable. Proof idea: for the forward direction, use complement closure property. For the other direction, construct a decider using the two semi-deciders (hint: step each TM in incremental number of steps until one of them halts). ]
https://github.com/Mouwrice/thesis-typst
https://raw.githubusercontent.com/Mouwrice/thesis-typst/main/jitter_noise/jitter_noise_results.typ
typst
== Results The following section compares the results achieved by the method with measurements without any post-processing. Results of recordings at 30 fps and 60 fps are discussed, as well as the impact of the memory size of the method. === 30 fps The `maurice_drum_fast` recording at 30 fps is used to compare the results. The method is applied to the recording and the results are compared to the original measurements. The parameters are set to a memory size of 2 frames, the peak $d = 0.015$, and the tightness $s = 0.7$. Visually, these parameters produce the best results. The noise is reduced, and the jitter is less pronounced, while still allowing a given range of motion. To confirm that the method does, in fact, reduce these elements, we should expect to see a better signal stability. @maurice_drum_fast_stability_30fps shows the stability of the signal with and without processing. For the Y and Z axis, the mean is reduced by around 0.5 mm. The impact of the method on the stability is most noticeable in the percentiles. There we can observe reductions ranging from 0.5 mm to 1.8 mm. This impact is better displayed in the box plots from @maurice_drum_fast_stability_30fps-boxplot. The box plot shows the distribution of the signal stability. The processed signal has a smaller range and a smaller median. The outliers are also reduced. The method has a positive impact on the signal stability. One might argue that the X axis is also improved. However, given the results from the measurement chapter, we know that the X axis is far from accurate. The increase in stability for the X axis is purely attributed to the method reducing the noise and jitter. The method does not improve the actual accuracy of the X axis, even though the results might suggest otherwise. #show table.cell.where(x: 0): set text(weight: "bold") #figure( caption: [The signal stability from the `maurice_drum_fast` measurement without processing (top) and with processing (bottom). Model: `LITE`, Marker type: `Landmark`], placement: none, grid( columns: (auto), rows: (auto, auto, auto), gutter: 1em, [ #table( columns: (auto, 2fr, 2fr, 2fr), align: (left, right, right, right), table.header[Stability unprocessed (mm)][X][Y][Z], [mean], [ 9.230469], [ 1.814981], [ 2.656927], [std ], [ 13.762306], [ 4.700073], [ 8.271183], [min ], [ 0.000365], [ 0.000031], [ 0.000004], [25% ], [ 1.143315], [ 0.210036], [ 0.251675], [50% ], [ 4.848148], [ 0.634218], [ 0.849195], [75% ], [ 13.118014], [ 1.727039], [ 2.558757], [max ], [676.041508], [180.404176], [592.605731], ) ], [ #table( columns: (auto, 2fr, 2fr, 2fr), align: (left, right, right, right), table.header[Stability processed (mm)][X][Y][Z], [mean], [ 5.940251], [ 1.419173], [ 2.109245], [std ], [ 9.745013], [ 3.663793], [ 8.273394], [min ], [ 0.000060], [ 0.000002], [ 0.000004], [25% ], [ 0.870641], [ 0.072621], [ 0.070995], [50% ], [ 3.905946], [ 0.258439], [ 0.251171], [75% ], [ 9.016494], [ 0.967466], [ 1.169109], [max ], [674.856917], [116.912891], [593.312640], ) ] ) ) <maurice_drum_fast_stability_30fps> #figure( caption: [The signal stability from the `maurice_drum_fast` measurement in a boxplot, without processing (top) and with processing (bottom). Model: `LITE`, Marker type: `Landmark`], placement: auto, grid( columns: (auto), rows: (auto, auto, auto), [ #image("../images/measurements/maurice_drum_fast/LITE/total_signal_stability.png" ) ], [ #image("../images/measurements/maurice_drum_fast_processed/LITE/total_signal_stability.png" ) ] ) ) <maurice_drum_fast_stability_30fps-boxplot> Before we conclude that the method achieves its goal, we should also consider the impact of the method on the accuracy. #footnote[Remember that the accuracy has been defined as the deviation from the Qualisys recordings.] @maurice_drum_fast_dev_30fps clearly shows that the method has no negative impact on the accuracy. The accuracy is ever so slightly improved, but the improvement is not significant enough to conclude that the method improves the accuracy. #figure( caption: [The deviation from the `maurice_drum_fast` measurement without processing (top) and with processing (bottom). Model: `LITE`, Marker type: `Landmark`], placement: none, grid( columns: (auto), rows: (auto, auto, auto), gutter: 1em, [ #table( columns: (auto, 2fr, 2fr, 2fr), align: (left, right, right, right), table.header[Deviation unprocessed (mm)][X][Y][Z], [mean], [ 64.872857], [ 7.181918], [ 10.046277], [std ], [ 70.935324], [ 9.058099], [ 14.284985], [min ], [ 0.006952], [ 0.000276], [ 0.000796], [25% ], [ 9.690526], [ 2.168622], [ 2.386345], [50% ], [ 31.462373], [ 4.908393], [ 5.571245], [75% ], [113.099430], [ 8.903545], [ 12.760656], [max ], [680.599720], [226.170262], [592.765323], ) ], [ #table( columns: (auto, 2fr, 2fr, 2fr), align: (left, right, right, right), table.header[Deviation processed (mm)][X][Y][Z], [mean], [ 62.469941], [ 7.216940], [ 10.001153], [std ], [ 70.122023], [ 9.067662], [ 14.967685], [min ], [ 0.000379], [ 0.000839], [ 0.000065], [25% ], [ 9.050388], [ 2.007845], [ 2.220629], [50% ], [ 27.936964], [ 4.717725], [ 4.811401], [75% ], [112.598154], [ 8.676960], [ 12.744544], [max ], [679.639393], [146.986826], [594.480109], ) ] ) ) <maurice_drum_fast_dev_30fps> Lastly, we can see the reduction in jitter clearly in the Y axis, trajectory plots from the Right Wrist marker in @maurice_drum_fast_jitter. The jitter around the 20-second marker is reduced, and the trajectory is smoother. The method has a positive impact on the jitter. #figure( caption: [The signal stability from the `maurice_drum_fast` measurement in a boxplot, without processing (top) and with processing (bottom). Model: `LITE`, Marker type: `Landmark`], placement: none, grid( columns: (auto), rows: (auto, auto, auto), [ #image("../images/measurements/maurice_drum_fast/LITE/Right_Wrist_y.svg" ) ], [ #image("../images/measurements/maurice_drum_fast_processed/LITE/Right_Wrist_y.svg" ) ] ) ) <maurice_drum_fast_jitter> A final note on the memory size of the method. The above results are achieved with a memory size of 2 frames. This is the minimum memory size that can be used, as we need at least two frames to calculate the direction vector $arrow(v)$. The explanation of the method already made clear a concern that increasing the memory size might make the method less responsive. During the experimentation, we found this concern to be true. Setting the memory size to 4 caused some markers to lag behind the changes in the actual movement. Even higher memory sizes could cause the markers to lag even more. The method is most effective with a memory size of 2 frames at 30 fps. === 60 fps The `maurice_drum_60fps` recording at 60 fps is used to compare the results. The following results are with parameters set to a memory size of 2 frames, the peak $d = 0.01$, and the tightness $s = 0.7$. The results are displayed in @maurice_drum_60fps_stability. Just like with the 30 fps recording, the method has a positive impact on the signal stability. However, the impact is less pronounced than with the 30 fps recording. This is somewhat surprising, as it was expected that the method would have a more significant impact on the 60 fps recording. More frames per second should allow the method to better predict the direction vector $arrow(v)$ and a narrower interpolation function. As the frames are closer together, the possible range of movement should be smaller. #figure( caption: [The signal stability from the `maurice_drum_60fps` measurement without processing (top) and with processing (bottom). Model: `LITE`, Marker type: `Landmark`], placement: none, grid( columns: (auto), rows: (auto, auto, auto), gutter: 1em, [ #table( columns: (auto, 2fr, 2fr, 2fr), align: (left, right, right, right), table.header[Stability unprocessed (mm)][X][Y][Z], [mean], [ 6.084695], [ 1.456349], [ 1.782536], [std ], [ 7.498098], [ 3.513297], [ 3.320853], [min ], [ 0.000074], [ 0.000007], [ 0.000027], [25% ], [ 1.302660], [ 0.168504], [ 0.187517], [50% ], [ 3.542529], [ 0.510763], [ 0.676077], [75% ], [ 8.028906], [ 1.362623], [ 1.968414], [max ], [102.800047], [122.740564], [83.073242], ) ], [ #table( columns: (auto, 2fr, 2fr, 2fr), align: (left, right, right, right), table.header[Stability processed (mm)][X][Y][Z], [mean], [ 4.251094], [1.277513], [1.539274], [std ], [ 4.003413], [3.142163], [3.161759], [min ], [ 0.000385], [0.000002], [0.000005], [25% ], [ 1.167122], [0.082504], [0.075393], [50% ], [ 3.173341], [0.344433], [0.348346], [75% ], [ 6.307637], [1.050543], [1.529996], [max ], [38.699978], [63.47007], [47.21325], ) ] ) ) <maurice_drum_60fps_stability> At 60 fps it is however possible to increase the memory size without causing the markers to lag behind the actual movement. Using more frames to predict the current position leads to a more stable prediction. But even at just 4 frames it is shown that the prediction is a bit too stable causing it to lag behind the actual positions. The stability shown in @maurice_drum_60fps_mem4_stability is slightly worse than with a memory size of 2 frames. #figure( caption: [The signal stability from the `maurice_drum_60fps` measurement with a memory size of 4 frames with processing. Model: `LITE`, Marker type: `Landmark`], placement: none, table( columns: (auto, 2fr, 2fr, 2fr), align: (left, right, right, right), table.header[Stability processed (mm)][X][Y][Z], [mean], [ 4.209328], [ 1.327719], [ 1.634284], [std ], [ 4.037256], [ 3.022464], [ 3.120164], [min ], [ 0.000018], [ 0.000010], [ 0.000007], [25% ], [ 1.179050], [ 0.136544], [ 0.149714], [50% ], [ 3.084383], [ 0.431487], [ 0.511141], [75% ], [ 6.089892], [ 1.167036], [ 1.695795], [max ], [40.776414], [54.463532], [53.594910], ) ) <maurice_drum_60fps_mem4_stability> A possible explanation for the less pronounced impact of the method on the 60 fps recording could be attributed to the jitter. When closely looking at the jitter, we can see that the duration (in time) is the same across the 30fps and 60fps recordings. For example where the jitter would last 2 frames in the 30 fps recording, it would last 4 frames in the 60 fps recording. At 60fps the jitter also has a smoother trajectory, having more frames to ramp up instead of a spike. This means that the method has less of an impact on the 60 fps recording, as the jitter is already less pronounced. At 60 fps the jitter has a smoother curve instead of the sharp peaks at 30 fps. As with the 30 fps recording, the method does not have a negative impact on the accuracy. === Conclusion At 30 frames per second the method has a positive impact on the signal stability and the jitter. The same is true for the 60 frames per second recording, but the impact is less pronounced due to the smoother, stretched out, jitter. The method does not have a negative impact on the accuracy. The method does not improve the accuracy, but it does not worsen it either.
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/visualize/image-04.typ
typst
Other
// Test baseline. A #box(image("test/assets/files/tiger.jpg", height: 1cm, width: 80%)) B
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/018%20-%20Modern%20Masters%202015/001_The%20Dragon's%20Errand.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "The Dragon's Errand", set_name: "Modern Masters 2015", story_date: datetime(day: 06, month: 05, year: 2015), author: "<NAME>", doc ) #emph[Long ago, on the plane of Kamigawa, a goblin named Kiki-Jiki finds himself in a tight spot…] #figure(image("001_The Dragon's Errand/01.png", height: 40%), caption: [], supplement: none, numbering: none) #emph[This story originally ran in 2004 as one of the ] Kamigawa block legend vignettes#emph[.] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) "You've caused me a great deal of trouble, creature." Meloku paced in a circle around the airy chamber, his feet tracing the swirls of smoky jade that spiderwebbed across the marble floor. He rubbed his temples with long, delicate fingers. As ambassador of the soratami, he had presided at many inquisitions—one needed information to make informed decisions, after all—but few of them were quite so…irritating. He expected little more of these land-dwellers than theft and other petty crime, but here, in his very chambers! The insolence was more than a personal affront; it was a thumbing of the nose at all the people of the sky, a biting of the fingers at the pale glory of the moon, an insult, an outrage…. #figure(image("001_The Dragon's Errand/02.jpg", width: 100%), caption: [Meloku the Clouded Mirror | Art by <NAME>], supplement: none, numbering: none) Meloku sighed and looked up at his prisoner where he hung in the middle of the chamber from the bottom of a long, inverted spire protruding like a stalactite of white marble from the vaulted ceiling. A silvery cord ran between spire and prisoner—the only thing holding him up. Ten feet below was a perfectly circular hole in the middle of the floor. Below that were nothing but wispy clouds and a 2,000-foot drop through empty space to the waves of the ocean far, far below. He waved his arms a bit and immediately began to spin in a slow circle. Though standing next to Meloku he would only come up to the soratami's waist, the akki was large for his race, and that cord looked far too slender to hold him for long. He immediately regretted having eaten all those ripe #emph[biwa] off the tree in the courtyard on his way in. They had looked so good, so golden-sweet. Why, he could hear them calling to him…. A bead of sweat formed between the ridged plates of his forehead and trickled down between his eyes to the tip of his pointed nose, where it hung pendulously for what seemed like an eternity before dropping down, down through the hole in the floor where it was whipped away into nothingness by the high winds that brushed the underbelly of the floating cloud palace. The akki swallowed. Meloku stopped his circling and raised an eyebrow. "You know, there are other ways of persuading you to talk." He removed a slender dagger from his waistband and eyed the cord above the akki's head. "Still, I thought I'd give you one last chance to be civilized, #emph[Kiki-Jiki] ." The akki tensed. "Yes, I know who you are," said Meloku, smiling, "my mirrors show many, many things…though I admit it caused me much physical pain to have to watch your grimy brethren rolling about and bashing each other's heads in with rocks, even from a distance." Meloku shook his head and began to pace again. "You are Kiki-Jiki, a young akki buck as I suppose you fashion yourself. You were born the fourth child in your family, kicked out when you used your sister in lieu of a rock for throwing practice in the lava fields, and taught your older but marginally stupider brothers how to play "taunt the #emph[oni] ." You survived these escapades and the wrath of your extended family by virtue of being a good runner…but nowhere in my mirrors do I see anything showing #emph[where] in Kamigawa you've hidden that pearl of mine, much less anything explaining how you managed to sneak into a cloud palace with no visible means of transportation!" Meloku took a deep breath and looked up, thin lips curving into a cold smile. "Now tell me, for I greatly wish to know, how it is that an akki can #emph[fly] ?" #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) #emph[What a day] . Kiki-Jiki picked a russet-brown goober out of his left nostril and flicked it into a scrubby jasmine bush that had grown up out of a crack in the rocks of the cliff face. He scowled as the bush uprooted itself, shook its leaves at him in a vegetative fury, and scampered off. Something was wrong here, and he knew exactly what it was; he just couldn't remember the word for it. It was that thing where strange stuff happens for no good reason, and there's always a wizard or some nasty #emph[kami] involved. #emph[Muh] -something. Kiki-Jiki scratched his head and glared at the hot, sandy path beneath his feet. #emph[Just my luck—another dead-end] . He had spent the better part of the morning scrabbling around on these rocks looking for that blasted grotto he saw from the far ridge the day before. He had seen the arch of the cave, the glimmer of evening sun on the pool within. Ach, it was maddening! He could practically smell the fish and blind albino cave-frogs…by the Patron's bulbous bile-sacs, he could even hear the trickling of water. But where? Everywhere he looked was dry, sun-blasted rock. #emph[Food] . The last thing he had eaten was the month-old hunk of wormbread that Paku-Paku had thrown at him when he fled the caves. It was a good shot. Would have brained him if he hadn't blocked it with that mudfowl he'd stolen. He had been hoping to get some eggs out of the scrawny thing but after the bread incident it went limp as a cave slug, and that night when he took cover in an old lightning-blasted treehusk, he had plucked it to find it was mostly bones anyhow. So, he ate the old wormbread, and lost one of his good teeth in the process. Now he was famished. Kiki-Jiki picked his way through the rocks down toward where he thought he could hear the river, his belly rumbling and his head filled with thoughts of…no, actually it was pretty empty too. Stomach was calling the shots now. He had come to a flattish sort of place. He scanned the ground, his eyes darting back and forth, looking for bugs, lizards, bones, anything…and lighted upon a patch of green in the shade of some rocks a few paces away. He scampered over and prodded the weeds to make sure they weren't hostile, then reached down…and he heard water! Quickly, he pressed one pointed ear to the ground. Yes! It was under here, under the rocks! Oh, how clever—it was an #emph[underground] river! He immediately began digging at the ground with his claws. His hands were made for scooping, and the earth around the rocks was dry and crumbly. In no time he had a respectable hole, almost big enough for him to crawl into. Soon he would be feasting on fish and snails and slugs! Kiki-Jiki stood up from his work and gave a victory yelp, shaking his grimy fists in defiance at the sky…when the ground beneath him collapsed and he tumbled through space and plunged head-first into dark, rushing water. #emph[Little scaly fish-with-legs, searching with eager claws in water hungry for light. Turn back, little fish. You are not the only one who hungers.] #figure(image("001_The Dragon's Errand/03.jpg", width: 100%), caption: [Kiki-Jiki, Mirror Breaker | Art by <NAME>in], supplement: none, numbering: none) Kiki-Jiki opened his eyes and took stock of his situation. He was in a very dark, mostly dry place—ah, a cave—which was good, and there was a large fish caught wriggling under the rim of his shell. This could be brained on a rock and eaten, which was also good. However, he had a sinking suspicion that the only way out of this place was the way he had come, and that was bad. He could feel the chill spray coming off the horribly cold subterranean river rushing through a crack in the wall not an arm's length away from him, only to disappear through some fissure further off down the cave. Yes, the river brought him here, or so he had to assume from his general wetness and the fish; for he found he couldn't remember anything very clearly about the last five minutes. He had been digging—he remembered that. And then there was some falling bits, and some thrashing around bits, and then a lot of cold and dark and wet bits, and then…a voice. He sneezed and shuddered. Someone, or something had been talking to him! He looked around the cavern. His large eyes had adjusted enough to see a little ambient light coming from some moss on the ceiling, but as far as he could tell there was no one else lurking in the shadows. He looked down at the lidless eyes of the catch in his hand. A fish—the voice had called him a fish. Well, whoever it was, it was pretty stupid mistaking an akki for a fish. Most akki couldn't swim to save their lives. Kapi-Chapi had done pretty well in that lavaflow, sure, but it wasn't like she had actually made it, and besides, her form was atrocious. Kiki-Jiki chuckled at the memory, and bit the head off his fish. No way was he going back in that water, but if he was going to die here, at least he wouldn't die hungry! #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Kiki-Jiki's stomach growled. He had been pacing back and forth for hours and completely surveyed his prison five times over. His only discovery was that he had been wrong about possible exits. On the side of the cave farthest from the black-flowing river, where the shadows were deepest, there was place where the floor abruptly gave way to a chasm that stretched about four times his own height to the far wall of the cave. This is where he now sat. Dangling his legs over the edge, he had quickly tired of the "I am a pebble, hear me scream as I plummet to my death" game that had so entertained him as a child…and well into puberty…and really even now. But no matter, he had run out of pebbles. About the only thing he had left to throw was the tough, spiny tail of the fish he had caught in his shell, and this he had been saving as a last treat before the darkness took him. So much for waiting, he thought as he held up the tail and opened his mouth—when a gust of wind blew unexpectedly out of the chasm, and ripped the tail right out of his hand. Kiki-Jiki shrieked in dismay as the tail fluttered up in the blast of wind, then turned and began to fall down into the chasm. His instinct was to lunge after the thing, for as boney and spiny as it might be it was all he had—but he held himself back. No one in his right mind would jump into a yawning chasm just to grab a measly fishtail! Then a powerful force gripped him with all the strength and fury of an old relative trying to throttle him for some imagined slight—it was stomach, and stomach was to be obeyed. Kiki-Jiki grinned and launched himself into space. He would eat that tail if it was the last thing he did. And it occurred to him as he plummeted downward into darkness that it probably would be. #emph[Clever fish, to find my lair so readily. Foolish fish, for now you must die.] Kiki-Jiki bolted upright. Something was really wrong, and he had a pretty big suspicion it was more of that #emph[muh] -stuff at work. First of all, he hadn't expected to land so soon after jumping, especially since as far as he could tell he was landing on #emph[thin air] —air that felt as hard as the tribe elder's shell, and hurt just about as much as being sat upon by said elder (a punishment he had endured many times for his various escapades). Weirder still, he had actually seen himself #emph[keep falling] into the chasm below. Damn shame, he was just about to catch that fishtail too, when he saw himself fall out of sight. #emph[Open your eyes, little fish. See the one who will end you. See me.] #figure(image("001_The Dragon's Errand/04.jpg", width: 100%), caption: [Moonring Mirror | Art by <NAME>], supplement: none, numbering: none) Kiki-Jiki gasped. He wasn't standing on nothingness any more. He was standing in the very middle of another cave, somewhat larger than the first one and more or less circular. He couldn't see a ceiling here at all, and there was something strange about the walls. They looked like they were made out of glinting, bluish panels, each as large as he was and fit snugly up against the next. There must have been fifty of them. And by each panel…wait. He wasn't alone. There, in front of each panel, stood horrible, stunted creatures. He whirled around and yes, they were standing along the wall behind him, too! They stared at him with bloodshot eyes peering from both sides of horrid, pointy noses. Oh, they were ugly! Kiki-Jiki fell to his knees and lifted his hands to show he was unarmed and, as one, the foul things fell to the ground and lifted their hands in a mockery of his surrender! They would eat him for sure, they were evil, they were vile, they were…akki? Kiki-Jiki scratched his head. The fifty akki scratched theirs. He stood on one leg and hopped in a circle; the fifty imitated his every move. Mirrors! He was in a room filled with mirrors! He had heard that there were people in Kamigawa that had devised a way to freeze the surface of the water and put it on a wall, and they called the result a "mirror," but this was the first time he'd ever seen the real thing. He made to run over and inspect one close up, but then he caught a glint of something on the ground. The fishtail! Oh, his luck was taking a definite turn for the better. He quickly scooped up the tail and opened his mouth— #emph[Can you see me, little fish?] Kiki-Jiki dropped the tail and bit his tongue. The voice, how could he have forgotten the voice? All around the room the mirror-panels had begun sliding, and now a gap was opening in the wall. And there, from the darkness behind the wall, came a giant, blue, reptilian head. Kiki-Jiki's legs shook and gave way underneath him. The bottom of his shell smacked into the hard ground. Tears filled his eyes as he saw the head draw closer, and the panels shifting and bending, falling into place in a row behind it. By the Patron's lava-singed tail! Those weren't mirrors, they were…they were…scales. #emph[Here I am.] A #emph[ryu] —a great dragon. Its voice echoed inside Kiki-Jiki's skull. Oh, and it was big, huge, enormous. It was probably old, too, and if Kiki-Jiki knew anything about elders, they were cantankerous. #emph[I am older than time itself, frightened fish. The lives of your kind are like a brief shifting in the current to me. I have seen the rings grow on the great oysters in the deep and seen their shells decay to sand. My scales are brighter than any diamond in the earth, and my wrath burns hotter than any fire from the mountains. And I am angry, fish-with-legs, very angry, for something dear to me has been stolen.] Kiki-Jiki's life flashed before his eyes. His brothers and sisters in the home cave, hitting him with rocks. His father shooing them away; then grinning and hitting him with a bigger rock. His mother waving him to her side; then smacking him in the head with a particularly large and pointy rock. Frantically, he searched for a good memory, something with food in it at least. But it was over too quickly. It was done. This was the end. He cowered before the ryu and tearfully crammed the fishtail into his mouth. The bones caught in his mouth and he began to whimper and hack, quietly. He could feel the great lizard's breath wash over him like a tidal wave. It smelled like dead fish. Kiki-Jiki's eyes rolled up and he slammed into the ground, out cold. Blackness… #emph[Little fish-with-shell…little fish…] That voice! If only it would leave him alone. Let him die with some dignity. Okay, that might be asking for too much, but at least he could have a little privacy before the end. #emph[You were clever to find my lair, very clever. Perhaps I have a use for you….] #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The sun was shining. White clouds flitted by. And birds…there were birds wheeling against the blue sky. Kiki-Jiki was on a boat, swaying in an ocean. So calm, so peaceful. No cave, no mirror-scales, no voice in his head. He smiled. He felt the boat rise on the swell of a wave and a puffy white cloud floated close. So soft, so nice. "Hello cloud…" The cloud shot down and passed beneath him. By the Ancient Hardshell! He wasn't on any boat! He was flying! He looked down and saw his face looking back up from a mirror-bright blue scale. He was riding on the ryu's back! He remembered now—the voice saying it needed him to retrieve something that was stolen, a pearl of great value, kept in a floating palace in the sky… #figure(image("001_The Dragon's Errand/05.jpg", width: 100%), caption: [Soratami Cloud Chariot | Art by <NAME>inkel], supplement: none, numbering: none) Then Kiki-Jiki looked up and saw it looming in the distance: an incredible palace that seemed to grow up out of the clouds. Its spires were dazzling in the sun. He could see great arches and courtyards, and here and there vehicles that looked like chariots were skating on the wind currents, back and forth between the main palace and outlying clouds with smaller towers and pagodas on them. These were the halls of the soratami, the people of the moon, a tall, cold race that floated on the air and cared little for the people on the ground, and least of all for the akki. He had heard stories about Zo-Zu the Punisher leading the bravest of the akki on stone-throwing practice near where the soratami chariots were known to fly. And in the charred remains he had seen the results of their powerful #emph[muh…muh…] #emph[Magic.] "#emph[Magic] !" the Kiki-Jiki shouted over the rushing wind. That was the word! He chortled in delight and almost slid off the #emph[ryu's] back, but the great beast snaked in the air, balancing his rider. "But wait—if the soratami have magic, won't they see us coming?" #emph[They will see a swift-moving cloud, nothing more, little fish. The soratami are wise and wary, but they do not own the skies. There are many here much older than they.] The #emph[ryu] swerved left around a dark cumulonimbus. #emph[That cloud there, that is a raijin, a thunder kami. Woe to the soratami chariot that passes beneath its stormy veil.] "Okay," Kiki-Jiki said, gulping. "But what about once you let me off at the palace, what then?" But the ancient ryu merely smiled. His scales gleamed with the reflected light of shining minarets and slender, curved buttresses. They had arrived. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Kiki-Jiki wolfed down his fifth #emph[biwa] from the heavily laden fruit tree in the courtyard outside and contemplated his next move. What was it with these soratami and their wide-open halls? He had half expected the inside of the palace to have some measure of comfort, a little rough-hewn rock, some cave moss, maybe. But all this glass and marble was downright unsettling, and the vast chambers were not good for sneaking. He ducked down a passageway, feet going pitter-pat across painted clouds on the cold flagstone floor. He must be close to the ambassador's chambers the #emph[ryu] was talking about. Then, voices from around the corner, coming this way. Kiki-Jiki took refuge behind a large jade carving of what looked like a giant mouth with wings. "…so the doguso land-dweller says to me 'the #emph[kami] they take everything from us, everything! When they take the very land away from us, what will we stand upon!' and I say to him 'A worrisome problem, I'm sure.'" Kiki-Jiki heard a voice talking, followed by cold laughter as two soratami came floating out of a nearby doorway and past his hiding place. They were tall and slender, and wore long indigo robes inscribed with strange looping symbols and glittering threads of gold. One of them had wide red cuffs on his robe and it seemed that the patterns on his kimono robes twirled and shifted as he moved by. #emph[That must be the ambassador.] Kiki-Jiki waited for them to disappear into one of the halls behind him before he slipped around the strange statue and through the doorway. #figure(image("001_The Dragon's Errand/06.jpg", width: 100%), caption: [Oboro Envoy | Art by <NAME>], supplement: none, numbering: none) He had entered a room far more richly decorated than any he had seen since arriving at the palace. Pillars of glowing green jade stood around the chamber, contrasting pleasantly with the swirling whites and grays of the marble walls. In alcoves on either side of the room stood elegant candelabra carved out of white bone. They were empty but cast flickering light from flames that floated a few inches above where each candle should have been. On the far wall, in the center of a thick tapestry with golden brocade lining a giant woven moon seemed to float above the fabric, casting its own pale light on the back half of the room. It seemed to Kiki-Jiki that the shadow on the moon moved even as he stood there watching it. More magic. His eyes traveled downwards over the silk, further down below the silvery tassels that formed the horizon over which the moon rose, and there, limned in the wan tapestry-moonlight, was a great pearl on a pedestal of iron. The #emph[ryu's] pearl. Kiki-Jiki's palms clenched, and he hesitated a moment. What if this was a trap? What if the soratami had cast some horrible spell of transformation on this pearl, and when he grabbed it he'd be turned into something…something worse than an akki! #emph[What if this whole quest is a trick put on by my family to teach me a lesson?] No, most of his relatives wouldn't be able to control their bowels if they saw a real ryu, let alone talk one into helping with some elaborate practical joke. Kiki-Jiki grinned, imagining his uncles and aunts fleeing pell-mell from his new friend. He took a last bite of biwa and threw the core over onto a nice silk couch. It rolled to the floor, leaving a vaguely orangish trail of slime on the upholstery. Brushing off his hands, Kiki-Jiki strode over to the pedestal and, grabbing up the pearl—which he now found to be nearly as big as his head and far, far heavier—he turned to leave. Then he froze. He was being watched. Out of the corner of his eye he could see someone standing in the nearest alcove, behind the candelabrum. Kiki-Jiki felt the weight of the pearl in his hands. The #emph[ryu] didn't specify that the pearl had to be in any particular condition, and if Kiki-Jiki knew one thing, it was how to throw large objects at people. In one smooth motion, he whirled and raised the pearl in both hands above his head—and the figure in the alcove did exactly the same thing. #emph[Another mirror!] He almost laughed out loud. Pearl tucked back under his arm, he sauntered over to the alcove and shoved the candelabrum off to one side. Now this was a proper mirror: a perfectly clear oval of reflective glass held in a frame of gold, decorated with tiny sapphires and rubies. Set in that frame, Kiki-Jiki's reflection looked pretty damn good. His bony nose was bold, his eyes shone bright and blue, his arms were long and…empty? Kiki-Jiki looked down at the pearl. Yes, there it was, tucked under his right arm, heavy as an unconscious sibling. He looked at the mirror. His reflection had his arm bent in a strange fashion, but there was #emph[no pearl] ! He set the pearl down on the floor, and looked back up. His reflection met his gaze. He scratched his chin. His reflection scratched his own. He smiled and his reflection returned the smile, then #emph[it stuck out its tongue and blew a loud raspberry] ! For a second, Kiki-Jiki thought he had done it—it certainly wouldn't be the first time his mouth had done something without his permission—but he glanced down and sure enough his tongue was firmly where it should be, tucked behind his teeth. He looked back up. Now his reflection waving its finger at him! #emph[Cheeky reflection! You think you're so smart?] Furious, Kiki-Jiki reached down and scooped up the pearl. Slowly, he lifted the pearl up over his head and grinned at his reflection. His reflection's face clouded and he held his hands up over his face. He seemed to be shouting something, but Kiki-Jiki couldn't hear the words. "Now who's having fun?" said Kiki-Jiki as he slammed the pearl into his reflection's face. There was a tremendous shattering sound. The pearl bounced off the mirror and smacked Kiki-Jiki back on to his shell in the middle of the room. He spun, desperately trying to keep the pearl from falling onto the marble floor and cracking or worse: making more noise. He looked up to survey the damage and there, standing in front of the alcove, brushing off shards of mirror-glass, was his reflection! "Who are you?" asked Kiki-Jiki. "I'm Kiki-Jiki!" his reflection replied. "No, #emph[I'm] Kiki-Jiki!" From the hallway outside, they heard voices—soratami, coming to see what the commotion was, no doubt. Kiki-Jiki looked hard at his reflection. "Listen," he said in a loud whisper over the tinkling sound the rest of the mirror was making as the last few shards fell onto the floor. "I don't like the looks of you, but if we don't cooperate, we're both going to fry like mudfowl in a lava pit." His reflection nodded. "This way," said Kiki-Jiki, and lugging the pearl under his arm, he made for the door to the chamber, his reflection close behind. They were in luck. The soratami ambassador hadn't made it back to the entrance. The two Kiki-Jikis took a hard left and spilled out into a wide courtyard. Kiki-Jiki stopped and turned to his reflection. "Look, I have to get back to the #emph[ryu] ." "So do I!" said his reflection. Kiki-Jiki thought fast, which was a first for him, and something of a miracle, but he would have to pat himself on the shell later. There was work to be done. "Er, look—let's split up. I'll go left to that spire there, and you go right, through that courtyard there. Then we'll meet behind the palace at the #emph[ryu] . Gives us a better chance!" His reflection frowned suspiciously. #emph[Damn.] Kiki-Jiki tried a different tactic. "Hey, pick up some more of those #emph[biwa] on your way through, okay?" His reflection grinned. Same face, same stomach, apparently. Kiki-Jiki shuddered as his reflection ran off across the courtyard. Was he so easily duped? That was something he would have to work on. He turned and ran straight back to the little pagoda where the #emph[ryu] had promised to pick him up. The sun was warm on his shell, and somehow, the pearl didn't feel so heavy anymore. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The #emph[ryu] sped fast through a string of puffy clouds, swerving now and then to avoid flocks of high-flying giant moths that scattered like pieces of paper in the ryu's wake. The pearl, held in his massive jaws, glowed softly in the crimson light of the setting sun. On his back, Kiki-Jiki sat in a rare moment of contemplation. Then he straightened up and shouted out over the howling wind. "What do you think happened to my reflection?" #emph[He is the prisoner of the soratami ambassador now.] "Oh," said Kiki-Jiki frowning. "I feel kinda' bad leaving him behind. I mean, family is one thing, but he's…me!" #emph[Worry not, brave little fish. Your kind's reflections are even more ephemeral than you are. He will not be caught for long. Be happy, fish-with-horns, great mirror breaker. You have done well.] Kiki-Jiki wasn't sure what "ephemeral" meant, but it sounded like some kind of magic that would help his reflection escape, and that was good. He breathed a sigh of relief and looked down on the ground far below. There was the ridge he had climbed the day before, and beyond that, the mountains where he had come from…where his family lived. Kiki-Jiki smacked himself on the shell. He should have made more reflections! The thought of dozens of himself running amuck in the caves made his body quiver with delight. He could almost see his father, mouth wide open in horrified astonishment, buried under a swarm of Kiki-Jikis! He shouted over the wind, "Shoulda' grabbed more of those mirrors!" #emph[What can a mirror give you other than what you show it? The magic was yours, clever fish.] "Wait," Kiki-Jiki yelled, scratching between the bony plates on his forehead. "You mean I can make more reflections, whenever I want? I don't need those mirrors?" The ryu said nothing, but he thought he could feel a strange vibration through the great blue scales. A rumbling, like…laughter! The #emph[ryu] was laughing! In a rush of motion, they looped up around a cloud and shot down through the air toward the hills below. #figure(image("001_The Dragon's Errand/07.jpg", width: 100%), caption: [Keiga, the Tide Star | Art by Ittoku], supplement: none, numbering: none) The #emph[ryu] had promised to take him to an abandoned orchard he knew of, with lots of overburdened fruit trees and fat snails for the taking. There would be a pool of water there, too, thought Kiki-Jiki—a place where he could try out his new-found talents. Kiki-Jiki grinned. Today was turning out to be a pretty good day, after all. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) High in the cloud palace above them, Meloku paused in his pacing. Fixing his prisoner in his steely gaze, he smiled. "I truly hoped it would not come to this, as I am not fond of barbarism, but you leave me no choice. Let us cut you down, and witness this miracle of akki flight firsthand!" Hanging from the silver cord, the akki squealed and struggled, which made him swing slowly back and forth which made him squeal even louder. "This brings me no pleasure, #emph[Kiki-Jiki] , I assure you," said Meloku, a satisfied gleam in his eyes as he drew his dagger and floated up off the floor toward the spire and his helpless prisoner. Then he paused in mid-air. Something was wrong. The akki was no longer squirming. In fact, he was perfectly still, frozen in mid-air. Meloku raised an eyebrow, then gasped as the akki #emph[splintered] into a thousand gleaming shards that fell like a sudden rain, disappearing into the Æther before they reached the floor. All that was left was a tangled length of cord, hanging uselessly from the ceiling spire. Meloku rubbed his temples with long, slender fingers. Yes, it had been a most #emph[annoying] interrogation indeed. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) In a hidden grotto by an underground river, the great blue #emph[ryu] coiled in the darkness, around the pearl that glowed faintly as though it had been warmed by the sun's rays on the journey down from the cloud palace. #emph[Sleep, my child, and grow strong. Soon you will hatch and take your rightful place among the falls and the mists and the stars of this world. You will eat the oysters in the deep, and the sweet cloud-dew, and the fish that walk on your land. Just…go easy on the shelled ones.]
https://github.com/sitandr/typst-examples-book
https://raw.githubusercontent.com/sitandr/typst-examples-book/main/src/typstonomicon/block_break.md
markdown
MIT License
# Breakpoints on broken blocks ### Implementation with table headers & footers See a demo project (more comments, I stripped some of them) [there](https://typst.app/project/r-yQHF952iFnPme9BWbRu3). ```typ /// author: wrzian // Underlying counter and zig-zag functions #let counter-family(id) = { let parent = counter(id) let parent-step() = parent.step() let get-child() = counter(id + str(parent.get().at(0))) return (parent-step, get-child) } // A fun zig-zag line! #let zig-zag(fill: black, rough-width: 6pt, height: 4pt, thick: 1pt, angle: 0deg) = { layout((size) => { // Use layout to get the size and measure our horizontal distance // Then get the per-zigzag width with some maths. let count = int(calc.round(size.width / rough-width)) // Need to add extra thickness since we join with `h(-thick)` let width = thick + (size.width - thick) / count // One zig and one zag: let zig-and-zag = { let line-stroke = stroke(thickness: thick, cap: "round", paint: fill) let top-left = (thick/2, thick/2) let bottom-mid = (width/2, height - thick/2) let top-right = (width - thick/2, thick/2) let zig = line(stroke: line-stroke, start: top-left, end: bottom-mid) let zag = line(stroke: line-stroke, start: bottom-mid, end: top-right) box(place(zig) + place(zag), width: width, height: height, clip: true) } let zig-zags = ((zig-and-zag,) * count).join(h(-thick)) rotate(zig-zags, angle) }) } // ---- Define split-box ---- // // Customizable options for a split-box border: #let default-border = ( // The starting and ending lines above: line(length: 100%), below: line(length: 100%), // Lines to put between the box over multiple pages btwn-above: line(length: 100%, stroke: (dash:"dotted")), btwn-below: line(length: 100%, stroke: (dash:"dotted")), // Left/right lines // These *must* use `grid.vline()`, otherwise you will get an error. // To remove the lines, set them to: `grid.vline(stroke: none)`. // You could probably configure this better with a rowspan, but I'm lazy. left: grid.vline(), right: grid.vline(), ) // Create a box for content which spans multiple pages/columns and // has custom borders above and below the column-break. #let split-box( // Set the border dictionary, see `default-border` above for options border: default-border, // The cell to place content in, this should resolve to a `grid.cell` cell: grid.cell.with(inset: 5pt), // The last positional arg or args are your actual content // Any extra named args will be sent to the underlying grid when called // This is useful for fill, align, etc. ..args ) = { // See `utils.typ` for more info. let (parent-step, get-child) = counter-family("split-box-unique-counter-string") parent-step() // Place the parent counter once. // Keep track of each time the header is placed on a page. // Then check if we're at the first placement (for header) or the last (footer) // If not, we'll use the 'between' forms of the border lines. let border-above = context { let header-count = get-child() header-count.step() context if header-count.get() == (1,) { border.above } else { border.btwn-above } } let border-below = context { let header-count = get-child() if header-count.get() == header-count.final() { border.below } else { border.btwn-below } } // Place the grid! grid( ..args.named(), columns: 3, border.left, grid.header(border-above , repeat: true), ..args.pos().map(cell), grid.footer(border-below, repeat: true), border.right, ) } // ---- Examples ---- // #set page(width: 7.2in, height: 3in, columns: 6) // Tada! #split-box[ #lorem(20) ] // And here's a fun example: #let fun-border = ( // gradients! above: line(length: 100%, stroke: 2pt + gradient.linear(..color.map.rainbow)), below: line(length: 100%, stroke: 2pt + gradient.linear(..color.map.rainbow, angle: 180deg)), // zig-zags! btwn-above: move(dy: +2pt, zig-zag(fill: blue, angle: 3deg)), btwn-below: move(dy: -2pt, zig-zag(fill: orange, angle: 177deg)), left: grid.vline(stroke: (cap: "round", paint: purple)), right: grid.vline(stroke: (cap: "round", paint: purple)), ) #split-box(border: fun-border)[ #lorem(25) ] // And some more tame friends: #split-box(border: ( above: move(dy: -0.5pt, line(length: 100%)), below: move(dy: +0.5pt, line(length: 100%)), // zig-zags! btwn-above: move(dy: -1.1pt, zig-zag()), btwn-below: move(dy: +1.1pt, zig-zag(angle: 180deg)), left: grid.vline(stroke: (cap: "round")), right: grid.vline(stroke: (cap: "round")), ))[ #lorem(10) ] #split-box( border: ( above: line(length: 100%, stroke: luma(50%)), below: line(length: 100%, stroke: luma(50%)), btwn-above: line(length: 100%, stroke: (dash: "dashed", paint: luma(50%))), btwn-below: line(length: 100%, stroke: (dash: "dashed", paint: luma(50%))), left: grid.vline(stroke: none), right: grid.vline(stroke: none), ), cell: grid.cell.with(inset: 5pt, fill: color.yellow.saturate(-85%)) )[ #lorem(20) ] ``` ### Implementation via headers, footers and stated <div class="warning"> Limitations: <strong>works only with one-column layout and one break</strong>. </div> ```typ #let countBoundaries(loc, fromHeader) = { let startSelector = selector(label("boundary-start")) let endSelector = selector(label("boundary-end")) if fromHeader { // Count down from the top of the page startSelector = startSelector.after(loc) endSelector = endSelector.after(loc) } else { // Count up from the bottom of the page startSelector = startSelector.before(loc) endSelector = endSelector.before(loc) } let startMarkers = query(startSelector) let endMarkers = query(endSelector) let currentPage = loc.position().page let pageStartMarkers = startMarkers.filter(elem => elem.location().position().page == currentPage) let pageEndMarkers = endMarkers.filter(elem => elem.location().position().page == currentPage) (start: pageStartMarkers.len(), end: pageEndMarkers.len()) } #set page( margin: 2em, // ... other page setup here ... header: context { let boundaryCount = countBoundaries(here(), true) if boundaryCount.end > boundaryCount.start { // Decorate this header with an opening decoration [Block break top: $-->$] } }, footer: context { let boundaryCount = countBoundaries(here(), false) if boundaryCount.start > boundaryCount.end { // Decorate this footer with a closing decoration [Block break end: $<--$] } } ) #let breakable-block(body) = block({ [ #metadata("boundary") <boundary-start> ] stack( // Breakable list content goes here body ) [ #metadata("boundary") <boundary-end> ] }) #set page(height: 10em) #breakable-block[ #([Something \ ]*10) ] ```
https://github.com/heinrichti/tiacv
https://raw.githubusercontent.com/heinrichti/tiacv/main/tiacv.typ
typst
#let main = state("main", rgb("414141")) #let accent = state("accent", rgb("b2967d")) #let bubbles = state("bubbles", rgb("eff8f8")) #let linepadding = state("linepadding", 15pt) #let linewidth = state("linewidth", 1pt) #let tiacv(content) = { set page(margin: (x: 2cm, y: 2cm), numbering: "1/1") set text(font: "Source Sans 3", lang: "de", fallback: false) show heading: it => { set text(font: "Roboto", fill: main.get()) it } show heading.where(level: 1): it => { set text(font: "Roboto", fill: main.get()) let h_before = query(selector( heading.where(level: 1) .or(heading.where(level: 2))) .before(here())) if h_before.len() > 1 { let header = h_before.at(h_before.len()-2) if header.location().page() == here().page() and header.depth == 1 { place(dx: -linepadding.get(), dy: text.size*1.5, line(angle: 270deg, start: (4pt, 4pt), length: here().position().y - header.location().position().y, stroke: linewidth.get() + accent.get())) } } place(dx: -linepadding.get(), dy: text.size*1.5, circle(fill: accent.get(), height: 8pt)) let measure = measure(it.body) grid(columns: (auto, 1fr), gutter: 3pt, it.body, line(stroke: linewidth.get()/2, start: (0pt, measure.height), length: 100%)) // v(5pt) } show heading.where(depth: 2): it => text(font: "Roboto", fill: accent.get(), size: text.size*0.91)[#it.body] content } #let bubble(t) = { context { box(rect(fill: bubbles.get(), radius: 4pt)[#t]) } } #let skills(skills) = { block[ #for s in skills { bubble(s) + h(4pt) } ] } #let page_header(name, position, address, information: (), quote: "", headersep: [#h(8pt) | #h(8pt)]) = { context { let smallsize = text.size * 0.8 align(center, [ #text(fill: rgb(main.get()), size: text.size*3.2)[#name] \ #smallcaps(text(fill: accent.get(), size: smallsize)[#position]) \ #text(size: smallsize)[#address] \ #if information != () { text(size: smallsize)[#information.join(headersep)] } #if quote != "" { text(fill: accent.get())["#quote"] } ]) } } #let cventry(company, job, description, location: [], timespan: []) = { layout(l => { let c = box(width: l.width, [ #company #h(1fr) #text(fill: accent.get(), weight: "regular")[#location] \ #smallcaps(text(fill: main.get(), weight: "semibold", job)) #h(1fr) #text()[#timespan] #description ]) context { let h_before = query(selector(heading).before(here())) for header in h_before.rev() { if header.location().page() == here().page() and header.depth == 2 { place(dx: -linepadding.get(), line(angle: 270deg, start: (4pt, 4pt), length: here().position().y - header.location().position().y - 4pt, stroke: linewidth.get() + accent.get())) break } if header.location().page() == here().page() and header.depth == 1 { place(dx: -linepadding.get(), line(angle: 270deg, start: (4pt, 4pt), length: here().position().y - header.location().position().y - 4pt, stroke: linewidth.get() + accent.get())) break } } let m = measure(c) place(dx: -linepadding.get(), [ #place(line(angle: 90deg, start: (4pt, 3pt), length: m.height - 3pt, stroke: linewidth.get() + accent.get())) #place(dx: 1pt, dy: 2pt, circle(fill: white, stroke: (linewidth.get()/2) + accent.get(), height: 6pt)) ] ) } c }) } #let fa(name) = { text( font: "Font Awesome 6 Free Solid", [ #name ] ) } #let fa-brands(name) = { text( font: "Font Awesome 6 Brands", [ #name ] ) }
https://github.com/TypstApp-team/typst
https://raw.githubusercontent.com/TypstApp-team/typst/master/tests/typ/meta/state.typ
typst
Apache License 2.0
// Test state. --- #let s = state("hey", "a") #let double(it) = 2 * it #s.update(double) #s.update(double) $ 2 + 3 $ #s.update(double) Is: #s.display(), Was: #locate(location => { let it = query(math.equation, location).first() s.at(it.location()) }). --- // Try same key with different initial value. #state("key", 2).display() #state("key").update(x => x + 1) #state("key", 2).display() #state("key", 3).display() #state("key").update(x => x + 1) #state("key", 2).display() --- #set page(width: 200pt) #set text(8pt) #let ls = state("lorem", lorem(1000).split(".")) #let loremum(count) = { ls.display(list => list.slice(0, count).join(".").trim() + ".") ls.update(list => list.slice(count)) } #let fs = state("fader", red) #let trait(title) = block[ #fs.display(color => text(fill: color)[ *#title:* #loremum(1) ]) #fs.update(color => color.lighten(30%)) ] #trait[Boldness] #trait[Adventure] #trait[Fear] #trait[Anger] --- // Make sure that a warning is produced if the layout fails to converge. // Warning: layout did not converge within 5 attempts // Hint: check if any states or queries are updating themselves #let s = state("s", 1) #locate(loc => s.update(s.final(loc) + 1)) #s.display()
https://github.com/magic3007/cv-typst
https://raw.githubusercontent.com/magic3007/cv-typst/master/doc/research_projects.typ
typst
*Robust FPGA Macro Placement Algorithm Considering Cascaded Macros and Fence Regions* #h(1fr) 2023/06 - 2023/09 \ // PKU-IDEA Group, advised by Prof. <NAME> #h(1fr) Beijing, China \ - Developed cutting-edge electrostatic-based FPGA placement algorithms to address the complexity in FPGA placement, including high design utilization (70%-84% LUT, 38%-47% FF, and 80%-90% DSP/BRAM), cascaded macro blocks, intricate interconnection complexity, and region constraints (with up to 44.29% of instances falling under region constraints). - Led a team of 5 members and secured *2nd place* in the #link("https://ieeexplore.ieee.org/document/10299868/")[MLCAD 2023 FPGA Macro Placement Contest]. The bug-fixed version achieved the best results, outperforming the widely used industrial tool `Vivado` by 27.8% in terms of quality score and surpassing the 1st place winner by 6.9%. - Implemented a GPU-accelerated version utilizing CUDA, resulting in a speedup of 3.180$times$ compared to the 1st place winner, showcasing our commitment to pushing the boundaries of performance optimization in FPGA placement algorithms. *GPU-accelerated FPGA Placement and Routing Framework* #link("https://github.com/PKU-IDEA/OpenPARF")[github.com/PKU-IDEA/OpenPARF] #h(1fr) 2022/12 -- 2023/06 \ // PKU-IDEA Group, advised by Prof. <NAME> #h(1fr) Beijing, China \ - *Top Contributor of `OpenPRAF`*. `OpenPRAF` is an open-source GPU-accelerated placement and routing algorithm framework for contemporary complex FPGA architectures, addressing the lack of high-quality open-source FPGA placement and routing frameworks in the academic community and promoting research at the nexus of electronic design automation (EDA) and machine learning. - *Performance Improvement*. Incorporated the latest research achievements in FPGA placement and routing techniques, achieved 12.7% better routed wirelengths on the ISPD 2016 dataset, along with over 2$times$ speedup in placement efficiency compared to other state-of-the-art placement engines. // - *Versatility and Generalization*. `OpenPARF` supports placement and routing on the advanced FPGA architecture `UltraScale+`, and provides an extensible configuration file for easy adaptation to other architectures. - *Developer Experience*. Initiated the development flow of the `PyTorch C++` API to foster agile C++/Python co-development. Implemented a flexible device configuration standard to enable seamless adaptation, thereby facilitating the versatile expansion of machine learning applications. *FPGA Placement Algorithm Driven by Multiple Optimization Objectives* #h(1fr) 2022/07 - 2022/11 \ // PKU-IDEA Group, advised by Prof. <NAME> #h(1fr) Beijing, China \ - Addressed the challenges posed by modern FPGA placement, which involves a mixed optimization problem with multiple objectives, including wirelength, routability, timing closure, and clock feasibility, which is crucial for developing efficient FPGA placement algorithms. - Designed and implemented a nested Lagrangian relaxation framework that incorporates the aforementioned optimization objectives. Developed an effective timing-criticality-based net weighting scheme to handle time violations and integrated timing optimization into a continuous optimization algorithm. - Conducted experiments on industrial benchmarks, which demonstrated that the proposed algorithms achieved a 23.6% improvement in worst negative slack (WNS) and a 22.5% improvement in total negative slack (TNS) compared to state-of-the-art placers. Relevant works have been accepted by *TCAD 2023* (a flagship journal in the field of design automation). *Clock-aware FPGA Placement Algorithm Considering SLICEL-SLICEM Heterogeneity* #h(1fr) 2021/09 - 2022/06 // PKU-IDEA Group, advised by Prof. <NAME> #h(1fr) Beijing, China \ - Addressed the challenges posed by contemporary FPGAs, which exhibit asymmetric properties in SLICEL-SLICEM heterogeneity and limited clock routing resources, making it difficult to achieve clock-feasible placement solutions. - Developed a novel multi-electrostatic formulation to effectively handle the asymmetric SLICE compatibility resulting from SLICEL-SLICEM heterogeneity. Introduced a quadratic penalization technique to eliminate violations of discrete clock constraints. - Conducted experiments on ISPD 2017 contest benchmarks, showcasing a 14.2% improvement in routed wirelength compared to state-of-the-art FPGA placers. Relevant works has been accepted by *DAC 2022* (a premier conference in the field of computer architecture).
https://github.com/peterpf/modern-typst-resume
https://raw.githubusercontent.com/peterpf/modern-typst-resume/main/assets/icons/README.md
markdown
The Unlicense
# Icons The icons are from [Font Awesome Free](https://github.com/FortAwesome/Font-Awesome/) and licensed under the `CC BY 4.0` license, see [LICENSE.txt]. Icons in this folder must be stored in white (#ffffff) to enable color adjustments in the Typst template.
https://github.com/Dherse/masterproef
https://raw.githubusercontent.com/Dherse/masterproef/main/masterproef/parts/3_translation.typ
typst
#import "../ugent-template.typ": * = Translation of intent & requirements <sec_intent> In @sec_programming_photonic_processors, the different programming ecosystem components, paradigms and tradeoffs were discussed. In this section, the translation of the user's intent -- i.e. the design they wish to implement -- will be discussed in further detail. The translation of intent is how the user will write down their design and how the program translates that design into an actionable, programmable design. This section will also outline some of the features needed for easier intent translation. This will be done by discussing important features such as _tunability_, _reconfigurability_, and _programmability_. These features revolve around the ability of the user to tune the operation of their programmed photonic processor as it is running. For this purpose, this section will introduce novel concepts, such as _constraints_ and their _solver_ and _reconfigurability through branching_. These two essential concepts will be discussed in detail and synergise to create an easy-to-use, powerful programming ecosystem for photonic processors. Additionally to the aforementioned points, several key features were discussed in @initial_requirements. The features relate to real-time control, which works in pair with _reconfigurability_ and _tunability_, and simulation, which will use _constraints_ and its solver. Platform independence, which will be achieved through the design of a unified vendor-agnostic ecosystem and the visualisation of the design, which has led to the design of the _marshalling layers_ which will be discussed in @sec_marshalling. #udefinition( footer: [ Adapted from @noauthor_logic_2023. ], )[ *Synthesis* is the process of transforming the description of a desired circuit into a physical circuit. ] Synthesis is the process of transforming the user's code into a physical circuit on the chip. It is done in a multitude of stages that will be discussed in @sec_phos. These stages are all required to go from the user's code, which represents their intent, and turn it into an actionable design that can be executed on the photonic processor. The synthesis process is complex, involving many components that all must cooperate. Additionally, some of the tasks that synthesis must do, such as place-and-route, are computationally intensive and often regarded as NP-hard. == Functional requirements #udefinition( footer: [ Adapted from @martin_what_2023. ], )[ A *functional requirement* is a requirement that specifies a function that a system or component of a system must be able to perform. ] Before a user can design their circuit, they must list their functional requirement. These requirements are the functionality that they wish for their circuit to achieve. As previously discussed, in @sec_language_tool, these requirements are the most declarative form of the user's intent. However, some elements will generally be common to all those functional requirements. And can be seen as the functional requirements for intent translation. These requirements can be seen in @tab_functional_requirements and are discussed in the following sections. #ufigure( caption: [ Functional requirements for intent translation ], kind: table, )[ #table( columns: (2em, 0.1fr, 0.5fr, 0.1fr), align: center + horizon, stroke: (x: none), table.header( table.cell(colspan: 2, smallcaps[Requirement]), smallcaps[Description], smallcaps[Discussion], ), table.cell(colspan: 2, smallcaps[Ideal behaviour]), align( left, )[ As discussed in @fppga-difficulties, devices vary from device to device and over time and temperature. The user should be able to program the device without having to worry about these variations. ], [ @sec_calibration_and_variation_mitigations ], table.cell(rowspan: 3, rotate(-90deg, box(width: 200pt)[#smallcaps[Realtime feedback]])), smallcaps[Reconfigurability], align( left, )[ Reconfigurability allows the user to change the topology of their device at runtime. This is useful for several reasons. The primary reason is the ability to change behaviour based on configurations or inputs. ], [ @sec_tunability_reconfigurability ], smallcaps[Tunability], align( left, )[ On the other hand, Tunability does not change the topology in itself, but rather changes the behaviour of the mesh through tuning elements already present in the mesh. This may be used to vary gains, phase shifters, switches, or couplers to affect the behaviour of the mesh. This can also allow the user to build feedback loops that they control. ], [ @sec_tunability_reconfigurability ], smallcaps[Programmability], align( left, )[ In order to be able to make use of tunability and reconfigurability, the user must be able to communicate with their programmed device programmatically. This is done using a #gloss("hal", long: true) that handles communication with the device. ], [ @sec_programmability ], table.cell(colspan: 2, smallcaps[Simulation]), align( left, )[ Simulation allows the user to test their code, verify whether it works and debug it before running it on the device. This is an important feature as it also allows the user to experiment without having access to the device. ], [ @sec_intent_simulation ], table.cell(colspan: 2, smallcaps[Platform independence]), align( left, )[ Platform independence allows the user to focus on their design rather than the specific device it is expected to run on. While some degree of platform dependence is to be expected, most of the code should be platform-independent and allowed to run on any device. ], [ @sec_platform_independence ], table.cell(colspan: 2, smallcaps[Visualisation]), align( left, )[ Visualisation allows the user to see the result of a simulation, what a finalised design looks like, and block diagrams of functionality. All of these features can help the user in their design process, but also help the user when sharing information with others. Therefore, providing visualisation is desirable. ], [ @sec_visualisation ], ) ] <tab_functional_requirements> == Programmability <sec_programmability> #udefinition( footer: [ Adapted from @huang_virtualization_2018. ], )[ A *#gloss("hal", long: true)* is a library whose purpose is to abstract the hardware with a higher level of abstraction, allowing for easier use and programming of the hardware. ] Programmability refers to the ability of the user to interact with their circuit while it is running programmatically. This is done using a @hal, which allows for interoperation between their software and their hardware, completing the hardware-software codesign loop. The @hal is made of two parts: the core @hal provided by the device manufacturer and the user @hal generated by the compiler based on the user's code. ==== Core @hal As previously mentioned, the core @hal is provided by the device manufacturer and consists mostly of communication routines. It handles the communication between the user's software and the device. This @hal is, therefore, platform-specific and is not generated by the compiler. However, the core @hal must be able to communicate with the user @hal, which is generated by the compiler. This is done by enforcing that all @hal[s] implement a common @api that allows the user to interact with both the core @hal and the user @hal in a consistent way, making the code as portable as possible. ==== User @hal The user @hal is a higher-level part of the @hal built from the user's design. It encapsulates the tunable values, reconfiguration states and detectors that are defined within the design and allows the user to change these values, reconfigure the device and readout detectors. All the while using the names the user-defined for these different values. This allows the user to interact with the device in a way consistent with their design, making it easier to understand and use. This should improve productivity and reduce the risk of error in the hardware-software codesign interface. ==== User @hal template The user @hal needs to be generated from the user's design; however, there may be elements of this @hal that are platform specific and, therefore must be generated instead by the device support package. This is expected to be done by allowing the device support package to generate part of the user @hal through a template or custom code. This allows the device support package to provide platform-specific features to the user @hal or to optimise common implementations for the platform, further improving the quality and usability of the generated interface. == Intrinsic operations <sec_intrinsic_operations> From the physical properties and features of a photonic processor, as discussed in @sec_programmable_photonics, one can extract a set of intrinsic operations that the processor must support. These operations in themselves are not required to be on the chip, but the support packages of the chip must be able to understand them and produce errors when they are not implemented. A complete list with a description can be found in @tab_intrinsic_operations. In this section, the intrinsic operators will be discussed in more detail. ==== Filter One of the core operations that almost all photonic circuits perform is filtering. It is a block that alters the amplitude of an input signal in a predictable manner based on its spectral content. Due to the prevalence of filters in photonic circuits, coupled with their special constraint -- see below -- they benefit from being an intrinsic operation for a photonic processor. During compilation and before place-and-route, the filter will be synthesised based on its arguments in order to produce a filter of the desired frequency response. This synthesised filter will therefore be optimised for the hardware platform. There are many different types of filters, the most common ones that can easily be implemented on a mesh -- are @mzi[s], ring resonators, and lattice filters. Additionally, compound filters that combine multiple types of filters or more than one filter can be created; such filters can have improved response or behave like bandpass filters. Therefore, the compiler's task is to choose the base filter based on the specification and performance criteria that the user has set. For example, the user might prioritise optimising for mesh usage rather than finesse or might optimise for flatness of the phase response rather than the mesh usage, etc. ==== Gain and loss All waveguides within a device will cause power loss in the optical signals. However, this loss may not be sufficient if the user is working with a high-power signal. Therefore some devices might include special loss elements whose loss is tunable or at least known. Besides, following the same principle, some users may want to compensate for this loss by using gain sections or amplify incoming signals. Optical gain is difficult to obtain on silicon platforms, just like sources, but it is possible to obtain gain through the use of rare-earth doped waveguides or other techniques such as micro-transfer printing. Therefore, the compiler must be able to synthesise gain and loss sections based on the user's specifications. However, if the device does not support gain or loss, the compiler should produce an appropriate error for the user. ==== Modulator and detectors Two key applications of photonic processors are telecommunication and processing @rf signals. Therefore, it stands to reason that modulators and detectors are key components that are expected to be present in most photonic processors. Additionally, based on the device, there may be an optimal type of modulator for either type -- phase modulation or amplitude modulation -- and the compiler may choose an appropriate implementation of the modulator. Additionally, the same is true for detectors, although they would generally only be used for amplitude demodulation, with phase coherent demodulation being the responsibility of the user. ==== Splitters Signals are often split, and they may be split in specific ratios. For this reason, a splitter intrinsic operation that splits a signal into $n$ new signals with weight provided by the user is desirable. Internally, the compiler will likely have to implement these splitters as 1-to-2 splitters with specific splitting ratios, but the user should not have to worry about this. Additionally, the compiler can optimise the placement of these splitters to minimise the mesh usage, or to minimise non-linear effects in high-power signals, or maintain phase coherence between signals. ==== Combiners and interferometers A combiner is the inverse of a splitter. It combines $n$ signals together; it can operate in one of two modes, it can either try and reach a target power level -- which can be the maximum power --, or it can interfere with the signals with their differential phase to create interference. The user is responsible for choosing which implementation to use. However in cases where the phase is well known, the compiler may be able to optimise the design by using a phase coherent combiner, thus not requiring a feedback loop and a phase shifter. ==== Switches Some devices may have hardware optical switches, while others may need to rely on feedback loops. Generally, all platforms should be able to support switching. Whether they rely on purpose-built hardware or on feedback loops does not matter. Switching can be useful in many applications, including telecommunication, signal processing, etc. It may be used to route test signals, route signals conditionally, or implement simple reconfigurability without the added cost of having more than one mesh. ==== Sources A lot of applications will need the generation of laser light; while this is difficult to achieve on silicon, it may be available on some devices. As laser sources are such an important part of photonics, it is important to at least plan for sources to be available in the future. Additionally, in some cases, the compiler may be able to synthesise a source from a gain source, reflectors and splitters. However, this is not always possible, and the compiler should be able to produce an error if the user requests a source and none is available. ==== Phase shifter Phase shifters are a necessary building block for a lot of more complex structures such as tunable @mzi[s], tunable filters, coherent communication, power combiners, etc. Therefore, as an integral part of the functioning of photonic processing, they must be present as an intrinsic operation. Additionally, they may be used in two different modes: the first mode is as a phase shifter, shifting the phase of a single signal, and the second mode is as a differential phase shifter, imposing a phase shift with respect to another signal. This case is especially interesting as it can be used to implement complex quadrature modulation schemes. In @sec_examples, examples regarding coherent communication will be presented that makes use of this intrinsic operation to implement complex modulation schemes, as well as to implement a beamforming network. ==== Delay lines Each waveguide being used on the chip adds latency to the signal. While this latency may be low at the scale of a modulated signal, it can still be relatively significant overall. For this reason, the device must provide ways for the user to align signals in time by using a delay line or multiple wires of different lengths to match the total optical length. It works nicely with the ability to express differential constraints, which will be discussed in @sec_constraints. ==== Coupler Couplers are part of each photonic gate present in the processor. They have the ability to couple two signals based on a coupling coefficient. This is a key intrinsic, as it allows the user to couple signals directly, something that would otherwise be difficult to implement. In terms of the underlying hardware, it should be a direct one-to-one relationship with a coupler on the processor itself. However, the compiler should be able to optimise the coupling coefficient based on the signal's frequency content and the device's calibration curves. ==== Sink & empty source In some cases, the user might want to produce an empty signal or consume a signal without doing anything with it. For this reason, the compiler should be able to produce a sink intrinsic operation that consumes a signal with little to no return losses and an empty source that produces a signal with little to no power. This is especially useful in cases where the user might want to have a reference "empty" signal or a signal consumed without any effect on the rest of the system. An example of such cases is a spectrometer, which wants to switch in an empty signal to calibrate the dark current of the detectors. #show table.cell: set block(breakable: false) #ufigure( outline: [ Intrinsic operations in photonic processors. ], caption: [ Intrinsic operations in photonic processors, with their name, description and arguments. For each argument, an icon indicates whether the argument is required (#required_sml) or optional (#desired_sml). Additionally, the type of the value is also indicated by an icon; it can be optical (#lightbulb), electrical (#lightning), or a value (#value). ], kind: table, )[ #set list(indent: 0cm) #table( columns: (auto, 1fr, auto), align: center + horizon, stroke: (x: none), table.header( smallcaps[*Intrinsic operation*], smallcaps[*Description*], smallcaps[*Arguments*], ), smallcaps[*Filter*], align( left, )[ Filters a given signal at a given wavelength or set of wavelengths. The architecture and parameters are derived automatically from its arguments and the constraints on its input signal. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Input signal - #required_sml#lightbulb#h(0.1em) Through signal - #desired_sml#lightbulb#h(0.1em) Drop signal - #required_sml#value#h(0.1em) Wavelength response ], smallcaps[*Gain/loss*], align( left, )[ Gain/loss sections allow the user to increase or decrease the power of a signal. The platform may not support gain or loss, in which case the operation will fail. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Input signal - #required_sml#lightbulb#h(0.1em) Output signal - #required_sml#value#h(0.1em) Gain/loss ], smallcaps[*Modulator*], align( left, )[ A phase or amplitude modulator that uses an external electrical signal as the modulation source. The implementation is chosen by the support package based on the type of modulator. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Input signal - #required_sml#lightbulb#h(0.1em) Output signal - #required_sml#lightning#h(0.1em) Modulation source - #required_sml#value#h(0.1em) Modulation type ], smallcaps[*Detector*], align(left)[ A detector that converts an optical signal to an electrical signal. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Input signal - #required_sml#lightning#h(0.1em) Output signal ], smallcaps[*Splitter*], align( left, )[ A splitter that splits an optical signal into multiple lower-power optical signals. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Input signal - #required_sml#lightbulb#h(0.1em) Output signals - #required_sml#value#h(0.1em) Splitting ratios ], smallcaps[*Combiner*], align( left, )[ A combiner that combines multiple optical signals into a single optical signal. At the same time, maximising the total output power. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Input signals - #required_sml#lightbulb#h(0.1em) Output signal ], smallcaps[*Interferometers*], align( left, )[ A combiner that interferes multiple optical signals into a single optical signal. Does not perform any power optimisation. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Input signals - #required_sml#lightbulb#h(0.1em) Output signal ], smallcaps[*Switch*], align(left)[ A switch that switches between two optical signals. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Input signal - #required_sml#lightbulb#h(0.1em) Output signal - #required_sml#value#h(0.1em) Switch state ], smallcaps[*Source*], align(left)[ A laser source that generates an optical signal. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Output signal - #required_sml#value#h(0.1em) Wavelength ], smallcaps[*Phase shifter*], align( left, )[ A phase shifter that shifts the phase of an optical signal. Optionally, performs the phase shift in reference to another signal. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Input signal - #desired_sml#lightbulb#h(0.1em) Reference signal - #required_sml#lightbulb#h(0.1em) Output signal - #required_sml#value#h(0.1em) Phase shift ], smallcaps[*Delay*], align(left)[ A delay that delays an optical signal. ], align(left)[ - #required_sml#lightbulb#h(0.1em) Input signal - #required_sml#lightbulb#h(0.1em) Output signal - #required_sml#value#h(0.1em) Delay ], smallcaps[*Coupler*], align(left)[ A coupler that couples two optical signals. ], align(left)[ - #required_sml#lightbulb#h(0.1em) 1st input signal - #required_sml#lightbulb#h(0.1em) 2nd input signal - #required_sml#lightbulb#h(0.1em) 1st output signal - #required_sml#lightbulb#h(0.1em) 2nd output signal - #required_sml#value#h(0.1em) Coupling factor ], smallcaps[*Sink*], align( left, )[ A perfect sink that consumes an optical signal with little to no return loss. ], align(left)[ - #required_sml#lightbulb#h(0.1em) input signal ], smallcaps[*Empty*], align( left, )[ A perfect empty signal source that produces an optical signal with little to no power. ], align(left)[ - #required_sml#lightbulb#h(0.1em) output signal ], ) ] <tab_intrinsic_operations> #pagebreak(weak: true) == Constraints <sec_constraints> Constraints are a technique for expressing requirements on values and signals. They are associated with each signal or value to give additional information regarding its contents. In @sec_future_work, the concept of using constraints with _refinement types_ will also be discussed as a potential future expansion of constraints. The core idea of constraints is that the user can use them to specify additional information about their signals at a given point in the code. Additionally, they can be used to check the code's validity and infer additional constraints. This is done by the _constraint solver_. This section will discuss the multiple aspects of constraints and their use. #uinfo[ Constraints in themselves are not a new concept. However, how they are applied to include more complex constraints, simulate circuits, and inferrence, does _appear_ to be novel. ] ==== Constraints for validation The primary use of constraints is for the validation of the code. The _constraint solver_ does this, as discussed later. The constraint solver will use the constraints to check whether they are compatible with one another. This is done by annotating some functions with constraints and then checking whether the input signals are compatible with those constraints. If the constraints are not compatible, a warning or an error can be presented to the user. Constraints can be of many types; the likely most common ones will be constraints on power, gain, wavelength, delay, and phase. The reason why delay and phase are different constraints is because they most often will have different semantics, where phase refers to the phase of the light within the waveguide, and the delay will mostly impact the delay of the modulated information on the signal. Since light operates at frequencies much higher than the @rf range, one can consider the phase of the light to be mostly decoupled from the signal's phase. These constraints can be used to verify the code's validity and inform the compiler how to optimise and generate the design. For example, the user might have a high-power signal coming onto the chip that gets split. The place-and-route system can either place the splitter close to the input, increasing mesh usage but reducing non-linearities, or closer to the components using this light, increasing mesh usage but decreasing non-linearities. One can use the input power constraint to make a decision since at high-power, there will be increased non-linearities and losses within the waveguide. Therefore, the place-and-route can use this information to decide where to place the splitter. This is just one example of how constraints inform the compilation system and can be used to optimise the design. ==== Constraints for simulation Additionally to the aforementioned constraints, one can also express constraints that are useful for simulation, such as noise sources, modulation inputs, etc. These constraints do not make sense for the compilation process as they are not actionable at compile time; however, they are actionable for creating more realistic, closer-to-physical simulations. These special constraints can be used for a variety of things and are in essence non-synthesisable, whereas the other constraints are synthesisable. These non-synthesisable constraints, can be coupled with synthesisable constraints to create a more realistic yet very inexpensive simulation. As will be discussed in @sec_intent_simulation, simulating circuits using constraints is extremely fast. And due to the integration of constraints within the language, as discussed in @sec_phos_constraints, makes them an inherent part of the user's design. This means that accurate, yet fast simulations are always available to the user. ==== Constraints for optimisation As previously mentioned, constraints can be used as indicators for stages within the synthesis process. Therefore, it stands to reason that constraints can be used to optimise the design. The compiler can use constraints to remove unnecessary components or to optimise the placement of said components. For example, a signal going through a filter might have a constraint on the wavelength, and the filter might also have a constraint on the wavelength. If the compiler can prove that the filter is not needed, it can remove the filter altogether. Alternatively, if it detects that there would be no signal left after the filter, it can remove the filter and all dependent components, simplifying the design. Additionally, the user might specify optimisation targets that the place-and-route may try to reach. These targets may relate to the mesh usage, non-linearities, or other metrics. The place-and-route can use these targets and constraints to optimise the design to the user's specifications. ==== Constraints as real-time feedback As discussed in @sec_detectors, power detectors on the chip can be used for monitoring purposes. These detectors are expected to be implicitly and automatically used most of the time through intrinsic components and their platform-specific implementation. However, it can be interesting to give access to these monitors to the user. This can be done by using constraints on the power and gain. These constraints can be used to check whether constraints on power and gain are respected while the device is running, notifying the user if they are not. This allows the user to add detection of erroneous events, such as the loss of an input or failure to meet gain requirements. This can be used to notify the user's control software of the error so that they may react appropriately to it. Indeed, through the use of detectors, and especially implicit detectors, the user may gain insight into the state of the device. ==== Categories of constraints Using the aforementioned sections, one can categorise constraints into three distinct categories: synthesisable constraints, which are used for real-time feedback, simulation constraints, which are used for simulation, and meta constraints, which are only used by the compiler. These three categories are not mutually exclusive: most constraints can be used by the compiler and for simulation, but some of them are only used for these purposes. Therefore, one can see all constraints as being a hierarchy that can be seen in @fig_constraint_hierarchy. It shows that all constraints are simulation constraints, some of which are meta constraints, and some of those are also synthesisable constraints. In @tab_constraint_types, the different types of constraints are listed along with their category and a short explanation. #ufigure( outline: [ Hierarchy of constraints. ], caption: [ Hierarchy of constraints, showing that all constraints are simulation constraints, within that are meta constraints within which are synthesisable constraints. ], kind: image, image( "../assets/drawio/constraint_hierarchy.svg", width: 40%, alt: "Shows three ellipsis contained within one another, the center one is annotated as \"Synthesisable\", the middle one as \"Simulation\", and the outer one as \"Meta\".", ), ) <fig_constraint_hierarchy> #pagebreak(weak: true) #ufigure( caption: [ Different constraints on signals along with their category and a short explanation. ], kind: table, )[ #table( columns: (2em, 0.2fr, 1fr), align: center + horizon, stroke: (x: none), table.header( [], smallcaps[Constraint], smallcaps[Description], ), table.cell(rowspan: 2, rotate(-90deg, box(width: 200pt)[#smallcaps[Synthesisable]])), smallcaps[Power], align( left, )[ Power constraints are used to specify the power of a signal. At runtime, it can check whether signals are present and within certain power budgets by using detectors. ], smallcaps[Gain], align( left, )[ Gain constraints are used to specify the gain created by a component. It can use detectors around a gain section to check whether a gain section is able to meet its parameters and to allow feedback control. ], table.cell(rowspan: 3, rotate(-90deg, box(width: 200pt)[#smallcaps[Meta]])), smallcaps[Wavelength], align( left, )[ Wavelength constraints are used to specify the wavelength content of a signal. This is used for the optimisation of filters and other wavelength-dependent components. ], smallcaps[Delay], align( left, )[ Delay constraints are used to specify the actual, minimum, or maximum delay of a signal. This can be used to meet delay requirements after place-and-route. ], smallcaps[Phase], align( left, )[ Phase constraints are used to specify the differential phase of a signal. This can be used to ensure that phase-sensitive circuits are able to work as intended. ], table.cell(rowspan: 2, rotate(-90deg, box(width: 200pt)[#smallcaps[Simulation]])), smallcaps[Noise], align( left, )[ Noise constraints are used to add noise to a signal. This can be used to simulate noise sources and to simulate the impact of noise on a device. ], smallcaps[Modulation], align(left)[ Modulation constraints are used to specify the modulation of a signal. ], ) ] <tab_constraint_types> ==== Constraints on values Expanding upon the concept of constraints further, adding constraints on values other than signals is possible. It can allow the user to set specific constraints, typically on numerical values, that can be used for two purposes. The first purpose is to allow the validation of values automatically without needing to write manual tests for values; this is often called a _precondition_. The second purpose, which is further explained in @sec_tunability_reconfigurability, is the ability to discover reconfigurable states that cannot be reached based on the constraints. This is an optimisation that can be done relatively easily by the compiler. ==== Constraint inference Constraints propagate through operations done in succession. Each intrinsic operation done on a signal adds its own constraints to the existing constraints. This allows the compiler to infer constraints on intermediary and output signals based on existing constraints and the constraints of the intrinsic operations. The compiler does this to allow the user to specify as few constraints as possible while still being able to infer the constraints on the signals. This feature is critical for the usability of the ecosystem, as it reduces the burden placed on the user of manually annotating their functions and signals with constraints. The constraints of entire functions can be computed and then summarised -- i.e. simplified and grouped together -- which simplifies the role of the simulator as it is simply using these simplified constraints and applying them to input spectrums and signals. This leads to a more efficient simulation which is much faster than traditional physical simulations. This is examined further in @sec_constraint_solver. ==== Constraint solver The solver is the tool that the compiler uses to summarise and check constraints. It will summarise the constraints on each signal such that it can easily be simulated, and it will verify that constraints are compatible. Additionally, in cases where the constraints depend on tunable values -- i.e. values that can be changed at runtime -- the solver can use a prover and the constraints on the tunable value to determine whether the constraints are compatible. This is done by using a prover such as _Z3_ @z3. However, this is a very computationally expensive process and must therefore, only be performed when necessary. The compiler will only use the prover when the constraints depend on tunable values. Therefore, one can see the constraint solver as a tool composed of two subsystems, the first one, computing and verifying constraints based on known data, it is simpler and faster, and the second one, computing and verifying constraints based on tunable values, it is more complex, relying instead on a prover. ==== Limitations of constraints There are, however limitations of the constraint system, most notably that, using the aforementioned constraint solver, constraints are limited to exclusively feedforward system. This is due to constraints being calculated one after the other, not allowing cyclic dependencies. And as discussed in @feedforward_approx, one can represent any recirculating circuit as a feedforward system. However, there is one necessary condition for this to hold: it _must_ be at a higher level of abstraction. When building the higher-level abstractions, this axiom cannot be assumed to be true, as the user is writing them at a lower level of abstraction. Therefore, the constraint system is limited in such cases, and the system must provide an "escape hatch" which allows the user to manually specify constraints at the edges of their abstractions, such that the compiler can use them outside of the abstraction while pausing constraint computation inside. When using this feature, the user can now express recirculating circuits easily by using the escape hatch to specify constraints on insufficient feedforward signals. #uconclusion[ Constraints can be used to validate signals, eliminate branches, and simulate the design. They are implemented using the constraint solver, combining constraints or using the _Z3_ prover to verify constraints @z3. However, they are limited to feedforward systems, and therefore an escape-hatch is needed to specify constraints on recirculating circuits. ] == Tunability & Reconfigurability <sec_tunability_reconfigurability> #udefinition[ *Tunability* is the ability to change the value of a parameter at runtime to impact the behaviour of the programmed device. ] Tunable values are values that can be interacted with, by the user, at runtime. They can be any non-signal value in the user's program, typically numerical values, that the user defines as being tunable values. These values can be seen as tuning knobs that the user can access at runtime to change their circuit's behaviour and implement their custom feedback loops. Tunable values can impact several parts of the design at once. For example, a single value may determine the centre frequency of operation of a bank of filters, all of them being tuned at once. This makes tunable values especially powerful as their impact can be propagated through the entire design. The core idea behind tunable values is that the user can now represent parts of the parameters of their design as runtime values that can be interacted with while keeping all of the derived values within the circuit code itself. This design aims to make hardware-software codesign easier and more productive. Instead of having the complex relationships between parameters expressed within the "software" part of hardware-software codesign, they can be directly expressed on what they impact: the "hardware" part. This makes the design process more intuitive and removes the potential for discrepancies between the hardware and the software. Additionally, the user should be able to name and access their tunable values by name within their code. This further improves the usability of the system, as it removes the need to maintain complex, error-prone tables of registers and their corresponding values. Instead, the user can address their tunable value naturally through its name, and the @hal can take care of the rest: translating these names and values into an appropriate set of registers and values. This means that the physical parameters of each element can be represented as natural parameters -- i.e. numerical values -- while the underlying hardware uses lower-level likely binary values and flags. This also improves the development experience of the device provider, as they can now integrate the code required to do data conversion within their platform-support package, further simplifying the development of new support packages. Furthermore, the use of constraints on values, such as explained in @sec_constraints, can be used by the compiler to further detect the need for reconfigurability automatically without additional user input. It can also be used to validate that when a tunable value is changed in the user's software, it meets its requirements, ensuring that the user cannot change the value to an invalid one, where the device might then operate in an undefined state. #udefinition[ *Reconfigurability* is the ability to change the topology of the device at runtime and, therefore its behaviour. ] Additionally, one of the most important functional requirements is the reconfigurability. Its goal is to allow the user to reconfigure the mesh -- or only parts of it -- while the device is running. This can be achieved in several ways, but the most natural way is to use branches within the code to determine the boundaries between reconfigurability regions. Then, through the use of tunable values, these regions can be automatically selected based on their value. However, this brings a set of difficult problems to solve, the first of which is the ability to determine whether a state is even reachable. However, this can be done using constraints; through the constraint solver for tunable constraints, one can verify which states are reachable and discard those unreachable. This is a powerful optimisation, as it greatly decreases the amount of states that need to be place-and-route, and, therefore, the amount of time needed to compile the mesh. Indeed, considering the following example, the user instantiates a mesh containing $64$ input signals and $64$ output signals. Each input signal can go into one of two filters based on branching. This, therefore, means that there are $2^64$ possible states. It can easily be understood that this is an intractable problem, as synthesising the project would be almost impossible. However, if the system can determine that only two states are reachable for each signal, this comes down to $128$ states, which is much more tractable. Therefore, one can see that there is an interest in reducing the number of states that need to be synthesised. One such way is by using the constraint solver to eliminate unreachable states. The second way is by finding subsets of the overall circuits that are independent of one another and, therefore, can be mostly synthesised in isolation. Neither of those two tasks is trivial, they can be seen as similar to the halting problem, which is undecidable, and therefore, it is desirable to let the user specify some of the state reduction manually, letting the user take care of parts of the more complex cases. One can draw a parallel between this and the use of the escape-hatch for constraints, as it is a similar concept, where the user can specify constraints manually at the edge of abstraction, while here, the user can specify how to reduce the number of states manually. However, limiting the maximum number of iterations, the recursion depth, or both can make the halting problem decidable. However, despite being decidable, it still incurs a high computational cost. Therefore, one can expect that state reduction will also be computationally expensive. In @fig_reconfigurability, one may see what reconfigurability might look like on a fictitious device, where based on an input variable, a simple boolean in this case, the device will use either of two meshes. Each state #link(<fig_reconfigurability>)[(a)] and #link(<fig_reconfigurability>)[(b)] represents a different mesh that implements a different filter. In this example, the user would have created a tunable boolean that they can set at runtime, and based on its value, the appropriate mesh will be selected. #ufigure( kind: image, outline: [ Example of reconfigurability on a fictitious device. ], caption: [ Example of reconfigurability on a fictitious device. Each state (a) and (b) represent a different filter. The second (b) filter has a longer ring and a higher @fsr than the first one (a). Squares of different colours represent photonic gates in different states: blue represents through gates, green represents cross gates, and yellow represents partial gates. The grey triangles represent optical ports. ], table( columns: 2, stroke: none, image( "../assets/drawio/reconf_ex_a.svg", alt: "Shows a photonic processor's mesh configured with a simple ring resonator filter.", width: 200pt, ), image( "../assets/drawio/reconf_ex_b.svg", alt: "Shows a photonic processor's mesh configured with a simple longer ring resonator filter.", width: 200pt, ), [(a)], [(b)], ), ) <fig_reconfigurability> #uconclusion[ Reconfigurability allows the user to create modular designs, where, at runtime, the user can select a different state to fit their needs. Reconfigurability is achieved through the branching of the code. The user can specify tunable values that are used to select the appropriate branch. The number of states is exponential but can be decreased using the constraint solver to remove unnecessary branches by finding independent mesh subsets and letting the user manually specify some of the state reduction. ] #pagebreak(weak: true) == Simulation <sec_intent_simulation> As previously discussed, the user must also be able to simulate their circuit. The traditional physical simulation approach is slow; therefore, finding solutions to make simulations faster may be desirable. As was discussed in @motivation, there is ongoing research in using @spice to simulate photonic circuits. Additionally, some of this work is being conducted at the @prg. One of the main advantages of this solution, as opposed to the one presented below, is that it allows for recirculating meshes. However, it is not as fast as the solution presented in this document, and therefore, it is not as well suited for the use case of this project. Additionally, the #gloss("spice")-based simulations may be able to incorporate more effects, such as the effects of the non-linearity of components, which may lead to more accurate simulations. Despite this, the user may not want a physically correct simulation. Instead, they may want a fast simulation representative of their circuit without all the physical hardware limitations. In essence, this is similar to simulations for electronic @hdl development, where the simulations are not physical yet are still representative. The simulation scheme that is suggested in this research is to use constraints to simulate the circuit. The idea is that the constraint solver can be used to summarise the constraints on each net. It can then be used to calculate analytically the value of each net and, therefore, the value of each signal. The main difference with other approaches is that this can be done very quickly with relatively simple code due to the relative simplicity of constraints. This simplicity improves the simulation's performance, as discussed in @sec_constraint_solver, but also decreases the work required to maintain and update this simulator as time goes on. In practice, simulations would be separated into two categories: time domain simulation, which takes one or more signals modulated onto carrier optical signals and simulates their processing and a frequency domain simulation which looks at the frequency and phase response of the device. The reasoning behind this separation is as follows: due to the extremely high frequency of light, accurately representing light in the time domain is extremely difficult, as it requires very small time steps. Instead, if using the frequency domain, one can decouple the modulated signals by using the spectral envelope of the modulated signal as the input to the simulation. This, therefore, allows for easy analysis of the spectral performance without the computation cost of small timesteps. Then, in the time domain, the user specifies sets of wavelengths which are then modulated with the signal of interest, which can be passed through the device. This allows time domain simulation to use much bigger time steps on the modulating signal's period rather than timesteps on the light's period. However, this introduces a limitation; due to this dichotomy, the user must simulate both effects separately and analyse the results. While this makes the simulation process more limited, it also makes it more flexible, as if the user only needs one of the simulation kinds, they can avoid needing to simulate the other, decreasing computation time further. ==== Simulation ecosystem There exist many tools for the simulation of photonic circuits. Additionally, there also exist a lot of tools for the kind of resolution that is being done. It is, therefore, of interest to reuse as many existing tools as possible. As long as these tools are free, they do not incur a cost on the user's end. Additionally, by reusing existing tools, the user can benefit the ecosystem surrounding these solutions and the community using them. Furthermore, it also simplifies the simulation ecosystem's development, as it no longer requires writing the entire simulation ecosystem from scratch. Instead, reusing existing tools and using the best-in-class tools for each task. == Platform independence <sec_platform_independence> As the development of photonic processors continues, new devices must be expected to bring new features, different hardware programming interfaces, and characteristics. Ideally, all of the code would be backward and forward compatible, being able to be programmed on an older or a newer device with little to no adjustments. Therefore, one must plan for platform support right at the core of the design of a photonic processor ecosystem. In this document, several approaches will be suggested for tackling this issue. These approaches are meant to be used in conjunction with each other. ==== Standard library All platforms must share a common standard library containing base building blocks and more advanced synthesis tools -- i.e., filter synthesis -- that is common across all devices. This library must be able to be used by all devices. Therefore, it must be able to be compiled into the intrinsic operations mentioned in @sec_intrinsic_operations. Additionally, providing common building blocks and abstraction makes developing circuits targetting photonic processors easier. This is similar to the standard library for regular software development, where the language provides a set of functionalities out-of-the-box that the user can use. ==== Platform support packages Each platform must come with a platform-support package that implements several tools: a hardware programmer for programming the circuit onto the device; a compatibility layer for the standard library such that the standard library is compatible with the hardware; some device-specific libraries for additional features if needed; a place-and-route implementation, it may be shared across many devices, but the support package must at least list compatible place-and-route implementations. With these components, the user's circuit should be able to be compiled while using the standard library and then programmed onto the device for a working circuit. ==== Hardware abstraction layer Each platform must come with a @hal which allows the user to interact with the device programmatically at runtime. This @hal must provide features for communicating, setting tunable components and reading the state of the device. The @hal can be reused across devices as long as the devices have similar hardware interfaces. In @sec_hal, this will be further discussed, including how parts of the @hal can be generated based on the user's design for improved usability and easier hardware-software codesign. ==== Constraint packages It must also come with information regarding delays and phase response of its different components, as well as the capabilities of some of its components like amplifiers, modulators, etc. This information can be used by the constraint solver and the simulation ecosystem to more accurately represent the capabilities of the circuit and allow the user to make informed decisions. Additionally, a platform may come with additional simulation-specific constraints for more accurate simulations and the additional information provided by the constraint packages. == Visualisation <sec_visualisation> Several types of simulations may be useful for the user: the user might want to visualise the generated circuit mesh superimposed onto a schematic representation of the device to verify that no critical components were removed through constraints, to see the usage at a glance, or to visualise whether the place-and-route performed adequately. This visualisation is already presented in the existing library and exists in @eda tools for photonics. Therefore, such visualisation facilities must be offered to the user. Mainly due to the fairly early research stage, the ability to communicate results visually is critical to the user's understanding of the results. Another kind of visualisation the user will want is the simulation results. Therefore, the ecosystem must provide easy visualisation of results. ==== Applying @dry As is the case of the simulation ecosystem, one can reuse existing tools and libraries for visualisation that are already on the market. This applies the #gloss("dry", long: true) principles, where one can reuse existing tools and libraries rather than rewriting them from scratch. This also allows the user to benefit from the large ecosystem of existing visualisation tools and to use the tools they are most familiar with or that give the best results for their application. Examples of such visualisations can be seen in @fig_reconfigurability, which shows the mesh and the state of each gate, and a simulation result in @fig_simulation_result_example, which shows the results of a time-domain simulation using the aforementioned constraint solver. #ufigure( kind: image, outline: [ Example visualisation of a time-domain simulation result. ], caption: [ Example visualisation of a time-domain simulation result, showing a $10 "Gb/s"$ modulated @prbs $15$ sequence on top of a $1550 "nm"$ carrier. The simulation was performed using the constraint solver. Shown is a $10 "ns"$ window of the simulation. The simulation was run for a total of $1 "µs"$ with an average execution time of $9 "ms"$. The simulation simulates a laser source with noise and the rise and fall time of the modulated signal, the rise and fall time being $50 "ps"$. ], image( "../assets/simu_example.svg", alt: "Shows the startup of a 10Gb/s modulated optical signal with noise, rise and fall time.", width: 100%, ), )<fig_simulation_result_example> == Calibration and variation mitigations <sec_calibration_and_variation_mitigations> Photonic circuits can be susceptible to manufacturing variations and temperature variations. Therefore, each device must come with mitigation techniques that can aid in making the device behave as ideally as possible. This is expected to generally be done using calibration curves or calibration @lut[s]. And by using feedback loops to ensure that a component behaves as expected. For example, a power combiner might maximise power output using a feedback loop on a phase shifter to create constructive interference. ==== Feedback loops Feedback loops are essential to overcoming variations, especially those caused by temperature variations. A feedback loop can read a power monitor on the chip and adjust the tunable value of another element. Feedback loops can be built-in, as in added automatically by the compiler for specific tasks, based on the device support package and the intrinsics being used. Or they can be created manually by the user, in which case they must write code that, using the @hal, reads the sensors and then writes to whichever tunable value they need. ==== Wavelength dependence Additionally, to manufacturing variability and temperature dependence, the device's response is also wavelength dependent. This is due to the physical properties of the materials from which the device is made of. Hence there are no easy ways of mitigating these effects. However, by using constraints, the compiler can know which wavelengths are expected in which component, and similarly to using calibration curves for device-to-device variability, it can use similar response curves to adjust the circuit to the expected wavelength. This is expected to be done automatically by the compiler, but it requires that the user specifies wavelength constraints. == Resource management Another aspect of designing circuits for programmable devices, whether they be traditional processors, @fpga[s] or photonic processors, is resource management. A limited number of elements are built into the hardware, and the user must be able to use these elements as efficiently as possible. This may be especially true for photonic processors where the number of gates is currently relatively small. Below is @tab_resources, which lists potential resources that may be present on the device. These resources are obtained from the description of intrinsic values in @sec_intrinsic_operations and the components of a photonic processor detailed in @photonic_processor. #ufigure( caption: [ List of device resources and their description. ], kind: table, table( columns: (auto, 1fr), align: center + horizon, stroke: (x: none), table.header( smallcaps[*Resource*], smallcaps[*Description*], ), smallcaps[*Photonic gate*], align( left, )[ The photonic gate is the core element of the photonic processor; it can be arranged in a grid, whether square, triangular or hexagonal. It generally contains a 2-by-2 tunable coupler and power detectors for monitoring. It is used to process the light and to route the light around the chip. ], smallcaps[*High-speed detector*], align( left, )[ High-speed detectors are used to demodulate the light; they can operate either in an amplitude demodulation scheme or be used with interference to perform phase demodulation. ], smallcaps[*High-speed modulator*], align( left, )[ High-speed modulators are used to modulate the light; they can operate either in a phase modulation scheme or be used with a @mzi to perform amplitude modulation. ], smallcaps[*Laser source*], align( left, )[ Laser sources are used to generate light at a given wavelength directly inside the device. Due to the devices being made in silicon, there are none on existing prototypes. However, they may be added using epitaxial growth or micro-transfer printing. ], smallcaps[*Gain section*], align( left, )[ Gain sections are used to amplify the light, generally made of a semiconductor optical amplifier or an erbium-doped waveguide section. As with laser sources, there are currently no gain sections on prototypes. ], smallcaps[*Optical port*], align( left, )[ These ports at the edge of the device can be used to couple light in and out of the device. ], smallcaps[*Switch*], align( left, )[ Switches can be either implemented using the mesh and couplers, using a power splitter with its coupling coefficient controlled by a tunable value, or built into the device as dedicated hardware. There are no dedicated hardware switches, but they may be added in future devices. ], ), ) <tab_resources> #pagebreak(weak: true) == Responsibilities and duties #ufigure( outline: [ Responsibilities of each actor in the ecosystem. ], caption: [ The responsibilities of each actor in the ecosystem, elements in orange, are the responsibility of the ecosystem developer. It includes the compiler, constraint solver and standard library. It also contains parts of the @hal generator. The elements in blue are the responsibility of the chip designer. It includes the device itself, the core @hal, and the device support package. Elements in green are the responsibility of the user. This includes the user's design and the user's control software. It also shows the different components of the ecosystem that have been discussed so far and their overall interaction with one another. ], image("../assets/drawio/responsibilities.png"), ) <fig_responsibilities> As with most ecosystems, the responsibilities for the development of different parts and the duties of maintaining these parts are split between different actors. In this case, one can see the ecosystem being designed in this thesis as having four actors: the user who is responsible for the design of their circuit, their own control software, the maintenance of their code, and the compatibility of this code with the ecosystem. The second actor is the developer of the ecosystem itself, their responsibility is spread among several tasks, from the programming ecosystem components discussed in @sec_programming_photonic_processors, to the standard library, and the constraint solver. Due to the critical importance of these tools, the duties of maintaining some degree of backward and forward compatibility along with making sure that the tools are as bug-free as possible falls on the ecosystem developer. The third actor is the chip provider, they design the actual physical layer: the photonic processor. Because of this, they must also produce the device support package and the core @hal. Their responsibilities are to ensure that their device is compatible with the common parts of the ecosystem, that their devices can work in expected use scenarios, and to provide the @hal generator. The fourth and final actor are all of the external tool provider, those can be libraries developers, @eda tool developers, etc. Most of the time, their projects' licenses will remove any and all responsibilities from their user. Therefore, special care must be taken when integrating external tools and libraries so that trustworthy actors maintain them. A summary of these responsibilities and their interactions with one another can be seen in @fig_responsibilities.
https://github.com/Tyrn/wei
https://raw.githubusercontent.com/Tyrn/wei/master/sandbox.typ
typst
#import "robinson-pip.typ": part, chapter, formatDoc #show: doc => formatDoc(doc) #set text(lang: "ru") #set par(first-line-indent: 1em, justify: true) #set text(hyphenate: true) #place(center + horizon, dy: -10em)[ #text(size: 25pt)[ Сто полей ] #text(size: 15pt)[ Юли<NAME> ] ] #pagebreak() // #[ // #set align(center) // #text(size: 25pt)[ // Acknowledgments // ] // // #set align(center) // // I just wanted to take a moment to express my deepest gratitude to each and every one of you. // ] // #pagebreak() // start numbering from this point onwards #set page(numbering: "1") #outline() #pagebreak() = Часть первая. СТРАНА ЛОЖНЫХ ИМЕН #part("Часть первая")[Cтрана ложных имен] == Глава ПЕРВАЯ, #chapter("Глава первая,")[в которой не происходит ничего, кроме катастрофы.] К<NAME> вовсе не собирался открывать новую планету. Получилось это чисто случайно. У Серого Пятна за его кораблем погнались двое пиратов с фальшивыми опознавательными знаками Порте-Кассино, даже не пиратов, если говорить честно, а отощавших обывателей Ньютоны. Планету недавно вышибли из ООН за несоблюдение прав человека, отчего местный диктатор, хоть и не перестал расстреливать собственных болтунов, однако совсем перестал преследовать собственных бандитов. Если бы у Ванвейлена был хороший корабль и надежный экипаж, он бы подождал эти катера и популярно, с помощью бортовых лазеров, разъяснил им международное право,~---~но у Ванвейлена был этакий грузовой бочонок с подтекавшими стабилизаторами, на котором он вез на Эркон геофизическое оборудование и прилагаемого к оборудованию геофизика по имени Сайлас Бредшо, скромного молодого человека с застенчивыми манерами и глазами черными, как донышко пусковой шахты. Бредшо, был нежен, тих, слюняв, и во время погрузки так хлопотал над запечатанными контейнерами, словно его буровые вышки были собраны из лепесков гортензии. Ванвейлену подумал, что если его пассажир запсихует и доложит в порту назначения о незарегестрированных средствах защиты на борту, то у Ванвейлена опять отберут лицензию и еще, пожалуй, конфискуют это старое корыто, и эта мысль ему не очень-то пришлась по душе. Тут два катера вздыбились и превратились в два широких синих плевка длиной, с точки зрения приборов, в семь тысяч километров,~---~Ванвейлен врезал по панели управления и ушел в подпространство, не утруждая компьютер координатами выхода. Когда дельта-поле вновь собрало корабль в одном месте, на экранах сияла неведомая Ванвейлену россыпь звезд, а чуть справа по курсу, как одинокая елочная игрушка, висел серебристо-синий шар, важно подставлявший затянутый облаками бок небольшому желтому солнцу. Даже невооруженным глазом можно было заподозрить, что атмосфера на важном шаре~---~земного типа, и это было редкой удачей. Весь экипаж, в количестве шести человек, сбежался в рубку, и пассажир Бредшо, подскакивая от восторга, потребовал подойти к планете. Через полчаса грузовик вынырнул из гиперпространства в трехстах пятидесяти километрах от поверхности планеты. Внизу был океан с шельфовой нефтью, потом горы, магнитная аномалия, потом облака и в разрыве~---~вечерняя степь с антилопами. Корабль вошел в ночную тень над затянутым облаками материком. ---~А это что?~---~спросил Бредшо, вдруг ткнув пальцем в синюю линию на экране анализатора. Ванвейлен изумленно на него оглянулся. "А геофизик-то мой ничего не смыслит в геофизике!"~---~вдруг пронеслось в его голове. И тут корабль словно сгребло клешней и потянуло вниз, к темным и жирным, как свиной фарш, облакам. ---~Какого черта,~---~выругался Ванвейлен. Из облаков выскочила нехорошая тень, слева распустился серебристый цветок и тут же превратился в гиганскую круглую воронку всех цветов радуги. ---~Это нападение!~---~закричал в соседнем кресле Макнейл. Корабль въехал носом в одну из воронок и стал кувыркаться. Глаза индикаторов пучились и лезли из орбит. Клод Ванвейлен бегал пальцами по пульту управления~---~клавиши вдавливались с бесчувственным резиновым звуком. ---~Сбрасывайтесь,~---~заорал не своим голосом Бредшо. Ванвейлен на мгновение оглянулся: геофизик сидел весь зеленые, и глаза у него от ужаса были большие, как дисковые антенны. ---~Сиди смирно,~---~зашипел Ванвейлен. Корабль тряхнуло еще раз, радужные зайчики запрыгали по стенам и приборам, изображение грузовых отсеков на экране вдруг полыхнуло красным,~---~и~---~до Ванвейлена дошло, что он вез. ---~Бросайте груз,~---~опять заверещал Бредшо. Что Ванвейлен и сделал. Корабль стал делиться, как созревшая амеба. Грузовые отсеки уходили вниз, ракетоплан с аварийным запасом топлива~---~на запад. Радужные воронки теперь вспыхивали далеко сзади, и издалека казалось, что кто-то пытается поймать в разноцветный гигантский сачок стальную бабочку в пять тысяч тонн весом. На ракетоплан этот кто-то не обращал внимания. Ванвейлен рвал пломбы с системы аварийного управления. Капсула слушалась с трудом. Выскочил и лопнул парашют, за ним другой. Берег материка, размытый инфракрасным светом, пропал на востоке. Капсула шла над морем, теряя высоту быстрее, чем скорость: четыре тысячи метров, две тысячи метров, полторы тысячи метров... Далеко впереди вновь возник берег, изрядный остров, горные леса, обрывавшиеся у ледников. Восемьсот метров. Рули высоты как под наркозом. Топливный индикатор помаргивал, когда ракетоплан попадал в воздушные ямы. Берег был уже внизу. Ванвейлен с трудом разворачивал машину. Датчики визжали, как побитая собака, что-то радостно пело в системе подачи топлива. Ракетоплан развернулся и пошел нырять над ночным берегом, обросшим лесом и изжеванном когда-то ледниками. Пятьсот метров. Под крылом ракетоплана мелькнул и пропал ночной город. Паучьи ножки улиц сбегались к пристани и площади. "Экий космодром для народных собраний",~---~подумал Ванвейлен. В темном лесу мелькнула одна плешь, другая. Ракетоплан цеплялся брюхом за деревья. "Сейчас или никогда",~---~подумал Ванвейлен, аккуратно управляясь с приборами. Дрожь прошла по кораблю, датчики нехорошо проорали и смолкли. Что-то ухало и ворочалось в системе охлаждения, едкий дым пополз было из-под панелей, но сгинул в вентиляционных шахтах. Капсула сидела посреди проплешины в темном лесу и тихо шипела. Ванвейлен повернулся к Бредшо и тоном, не предвещавшим ничего хорошего, осведомился: ---~Ну, что у вас там было? Плазменные гранаты? Бредшо виновато мигал. ---~Ясное дело,~---~сказал кто-то из экипажа,~---~гремучка у него в контейнерах, вот он и испугался. ---~Геофизики,~---~процедил Ванвейлен,~---~чтоб вас с вашей борьбой за демократию... Всю галактику засморкали. ---~А вас это не касается,~---~огрызнулся Бредшо,~---~вас нагрузили, вы и везите. ---~Меня это очень касается,~---~возразил Ванвейлен,~---~потому что импорт бурового оборудования стоит одну цену, а импорт демократии стоит совсем другую цену. ---~А они экономят.~---~сказал кто-то.~---~Им Федеральный Сенат снизил ассигнования на зарубежную демократию. Бредшо, из-за кожуха накопителя, виновато блестел глазами. ---~Это была ракетная атака,~---~сказал он,~---~Боеголовки типа "Фавилла". Если бы они попали в корабль, от нас бы даже соплей не осталось. Ванвейлен изумился. Это же надо,~---~спутать искровые боеголовки с радужными воронками мезонных бомб! Ну и слюнявых же специалистов готовят Они на наши налоги! ---~Не попали же,~---~сказал Ванвейлен, и ткнул пальцем в оранжевый индикатор слева от бокового экрана. Индикатор, указывавший на состояние грузовых отсеков, мирно помаргивал, как бы удивляясь: "И чего вы меня оставили?" ---~Точно не попали? ---~Точно,~---~рассердился Ванвейлен,~---~и теперь, пожалуйста, корабль там, а мы тут. Две тысячи километров, и еще триста. ---~Можно добраться,~---~неуверенно сказал Бредшо. ---~Ага. Вот только местной валюты нет, заказать билеты на ближайший авиарейс. ---~Это была не ракетная атака,~---~сказал один из экипажа, Хатчинсон,~---~это была магнитная ловушка. Я однажды возил контрабанду на Геру и попал в точно такую,~---~если корабль не имеет опознавательного сигнала, его тащит вниз... ---~Ребята, вы что, взбесились,~---~сказал бортинженер.~---~Это был лазер. Экран же был весь серебряный. Ванвейлен почувствовал некоторую дрожь в руках. Радужные воронки еще стояли у него в глазах. Радужные воронки бывают только у мезонных ракет, взрывающихся в атмосфере, типа "агаты", под которую он попался под "Вегой-20". ---~Есть еще мнения?~---~осведомился Ванвейлен.~---~Вы что видели, Джеймс? У Джеймса Макриджа глаза были виноватые и странные. ---~Я,~---~откашлялся он,~---~знаете, я вчера фильм смотрел, по СВ, с танками,~---~и вот мне показалось, что что на нас едет такой серый танк с броней высшей защиты. ---~Так,~---~сказал Ванвейлен,~---~значит, на нас в стратосфере наехал танк. Вероятно, архангелы проводили тактические учения. Василиска, дракона, и упыря с минометом никто не видел? Но василиска не видел никто. Может быть, потому, что по СВ в последнее время не показывали фильмов с василиском в качестве центрального персонажа. Тогда Ванвейлен переключил компьютер на воспроизведение и затребовал данные получасовой давности. Экран осветился нежным зеленым светом, и Ванвейлен несколько прибалдел. Судя по данным компьютера, их вообще никто не атаковал. Судя по данным компьютера, корабль сам пошел вниз, а потом закувыркался в стратосфере, подчиняясь довольно дурацким, но все же выполнимым приказам центрального блока... "Ого-го,~---~заплясало в голове Ванвейлена,~---~это что же? Это значит, кто-то на том материке взял управление кораблем на себя, разобрался за пару мгновений и взял? Хотя постойте, а головы наши? Управление нашими головами он тоже взял на себя? Ведь каждый видел, черт побери, разное! Это ведь привидения можно видеть по-разному, а принять мезонную ракету за магнитую ловушку... Лучше бы я долбанул этих пиратов... Скверное это дело~---~быть подбитым мезонной ракетой, но быть подбитым призраком мезонной ракеты~---~нет уж, увольте от знакомства с такой цивилизацией... В этот миг что-то клюнуло в прозрачную оболочку. Ванвейлен включил наружное освещение и увидел, что из черных кустов в корабль сыплются раздвоенные стрелы с белыми перышками. У местного населения, судя по всему, неизвестных противоракетных систем не было. На рассвете выяснилось: корабль сел на огород с бататами. Совладельцы огорода скрылись в лесу, оставив у столба в круглом поселке обильную снедь, пальмовое вино и привязанную девушку. == Глава ВТОРАЯ, #chapter("Глава вторая,")[в которой оказывается, что Страна Великого Света лежит и на востоке, и на западе, и на севере, и на юге, однако непременно по ту сторону горизонта.] В эту пору в Горном Варнарайне, в усадьбе Золотой Улей жил человек по имени Шодом Опоссум. Он был один из самых рассудительных людей в округе, и многие обращались к нему за советом и поддержкой. Этой весной пришла пора выдавать замуж его младшую дочь. Шодом решил добыть побольше мехов перед приходом храмовых торговцев, снарядил три больших лодки и поехал грабить деревню Лисий-Нос, принадлежавшую Коротконосому Махуду, его давнему врагу. Все вышло как нельзя лучше, а еще Шодом навестил храм матери зверей, стены сжег, а украшения и прочее взял себе. На обратном пути Шодом остановился в усадьбе Птичий Лог, и хозяйка сказала ему, что рыбаки, ездившие к Темному острову за черепахами, видели там на мели разбитый корабль, точь-в-точь как корабли предков на скалах. ---~Кто там был, люди или покойники, неизвестно,~---~сказала хозяйка,~---~но их было не больше семи и держались они смирно. Дружинник Шодома, <NAME>, сказал ему: ---~Если это покойники, какой смысл с ними драться? Все равно навье золото, если его взять силой, обернется углем и грязью. ---~Можешь остаться,~---~говорит Шодом Опоссум. ---~Я не останусь,~---~говорит Арнут Песчанка,~---~однако я вижу, что поездка эта добра не принесет. Через некоторое время Шодом вышел по малой нужде и оставил в сенях секиру. Возвращается~---~а с секиры капает кровь. Шодом стал ее вытирать, а железо течет, течет, словно женщина в месячные. Тогда Шодом пихнул секиру под лавку, чтобы никто не заметил, и вернулся на свое место. Хозяйка, однако, увидела, что он стал рассеян, усмехнулась и сказала: ---~Вряд ли тебе, Шодом Опоссум, этот корабль по зубам, потому что три дня назад здесь проехал Марбод Кукушонок. А теперь он стоит у Песчаного Вала, и ходят слухи, что он решил с этим кораблем не связываться. Тогда Шодом Опоссум сказал: ---~Марбод Кукушонок своей храбростью торгует за деньги, вот она у него и кончилась. И наутро выехал к Темному острову. А женщина проводила его и вернулась во двор. Слышит~---~собаки подняли страшный лай. Вот она входит во двор, и видит, что это лают не ее собаки, а посреди двора бьются пернатый Вей и рыцарь Алом, и собаки лают и визжат с пластины на панцире Алома, и еще клекочет кречет с лезвия секиры. Но тут Вей взмахнул плащом из птичьих перьев, в точности таким, какие рисуют на людях Великого Света на скалах,~---~перья посыпались с плаща, превратились в голубые мечи и оранжевые цепы, бросились на собак и стали их мять и трепать, так что кишки разлетелись от угла до угла. Рыцарь взмахнул рогатым копьем и затрубил в рог: наваждение сгинуло, голубые мечи полетели на землю простыми листьями с золотыми кистями, собаки стали рвать бумагу... == Глава ТРЕТЬЯ, #chapter("Глава третья,")[в которой повествуется о родословной Белых Кречетов и о зимних походах короля.] То, чего не мог добиться Марбод с помощью пыток, Ванвейлен достиг тщательным обследованием городских развалин, расположенных в миле от замка. Разрушенные дома поросли павиликой и уже вековыми деревьями, и место напоминало сказочный город, превращенный волшебником в лес. Детектор распознал у западной стены большую карстовую пещеру, и Ванвейлену, слишком хорошо помнившему дотошность, с которой плетка Марбода доправшивала относительно "стеклянной горы" всех, кто под эту плетку попадался, сразу нарисовалась дивная картина подземного храма, где жители осажденного города спрятали два века назад свое имущество. Ванвейлен облазал скалы и сверху и снизу и убедился, что никакого прохода в пещеру нет, за исключением,~---~сколько можно было судить по неровной картинке на экране,~---~узкой рубленой шахты, терявшейся наверху скалы среди раскрошенных людьми и корнями развалин. Вероятно, это были развалины того самого храма, который "ушел под землю". Бредшо уговаривал его не жадничать,~---~слишком много любопытных глаз было вокруг, и самые любопытные, бесспорно, принадлежали храмовому торговцу Адрамету. Если большинство местных считало людей с корабля колдунами, то отец Адрамет сам был колдуном и шарлатаном, и, в качестве такового, ни в какое колдовство не верил. Ванвейлен согласился с ним. В тот же день вечером, запершись в горнице, Ванвейлен распотрошил пару патронов из минного пистолета и преобразовал их в безоболочное взрывное устройство в 500 грамм тротилового эквивалента. Вместо взрывателя Ванвейлен воспользовался сушеной веревкой из местных водорослей, пропитанной гусиным жиром,~---~необыкновенные характеристики этой веревки Ванвейлен успел отметить на деревенском празднике, где с помощью веревки заставляли "бегать огонь по земле". Все это хозяйство он сложил в самую обыкновенную долбленую тыкву и вечером зарыл в развалинах храма, вывесив наружу хвостик, рассчитанный на три часа горения. Лавины в горах весной случаются часто, и поэтому никто во время ночного пира не обратил внимание на взрыв: только Бредшо укоризненно посмотрел на Ванвейлена, да Белый Эльсил заметил, что, кажется, старая Мирг опять вздумала топать ногами, и что ничего хорошего не бывает после того, как старая Мирг топнет ногой. А вечером, после пира, <NAME> отозвал Марбода в сторону и сказал: ---~Сдается мне, Марбод, что этот Ванвейлен нашел стеклянную гору под самыми нашими ногами, потому что вчера он искал в замке веревку и лопату. И еще думается мне, что он умеет видеть в темноте, потому что он искал лопату, а факелов не искал. Утром Ванвейлен дождался, пока гости и хозяева уедут на охоту, подхватил мешок с заготовленным снаряжением, и пошел к старому городу. Это утро было то самое утро, когда весна, в облике оленя, гуляет среди почек и ростков. Марбод Кукушонок, <NAME> и еще некоторые отправились на соколиную охоту встречать весну. По дороге всадникам встретилась кучка крестьян: те замахали шапками и попадали на колени перед Кукушонком, называя его Ятуном, но на своем языке. Лух Медведь обратил на это внимание благородных господ. Кукушонок побледнел, но промолчал. Лух Медведь был первым силачом округи и женихом дочери хозяина, прекрасной Идрис. Накануне он опять проиграл Марбоду игру в кольцо, и невеста на его глазах распорола шелковый копейный значок, который вышивала два месяца. Съехались к старому городу, где в дуплах развалин много было птиц. Весеннее солнце, лед на лужицах, боевые веера, крики дам, льдинки на земле, как пластины панцирей, и панцири поверх кафтанов, как драконья чешуя. Пух перепелов летел как перья Великого Вея, заклеванного противником,~---~скоро прорастет просом. Всех удачливей были две птицы: сизый, с темными усами по бокам сапсан, принадлежащий Луху Медведю, и великолепный белый кречет Марбода Кукушонка. Марбод получил от герцога трех птиц. Одного оставил себе, другого отдал за убийство Ферла Зимородка, а третий сдох месяц назад, и Марбод тогда два дня пролежал, накрывшись с головой одеялом. Боевой друг Марбода, Белый Эльсил, высмотрел на тропке следы лошади, и сказал: ---~Никак это отпечатки Жемчужной Пяди, той, которую ты, Марбод, подарил чужеземцу. Сдается мне, что он поперся в стеклянную гору, и как бы он не сломал свою шею. Марбод возразил, что этот человек колдун, и шею ему сломать трудно. ---~Я же не говорю, что он сломает шею в горе,~---~отвечал Эльсил,~---~а я говорю, что он свалится с лошади, потому что на лошади он ездит хуже хомяка. ---~Да,~---~сказала задумчиво прекрасная Идрис, гладя сизого ястреба-перепелятника,~---~живой человек в стеклянный дворец не полезет. Мой дед полез, но сошел с ума. ---~Рассказывают, Марбод Кречет в Золотую Гору лазил. Лух Медведь сказал преувеличенно громко: ---~Так то рассказывают. Через некоторое время Кукушонок незаметно исчез. ---~Сдается мне,~---~сказал один из людей Луха хозяину,~---~что Кукушонок принял близко к сердцу ваши слова. Лух подумал: "Не мне жалеть, если он пропадет в стеклянной горе, да и басни все это, нету тут никакой дырки на небо". Охотники, однако, поскакали к старой катальпе. x x x Ванвейлен закрепил веревку за ствол ближайшего эвкалипта, осторожно съехал в дыру и посветил фонариком. Как он и предполагал, взрыв пробил каменный свод пещеры,~---~далеко вниз уходила черная лестница, засыпанная грудами сверкающих кристаллов. Вдруг веревка закачалась и отошла от стены. ---~В стеклянный дворец хотите? Ванвейлен ошеломленно поднял голову. Наверху стоял Марбод Кукушонок и правой рукой держал веревку, на которой качался Ванвейлен. За спиной колчан, в колчане стрелы с белой соколиной опушкой торчком над головой, и посреди стрел~---~живой кречет. Птица топорщила крылья, гулькала. Ванвейлену не очень-то понравилось висеть на веревке в руках Кукушонка. = Часть вторая. СТРАНА ВЕЛИКОГО СВЕТА #part("Часть вторая")[Страна Великого Света] == <NAME>, #chapter("Глава первая,")[где повествуется о том, как контрабандист Клиса испугался бочки, проехавшей в небесах.] В последний предрассветный час дня Нишак второй половины четвертого месяца, в час, когда по земле бродят лишь браконьеры, колдуны и покойники, когда по маслу в серебряной плошке можно прочесть судьбу дня, белая звезда прорезала небо над посадом Небесных Кузнецов, и от падения ее тяжело вздохнула земля и закачались рисовые колосья. Неподалеку, в урочище Козий-Гребень, общинник из Погребиц, Клиса выпустил мешок с контрабандной солью и повалился ничком перед бочкой, проехавшей в небесах, как перед чиновником, помчавшимся по государеву тракту. Лодку у берега подбросило, мешки с солью посыпались в воду, а Клиса с ужасом вскочил и бросился их вытаскивать. Жена его села на землю и тихо запричитала, что в Небесной Управе наконец увидели, как семья обманывает государство. Клиса был с ее мнением согласен ---~но не пропадать же соли. Третий соумышленник, Хайша из далекого пограничного села, слетел было с высокой сосны, облюбованной контрабандистами для наблюдения, но зацепился напоследок за ветку и теперь слезал на землю. ---~Дура ты,~---~возразил он женщине,~---~это не по нашу душу, а по Белых Кузнецов. Прямо в их посад и свалилось. И то, давно пора разобраться, отчего это у них конопля растет лучше нашей? Белых Кузнецов в округе не любили. Те крали духов урожая по соседним деревням и занимались на своих радениях свальным грехом. Притом после бунта им последовали от экзарха всяческие поблажки, чтобы не сердились опять. Судьи боялись с ними связываться, и даже был такой случай: во дворце экзарха, говорят, оборотень-барсук портил служанок; его поймали в кувшин, а он как крикнет: "Я~---~посадский!" Но тут уж барсуку не поверили и утопили его. x x x Многие в посаде проснулись от страшного грохота. <NAME> встала с постели, вышла в сени и увидела во дворе целую толпу мертвецов. Это ей не очень-то понравилось. Она нашарила в рундуке секиру с серебряной рукоятью, растолкала старосту Маршерда, пихнула ему секиру в руки и сказала: ---~Там во дворе стоит Бажар и целая свора из тех, за кого мы не отомстили, и по-моему, они пришли за этой штукой. Маршерд поглядел в окно: а на окне была кружевная занавеска, и дальше бумажные обои: кувшинчик~---~букет, кувшинчик~---~букет. Ну что твой гобелен во дворце наместника! Маршерд поглядел на эти обои и сказал, что никуда до утра не пойдет, потому что ночь~---~время ложных духов. == Глава ВТОРАЯ, #chapter("Глава вторая,")[где рассказывается о событиях, произошедших на самой границе ойкумены, где даже время течет по-другому, нежели в центре, и один день службы считается за три.] Прошло две недели: наступил первый пень Шуюн. Два события произошло в этот день: экзарх Варнарайна, наследник престола, вступил в центр мира, в Небесный Город: бродили по улицам самодвижущиеся черепахи, спустились с неба боги, подобные мудрым словам указов. В этот же день караван храмового торговца Даттама пересек реку о четырех течениях, принес положенные жертвы и остановился у узлов и линий девятой заставы. И было это на самой границе ойкумены, где горы стоят на полпути к небу, где летом бывают метели и где даже время течет по-другому, и один день службы засчитывается за три. Люди из каравана и охрана заставы сварили в котле быка, накормили богов запахом, а мясо съели сами. Люди из каравана рассказали людям с заставы о том, что случилось на Весеннем Совете: и как король сначала объявил войну экзарху Харсоме, а через день признал себя его вассалом, и как заросла в храме трещина, прошедшая через сердце Золотого Государя, и как гнев Золотого Государя уничтожил город Ламассу, вознамерившийся противиться стране Великого Света, и как советник Арфарра и советник <NAME> убили Марбода Кукушонка, и многое другое, столь же поучительное. ---~Так что же?~---~сказал один из стражников.~---~Мы уже и не застава? Была гора на краю мира, стала Государева Гора в центре провинции? Господин Гайсин, начальник заставы, встретил караван в великом смущении. x x x Три года назад господин Гайсин надзирал за гончарным производством. Как-то раз секретарь Бариша принес экзарху его отчет и расставил везде красные галочки. ---~Этот человек жаден и очень неумен,~---~сказал экзарх. Бариша возразил: ---~Все берут. Его накажешь~---~другие встревожатся. Экзарх сказал: ---~Это неважно, откуда человек берет деньги. Важно, что он с ними делает потом. Надо поставить Гайсина на место, где его пороки способствовали бы не только его личному обогащению, но и всеобщему благу. Но, конечно, Бариша был прав насчет того, что у экзарха не было привычки пугать людей, потому что чиновник с перепугу, что его когда хотят, тогда и посадят, начинает вытворять вовсе неизвестно что. И вот, спустя неделю после этого разговора, зашел господин Гайсин в сад при малой городской управе, и видит: к коньку малого храма привязана маслобойка, у маслобойки сидит молоденькая служанка и качает маслобойку, как колыбельку. Господин Гайсин понял, что дурочка только что из деревни, потому что кто же в таком месте сбивает масло? А вокруг, как положено, спеют персики и сливы, виноград уже наливается бирюзой и яшмой, нежный пруд с уточками и селезнями, мостики с бронзовыми перилами перекинуты подобно радуге. Вечереет, и дневная жара спала, и воздух напоен ночными ароматами. ---~Ах,~---~говорит Гайсин,~---~какой прекрасный сад! Хотел бы я быть белкой, чтобы порезвиться в его ветвях! А новая служанка ничего не говорит, только качает колыбельку. ---~Ах,~---~говорит господин Гайсин,~---~как прекрасно это озеро, поистине подобное небесному озеру! Хотел бы я быть удочкой, чтобы ловить рыбу в этом озере! А новая служанка ничего не говорит, только качает маслобойку и краснеет. ---~Ах,~---~говорит господин Гайсин,~---~как прозрачен этот ручеек! Я хотел бы быть мостиком, чтобы изогнуться над ним. Тут новая служанка, не переставая качать колыбельки, говорит: ---~Ах, сударь начальник, не подобает заниматься такими делами в таком месте. ---~Гм,~---~говорит господин Гайсин,~---~однако это ты права!~---~И даже поразился такой тонкости в суждениях. ---~У меня,~---~говорит девица,~---~есть домик в Нижнем Городе, а садик при нем~---~не мой. И если бы этот садик был мой, я охотно пустила бы вас им полюбоваться. В общем, уговорились они, что вечером господин Гайсин осмотрит садик в Нижнем Городе. == Глава ТРЕТЬЯ, #chapter("Глава третья,")[в которой контрабандист Клиса крадет говорящий клубочек, а Сайлас Бредшо попадается "парчовым курткам".] Экзарх стоял на холме под стенами храма Фрасарха-победителя и, щурясь, смотрел, как идет конница по широкому мосту через Лох. Храм Фрасарха стоял на левом берегу Лоха, а на правом начинались земли Варнарайна. Епарх Миссы, извещенный почтовыми голубями, вздумал было разобрать мост. Конный отряд аломов, опередивший на три дня остальные войска, подоспел как раз вовремя, чтобы разогнать работников и распотрошить самого епарха. Настоятель Фрасархова храма предусмотрительно отказался похоронить высокого чиновника: нехорошо истреблять созданное народным трудом. Экзарх не знал, радоваться или огорчаться. Аломский командир, отстоявший мост, опередил других иа три дня потому, что его лагерь был ближе к границе. Ближе к границе его лагерь оказался потому, что был близ звездного корабля. Араван заявил: ---~Он нарушил строжайший приказ оставаться на месте. Он подлежит наказанию, но наказать его невозможно: карая, нельзя оставить причину кары без разъяснения. Этим вечером экзарх впервые принес положенные жертвы богам и написал положенные воззвания к народу. Секретарь Бариша принес заготовки: "В соответствии с желанием Неба и волей Народа... Подобно древним государям... захватившие обманом дворец..." Экзарх подумал. Он вычеркнул слова "как в древности, когда не было ни твоего, ни моего и чиновники не угнетали народ" и вписал: "как в древности, когда каждый обладал своим, и чиновники не посягали на чужое имущество". Экзарх огласил воззвание перед строем варваров, и они дружно закричали "ура". Настоятель храма укоризненно сказал экзарху: ---~Сын мой, вы пишете: "ради народного счастья" и начинаете войну. Убивают людей, разрушают города, жгут посевы. Разве бывает счастье от войны, прибыток~---~от насилия? Разве это подобает государю? Секретарь Бариша развеселился, представив себе указ: "Ради народного несчастья..." Экзарх вдруг засмеялся и сказал: ---~Я не хочу быть государем, я хочу быть богом, как Иршахчан. Не всякий государь~---~бог. Государем становится тот, кто выиграет в "сто полей". А богом~---~тот, кто изменит правила игры. Священник подумал о том, что рассказывают о монахах-шакуниках. ---~Что ж,~---~с горечью проговорил он,~---~тогда вы первый из тех, кто стал богом до того, как стал государем. Вечером экзарх созвал к себе в палатку командиров. К нему подвели алома, отряд которого захватил мост. Экзарх вынул из ножен и вручил ему свой собственный меч. Огромный и неуклюжий, как медведь, варвар опустился на колено, прижавшись губами к стали, и экзарх потрепал его по рыжеватой шевелюре: ---~Если бы все были так решительны и расторопны, мы бы были уже хозяевами столицы. ---~Я не без причины покинул вверенный мне пост,~---~довольно улыбаясь снизу вверх, отвечал алом.~---~Разрешите поговорить с вами наедине? Экзарх побледнел и жестом приказал всем удалиться. Причина могла быть только одна: звездный корабль. Варвар, не вставая с колен, ждал, покуда они остались вдвоем. ---~Итак, ваша причина?~---~спросил экзарх. ---~Десять дней назад во дворце,~---~отвечал алом,~---~был убит смотритель свеч Ешата. Это был мой младший брат. Экзарх поспешно отступил, изменившись в лице, но было поздно: алом, не вставая с колен, молча ткнул его мечом в живот с такою силой, что кончик меча пронзил позвонки и вышел из спины. Ворвавшаяся стража изрубила алома на мелкие кусочки. Труп его лежал в палатке, а душа тихо выскользнула за порог и серым сурком побежала известить предков об исполненном родовом долге. Экзарх был еще жив. По его приказу его вынесли из шатра и положили под темным ночным небом. Араван опустился рядом на колени и плакал, уткнувшись в теплый мех епанчи. "Меня бы так просто не зарубили",~---~думал он. Экзарх улыбнулся посиневшими губами. ---~Нынче,~---~начал он и захрипел.~---~Если я увижусь с вашим злым богом, я обязательно спрошу: почему у звезд~---~не мы, а они... Командиры поняли, что экзарх бредит. Потом глаза Харсомы закатились, и язык вывалился изо рта. x x x На следующее утро араван отдал приказ: переправиться через Лох, разбить лагерь на противоположной стороне, резать баранов и печь бараньи лепешки, как то повелевал варварский обычай охраны границ. В полдень он вышел из шатра полководца, и первым пустил баранью лепешку по воде. Аломы и вейцы стали делать то же. Отныне земля Варнарайна была не земля империи. Лепешки тонули быстро, и аломы прыгали, как дети: родовые предки откликнулись на зов алома Баршарга и явились на охрану новых владений. ---~Король Харсома умер,~---~сказал Баршарг,~---~и мы обязаны защитить права сына нашего сюзерена. Варвары глотали его слова так же жадно, как духи реки глотали лепешки. Есть король~---~будут и вассалы. Будут вассалы~---~будут и ленные земли. Уже и речи не шло о том, чтобы завладеть всей империей, оставалось~---~спасать свою шкуру и объявлять Варнарайн отдельным государством. Араван Баршарг разослал письма влиятельным людям провинции. Ох, непросто дались ему эти письма! Харсома бдительно следил, чтобы среди ближайших его помошников никто не возвышался по влиянию над остальными, и сделал все, чтобы эти помошники ненавидели друг друга. Наместник Рехетта ненавидел аравана Баршарга потому, что один был вожаком восстание, а другой его подавлял. Баршарг ненавидел Даттама за то, что тот повесил его младшего брата, а Арфарру~---~за дурацкие убеждения да за целую коллекцию уличающих документов, которые Арфарра на него собрал. Даттам и Арфарра неплохо уживались друг с другом, пока экзарх не послал их к варварам, и там оказалось, что интересы торговца Даттама прямо противоположны интересам королевского советника Арфарры. И вот теперь получалось так, что, чтобы выжить, эти четверо должны были примириться, и ни один из них не потерпел бы другого единоличным диктатором, потому что опасался бы, что другой решит, что повесить союзника~---~куда важней, чем бороться против империи. Баршарг писал: "Последней волей государя Харсомы было, чтобы мы, забыв прежние распри, защитили его дело и его сына от общего врага. В древности в государстве было три начала: власть гражданская, власть военная, и власть священная. Когда три начала были в равновесии, народ владел имуществом беспрепятственно и процветал. Власть гражданская~---~это наместник, власть военная~---~араван, а главный бог Варнарайна~---~Шакуник..." На следующий день к нему пришел секретарь Бариша и, осклабясь, доложил, что войска сомневаются по поводу вчерашней церемонии: ---~Варвары! Считают, что на бараньей крови граница слаба, что тут нужна человечья! Баршарг швырнул ему через стол список мародеров: ---~Так в чем же дело? Пусть выберут и поступают согласно обычаю. Бариша от удивления оборвал о косяк кружевной рукав. x x x На следующее утро Ванвейлен проснулся поздно. Взглянул в окно: дочка наместника провинции кормила цыплят, на крыше целовались резные голуби, под крышей двое работников резали для гостей барана. Во дворе всадник, перегнувшись с луки, разговаривал с Даттамом. Разговор кончился. Даттам подошел к пегой кобыле, запряженной в телегу. К хомуту было подвешено большое ведро с водой, Даттам сунул в это ведро голову, как страус, и стал пить. Пил он минут пять, потом еще поговорил со всадником и пошел в дом. Ванвейлен оделся и вышел в гостевую комнату. ---~Что случилось?~---~спросил он. Даттам смотрел прямо перед собой на фарфоровый чайник в поставце. ---~Государь Харсома убит,~---~сказал он. Ванвейлен подоткнул к столу табуретку и сел. ---~И кто теперь будет править в империи? ---~Править будет,~---~сказал ровно Даттам,~---~его сын. ---~Шести лет? ---~Шести лет. ---~А кто будет опекуном? ---~Господин наместник, господин араван, настоятель нашего храма, господин Арфарра и я. "Ну и смесь!~---~мелькнуло в голове у Ванвейлена.~---~Ведь они перережут друг друга в ближайшем же будущем". ---~А что,~---~сказал Ванвейлен,~---~вы уверены, что господин Арфарра будет хорошим опекуном? Даттам помолчал. ---~Помните вы,~---~спросил он,~---~как махали в Ламассе рукавами и шляпами при имени Арфарры? И вашем, кстати. Вот так же машут в Иниссе, где он был наместником, и по всей империи распевают строчки из его доклада.~---~Даттам усмехнулся:~---~А при моем имени,~---~сказал он,~---~машут редко, и то больше по старой памяти. Ванвейлен подумал: "Зачем же вы тогда в совете опекунов вообще?" Тут заскрипело и заскворчало: женщины принесли корзинки с фруктами, а за ними пожаловал сам хозяин с печеным бараном.
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/DISCIPLINES.md
markdown
Apache License 2.0
# Typst Package Disciplines Disciplines define the target audience of a package, making it easy for users to discover domain-specific packages and templates. Not all packages are domain-specific, those can simply omit the `disciplines` key from their manifest. In addition to disciplines, packages can also specify a list of [categories] describing their functionality. Disciplines are standardized for discoverability. If you want to submit a domain-specific package, but there isn't a fitting discipline in the list below, please reach out to us! The following disciplines are currently defined: - `agriculture` - `anthropology` - `archaeology` - `architecture` - `biology` - `business` - `chemistry` - `communication` - `computer-science` - `design` - `drawing` - `economics` - `education` - `engineering` - `fashion` - `film` - `geography` - `geology` - `history` - `journalism` - `law` - `linguistics` - `literature` - `mathematics` - `medicine` - `music` - `painting` - `philosophy` - `photography` - `physics` - `politics` - `psychology` - `sociology` - `theater` - `theology` - `transportation` [categories]: https://github.com/typst/packages/blob/main/CATEGORIES.md
https://github.com/lublak/typst-echarm-package
https://raw.githubusercontent.com/lublak/typst-echarm-package/main/examples/gauge.typ
typst
MIT License
#set page(width: 200mm, height: 150mm, margin: 0mm) #import "../typst-package/lib.typ" as echarm #echarm.render(width: 100%, height: 100%, options: ( series: ( type: "gauge", progress: ( "show": true ), data: ((value: 60),) ) ))
https://github.com/camp-d/Notes
https://raw.githubusercontent.com/camp-d/Notes/main/ece3220.typ
typst
= Operating Systems - Dr. Drachova = Jan 25 2024 = Linux compilation steps - Preprocessor - includes header files, converts macros, conditional compilation, line control = Line Control 6 Line Control - The C preprocessor informs the C compiler of the location in your source code where each token came from. Presently, this is just the file name and line number. All the tokens resulting from macro expansion are reported as having appeared on the line of the source file where the outermost macro was used. We intend to be more accurate in the future. - If you write a program which generates source code, such as the bison parser generator, you may want to adjust the preprocessor’s notion of the current file name and line number by hand. Parts of the output from bison are generated from scratch, other parts come from a standard parser file. The rest are copied verbatim from bison’s input. You would like compiler error messages and symbolic debuggers to be able to refer to bison’s input file. - bison or any such program can arrange this by writing ‘line’ directives into the output file. ‘#line’ is a directive that specifies the original line number and source file name for subsequent input in the current preprocessor input file. ‘#line’ has three variants: - line linenum - linenum is a non-negative decimal integer constant. It specifies the line number which should be reported for the following line of input. Subsequent lines are counted from linenum. - line linenum filename - linenum is the same as for the first form, and has the same effect. In addition, filename is a string constant. The following line and all subsequent lines are reported to come from the file it specifies, until something else happens to change that. filename is interpreted according to the normal rules for a string constant: backslash escapes are interpreted. This is different from ‘include’. line anything else - anything else is checked for macro calls, which are expanded. The result should match one of the above two forms. ‘line’ directives alter the results of the and predefined macros from that point on. See Standard Predefined Macros. They do not have any effect on idea of the directory containing the current file. = Linux task_struct PCB struct - what are interrupts? Signals sent to processor/kernel - what are two types? asynch vs synch - PSR process s register - ISR interrupt service routine = System calls - fork - exec - wait - signal - Shell can be parent process of other processes - Systemd can be process of shell = Feb 8 2024 - Threads - component of a process -- smallest sequence of programmed instructions that can be managed independently by a scheduler. - threads have their own stack - process = instance of computer program that is being executed by one or more threads. -
https://github.com/polarkac/MTG-Stories
https://raw.githubusercontent.com/polarkac/MTG-Stories/master/stories/055%20-%20Murders%20at%20Karlov%20Manor/008_Episode%208%3A%20Gods%20of%20Chaos.typ
typst
#import "@local/mtgstory:0.2.0": conf #show: doc => conf( "Episode 8: Gods of Chaos", set_name: "Murders at Karlov Manor", story_date: datetime(day: 16, month: 01, year: 2024), author: "<NAME>", doc ) The sun rose bright and beautiful over the moor, shining through every blade of grass and glinting off every drop of dew. It was a glorious morning, the sort of day that appeared filled with promise and glory, with absolutely no chance of shadows lurking around the edges to snare and engulf. Kaya stood on the porch of Vitu-Ghazi, squinting at that flawless sky, and wondered when she'd lost the ability to appreciate something as simple as a sunrise. It wasn't that she couldn't tell that it was lovely. It was more … It was more that so much of the plane—of the #emph[planes] —had shown itself to be unspeakably and irreparably broken that something as beautiful as the morning sun felt less like a promise and more like another lie layered on top of all the others. A coach pulled by a pair of winged horrors stopped at the curb, and Kaya stepped off the porch to meet it. It was painted matte black with bloody trim; even without the guild symbol on the door, she would easily have been able to identify this as the carriage of the Rakdos representative. The door swung open, and Judith stepped out, resplendent in a long red velvet dress, trimmed in black and topped by a black leather bodice that gleamed like burnished steel in the early light. She wrinkled her nose as she looked first one way and then the other, finally focusing on Kaya. "When I was #emph[summoned] like some #emph[lackey] , I'll admit I expected a more impressive welcoming committee," she said, a sneer in her voice. Kaya didn't rise to the bait. "The request was for the head of the guild to come receive essential information regarding the recent murders," she said. "As you're not Rakdos, you were under no obligation to attend." "Yes, well, His Viciousness is somewhat too preoccupied preparing for war against the rest of Ravnica to attend your little soiree," said Judith, waving Kaya's words away. "Although it seems fitting that this little drama should begin #emph[and] end with an Orzhov attempt at entertainment. Who are you going to kill to keep us all amused today?" #figure(image("008_Episode 8: Gods of Chaos/01.png.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) "No one, unless you keep testing me," said Kaya, keeping her tone pleasant. "Aurelia and Lavinia are already inside, if you'd like to go join them." "While you stay out here to play greeter? How adorable." Judith's smile was a razor blade, sharp enough to slice through flesh to find the bone beneath. She swept past Kaya without another word, leaving her alone on the porch. The carriage drove away, horrors trotting in eerie unison. Kaya rolled her eyes. That was Judith. She would probably find a way to choreograph her own deathbed for maximum dramatic impact. Bladders of blood attached to the ceiling or something. Kaya was still standing there, contemplating the horrors of Judith's eventual, meticulously orchestrated death, when a great shadow swept across her. She looked up, taking a half-step back, and watched as Ezrim came gliding in for a landing, offering her a polite nod. He pulled a small chariot behind him, occupied by a centaur in Gruul colors. The centaur exited the chariot once they were safely on the ground, undoing the buckle that had kept him from falling out. Kaya turned, offering a small half-bow to Ezrim. "Sir," she said, and then, as she turned to face his companion, "Yarus, I presume." "Message said you wanted the Gruul leader," said the centaur, still looking unsettled by his recent flight. "We don't have a leader, but I speak high enough to stand for us here. And I was with this one," he hooked a finger toward Ezrim, "when the note came in, so he said this was as good as keeping me in custody." "Yarus didn't release Anzrag from the evidence capsule," said Ezrim. "Would've, if I'd thought of a way how," said Yarus. "And he didn't know who had, although he's grateful that you were able to recapture the god without killing him," continued Ezrim. "Don't like him being a captive, but it's better than dead. Thought for sure you civilized folk would put him down if you had the chance," said Yarus, with something verging on grudging respect. "You didn't, and your man here explained what has to happen before we can have him back with us, unharmed and uncontained. But you could've killed him, and you didn't, and for that, you have my respect." "You're welcome," said Kaya, amazed. Ezrim, meanwhile, moved closer, looming over her. "Now, #emph[Agent] , care to explain why you think you have the authority to summon me?" "All will be explained shortly, sir," said Kaya. "If you would just proceed inside, we're going to get started soon." Ezrim gave her a measuring look. "This isn't like you." "Maybe. Maybe not." "Who put this together?" "Inside, sir. You'll have the information soon." #emph[And so will I.] With one last, inscrutable look, Ezrim paced through the wide double doors, making Kaya question again how the archon got around when faced with buildings constructed to a more human scale. Most civic establishments accounted for the varying sizes of the population, but surely his job took him to private homes on occasion? Narrow tunnels? Places that weren't expecting to accommodate a massive feathered steed? No point in dwelling on it. Vitu-Ghazi was large enough, and she still had people to greet. Kaya waved Yarus after Ezrim, then turned her eyes back to the road. Not much longer now. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) Vannifar was the last of the guild leaders to arrive, shortly after Ral, who had paused before going inside to give Kaya a look so sympathetic that it had caused her stomach to briefly lurch, like everything she'd eaten since arriving in the city was going to make an appearance right then and there. Teysa had been his friend, too. More than anyone else on Ravnica, he understood how much she'd lost, both before and after Teysa died. They'd never been close, but here was someone who understood her, all the way to the base of who she was, and it was almost a crime that they didn't have time to talk. But then he'd been stepping inside, and Vannifar had been climbing out of her coach, a sour expression on her face, and Kaya had been thrust back into the role she'd agreed to play in this morning's little performance. #emph[Proft better know what he's doing] , she thought sourly and moved to greet Vannifar. Only one guest was expected after that: Krenko, the goblin hustler she'd seen speaking with Teysa at the party. Why #emph[he] was included in the invitations was just one of the many things Proft hadn't been willing, or perhaps able, to disclose. Once Krenko arrived, Kaya ushered him through the doors of Vitu-Ghazi and closed them behind her with a satisfying thump. "This way," she said, beckoning for him to follow as she started down the hall toward Trostani's sanctum. "Who else is, eh, here?" he asked, clearly anxious. If Proft had summoned him, he probably had reason to be. "Quite a few people," said Kaya. "Most of the guild leadership—we're only missing Golgari and Dimir, for hopefully obvious reasons—yourself, Agent Kellan from the Agency, Captain Ezrim from the Agency, and Tolsimir." "So if whoever's been hunting guild leaders wanted to finish the job in a hurry, all they'd need to do is hit Vitu-Ghazi?" Kaya fixed Krenko with a stern look. "You know, it's only because you sound unhappy about that that I'm not detaining you right now. Aurelia is in the building. You could be under arrest in a matter of seconds." "You can't talk to me like that. I have a pardon!" said Krenko, glowering at her. "Can you really blame me for being concerned over my own safety?" "I doubt there's any place on Ravnica safer than right here," Kaya said and opened the door to Trostani's sanctum, which had been turned into their makeshift gathering place for today's salon. It was large enough, but even so, with every chair occupied and every corner filled with unhappy murmurs, it certainly seemed to be at capacity. Even Trostani herself looked displeased, her arms twined together and complementary, if not identical, frowns on all three of her faces. #figure(image("008_Episode 8: Gods of Chaos/02.png.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) Everyone turned toward Kaya and Krenko as the door closed behind them. Aurelia was the first to move, rising with a flurry of feathers from the leather armchair she'd been occupying and demanding, "What is the #emph[meaning] of this?" The chain connecting her to Massacre Girl—the captive who she had insisted on bringing, presumably to throw in the faces of the others there—jerked the assassin an inch forward. "You didn't have to come," said Kaya. "Hear that? We could've stayed home," said Massacre Girl before a savage jerk on her chain quieted her. Judith very pointedly looked away. "When someone says they want us to attend to hear more about the deaths of our colleagues, yes, we had to," said Vannifar. "The Agency has been entirely incompetent, and only the fact that the Boros have somehow managed to be even worse makes this anything other than a farce." Aurelia's wings mantled, and she began to open her mouth, preparing to say something that Kaya was sure would shatter the fragile peace in the room. Time seemed to stretch, the moment lasting longer than causality could explain, and into the silence created by her horrified pause, a new sound emerged. Clapping. Kaya turned to see Detective Proft stepping out of a shadow that couldn't possibly have concealed him for this long, clapping slowly and rhythmically, eyes fixed on Aurelia. "I told Etrata I could set an egg timer by how long it would take you to lose your temper once we were all here, and I wish to thank you for earning me three zinos," he said. "I know she's good for it." "In your dreams," said a voice from the other side of the room. Etrata had likewise emerged from the shadows and was leaning against the back of a chair, arms crossed, looking amused. "You can make all the bets you want. They won't count unless I agree to them." "Uh-uh-uh, pedantry is the hallmark of a narrow mind," said Proft. Ezrim, meanwhile, had turned to Etrata, eyes narrowed. "Give me one good reason not to detain you and hand you over to the Azorius right now," he said. "I'm sure Lavinia would be delighted to have you back in her custody." "Very much so," said Lavinia, pinching each syllable off until it became almost its own sentence. "Ah, but I'm afraid you'll both have your hands full with the #emph[real] architect of our current conundrum," said Proft smugly. "Etrata #emph[did] break out of Azorius custody, and technically, that could be considered a crime. However, as she was being unlawfully detained at the time, I believe you'll find the Guildpact exempts her from any consequence for that action. If we wanted to be able to punish people for getting a little egg on our faces, I suppose we should have asked Azor to word that better. I'll be sure to discuss it with him if he ever makes it back." "What do you mean?" Ezrim asked, even as Aurelia demanded, "What are you talking about?" and Lavinia said, "You can't be serious." Their voices layered together, almost like Trostani's. Trostani herself remained silent, watching everything unfold with worried eyes. "Ah," said Proft. "All will soon be made clear. I simply need to ask each of you a few questions before I can explain the full situation." "Why should we allow it?" asked Ral. "Because your answers will provide the final pieces of this puzzle, and save many Ravnican lives," said Proft with utter calm. "Very well," said Ezrim. "As you have clearly roped my investigators into your scheme and convinced them to organize this assembly on your behalf, I suppose we can give you a bit of our time. And if you fail to satisfy everyone here, I suppose you'll be happy to give me back your badge." "It won't come to that," said Proft confidently. "I'll need to speak to each of you privately, but I can give you this assurance: our killer is here with us, in this very room." Murmurs and anxious glances followed this declaration. Krenko was the first to speak, demanding, "So why did you call us all here? Why lead us to the middle of nowhere to tell us we've been locked in with a murderer? You know #emph[I] didn't do it. Why am #emph[I] here?" "Because this concerns you as well," said Proft. "You all know someone here is guilty, which means none of you will allow anyone to leave. As to why we're in the middle of nowhere, well, our killer is a dangerous individual. Who knows how they might react when their treachery is revealed? Out here, we're far from civilians and crowds. Ravnica has seen enough casualties recently." Arguments erupted from all around the room. Kaya watched the so-called leading lights of Ravnica as they fought and protested like children, weariness spreading through her. She just wanted to go somewhere quiet and be done with this. Kaldheim. When all this was over, she was going to go to Kaldheim and let Tyvar take her on that fishing trip he'd been threatening. She would stand in freezing water up to her thighs and watch the rainbow lights paint pictures in the sky, and she wouldn't be in a place where her friends kept dying, and she wouldn't have to listen to people she respected fighting as if all that mattered was their inconvenience. Finally, Ezrim snapped his wings open with a sound like tearing silk and shouted, "#emph[QUIET!] " into the tumult. Silence fell, and everyone turned to stare at him. Most looked annoyed; Ral and Judith looked almost amused. Trostani and Aurelia looked resigned. "What is it?" asked Vannifar. "We're already here," said Ezrim. "We're here, we want this to end, and these people were tasked and authorized to investigate. I want to hear what my detective has to say." "I'm alive, but one of my inventors is not," said Ral. "Izzet allows it." "Azorius doesn't stand in the path of justice," said Lavinia. "We allow it as well." One by one, the guild leaders chimed in with their acquiescence, until Kaya realized Ezrim was looking at her. She held up her hands. "Hey, I'm not in charge of the Syndicate anymore!" "Teysa had no named second in command, and as she has not yet returned from beyond to express her wishes in the matter of succession, we have no one to speak for the guild if you refuse," said Trostani, breaking her long silence. "The Guildpact permits you to consent on Orzhov's behalf." It would have been nice if Niv-Mizzet, who embodied the Guildpact, could have made an appearance while his people were dying. Kaya sighed before saying, sourly, "Fine, then. I want this to be over. You have the Syndicate's consent." "And House Dimir's, if that matters," said Etrata. "As the Swarm has not sent a representative—" "Oh, but we have," said Izoni, melting out of the shadows. "The Golgari approve." If Proft was surprised by her appearance, he did an admirable job of not showing it. Expression serene, he said, "We are in agreement, then?" "No," said Krenko. "I don't want to be left alone in here with some mystery assassin while you interrogate someone else. A lot of people have reasons for wanting me dead. This is just making it easy on them." "Agent Kellan and Captain Ezrim will both be present," said Proft. "You'll be safer here than you would be in your own home." "Doesn't say much for the safety of his home," drawled Judith, amusement growing. "Regardless, as I now have permission to proceed, I will begin my interviews with our lady Planeswalker." Proft turned to Kaya. "If you would accompany me?" "I can't ask anyone else to do what I refuse to do myself, so absolutely," she said. "Tolsimir? Is there a place where we might speak in private?" "Of course," said Tolsimir. "Selesnya provides for our guests." He walked to the doors, pushing them open, and beckoned the pair to follow him into the hall, where he led the way to a smaller door. "This will be perfect," said Proft. "Thank you." "The Conclave is happy to assist in your investigation," he said and turned, leaving them. #v(0.35em) #line(length: 100%, stroke: rgb(90%, 90%, 90%)) #v(0.35em) The room they had been led to was small and somewhat shabby, filled with furniture that had probably been moved from elsewhere in the manor, pressed into a final use before it was scrapped or recycled into something else. "Is it odd to anyone else that Vitu-Ghazi has decided to be a … fancy house during its recovery?" asked Kaya, sitting. "I would have expected something larger." Proft made a noncommittal noise as he settled across from her, folding his hands in his lap. Kaya adjusted her position, getting comfortable, and waited for him to say something. Proft, uncharacteristically, stayed silent. Blinking, Kaya did the same. The silence stretched out between them, growing longer and longer, hanging in the air like an unanswered question. Kaya squirmed. Proft didn't move, remaining exquisitely still as a corpse. The comparison made Teysa's open, unseeing eyes flash through her memory, and Kaya stiffened. "What are we doing?" she asked, voice sharp. "Waiting," said Proft. "Waiting for #emph[what] ?" Before Proft could answer, something moved on the wall to Kaya's left. Already tense from the long silence, she shifted away from it, automatically falling into a fighting stance, one hand on the dagger at her belt. The movement proved to be a white, wormlike root, uncurling from the pattern in the wallpaper, spiraling into a thicker base. That base swelled and expanded, becoming a bud the color of a bone-deep bruise. It began to open, petals spreading delicately wide, and for half a heartbeat, it seemed as if the flower were taking a breath. Proft clamped a clear glass evidence jar over the flower just as it began to emit a puff of yellow-gray dust. Pollen, or spores of some kind. "Would you be so kind?" he asked, gesturing toward her dagger with his free hand. Kaya blinked and rose, pulling the dagger and leaning over to slide it under the edge of the jar, smoothly slicing the entire flower off the wall and into the waiting receptacle. Proft sat back in his chair, snapping a lid onto the jar. A flash of blue-white energy suffused the glass, finally identifying it as a field evidence collection container. Its contents would remain in stasis until they were needed. Proft stood. "As I had hoped; we're finished here," he said with a polite nod to Kaya. "Thank you for your assistance, and for helping me to avenge your friend." Utterly baffled, Kaya followed him back into the hall. "Were you planning to tell me what that was all about?" "I'm planning to tell #emph[everyone] what that was all about. Who committed these terrible crimes, why Etrata and any others accused are innocent under Ravnican law, and how we can bring this terrible chapter in our city's history to a conclusion." He flashed her a tight smile. "You wouldn't rob a hard-working detective of his opportunity to gloat, now would you?" #figure(image("008_Episode 8: Gods of Chaos/03.png.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) "As long as you're going to explain." "Oh, believe me, there is nothing I want more," said Proft, opening the door back to Trostani's private study. Not much had changed inside. Kellan was sitting in the chair Kaya had vacated and stood quickly as she returned, gesturing for her to join him. "I miss anything?" she asked. "Lavinia and Krenko had a little spat. He said the Senate made his toughs look like gentlemen and told her to rearrest Etrata if she wanted to do something useful; Aurelia reminded him that Etrata's a known assassin; he went back to his corner," said Kellan dutifully. "Oh, and Massacre Girl bit Yarus. Other than that, nothing. What happened with Proft?" "Show's about to start," she replied. "Quiet. I want to hear what he hasn't been telling us." Kellan fell silent as she sat, and they watched Proft stride to the middle of the room. He held up his jar, turning so that everyone would have a chance to see, before putting it theatrically down in the middle of a small, round refreshment table. "I'm sure you're all still wondering why I requested these fine representatives of the Agency call you here today," he said. "I'm more curious about why you've been running around the city with a fugitive," said Aurelia. "I have the same question," said Lavinia. "Also, how did she get out of our custody? Those locks are supposed to be secure." Proft ignored that, pressing ahead with his presentation. "We have multiple suspects in the matter of multiple killings. Zegana of the Simic Combine; Teysa of the Orzhov Syndicate; Kylox of the Izzet League." He glanced at Ral. "My apologies on the loss of one of your own. A further attempt was made on the life of Warleader Aurelia of the Boros Legion—but the attack on her carried a note of similarity to the attack on Zegana. In both cases, a known assassin of a guild whose relations with the rest of Ravnica were under strain was identified as the attacker, and in both cases, the supposed killer had no memory of the incident." "Or so they'd like us to think," said Aurelia. "Why would a Dimir assassin have been so overt, or so easily caught? And how could she then fool a verity circle with no time to prepare?" asked Proft. "Which is easier to believe, that she's telling the truth, or that our entire system of justice is somehow fallible?" "I know which I'd prefer," said Ral. "Continue," said Ezrim. Proft nodded to him. "I was informed of the escape of the Gruul god within Agency headquarters—an escape which occurred as the primary investigative team was growing close to a set of answers, one which might have led them to the killer's trail. Yarus had no means of releasing Anzrag." "Would've done it well sooner if I had," said Yarus. "Indeed," said Proft. "For the Gruul god to be freed, someone would have had to access the evidence locker. Someone with clearance and the ability to open very tightly warded locks. As I looked at the pieces of the puzzle, I realized what mattered wasn't the scene of the crime—it was the last place each of our killers remembered being before the event occurred. Krenko was attacked by someone with no motivation for murder who had been going to the florist before returning home. Etrata had been in her private chambers, a place where she felt safe in relaxing her guard. According to Kaya, Teysa's killer had no memory between walking through the Eighth District on an errand and finding himself covered in Guildmaster Karlov's blood. The loss of memory is the connecting thread. It can't be something as simple as a blow to the head or a normal intoxication. I could accept a Dimir assassin controlling their own mind well enough to conceal the memory, but several untrained civilian killers? No." "Do you always take this long to get to the point?" asked Judith. "Ah, Judith," said Proft, pivoting to face her. "I did wonder how long you would allow me to leave you out of this discussion. You've been trying, desperately, to throw blame on your own parun at every step along the way. Admirable, if not for the fact that your ambition might have allowed the real architect of these killings to continue unhindered. Rakdos is no more responsible for this than I am." "Oh, so you're admitting guilt now?" Judith studied her nails. Proft turned back to Ezrim. "After Etrata explained her lack of memory to me, I realized she wasn't guilty under Ravnican law. Mind control is never held against the person manipulated in such a manner. I accompanied her to her quarters, where I found a strange powder. Izoni of the Golgari examined it on my behalf, and she was able to verify that while it is natural in origin, it comes from no flower or fungus that grows naturally on Ravnica. She raised the question of Phyrexian involvement, which I was forced to consider, as it would explain a great deal—but fails to explain so much more. I thought further, and a theory began to develop, one which was only strengthened by the information Kaya and Agent Kellan had been able to collect, which they generously shared with me. Still, I needed proof, which Kaya has just helped me to obtain. This flower." He lifted the jar again, holding it up to fix everyone's attention in the right place. "This flower is #emph[not] Phyrexian in origin. It shares none of the attributes of their terrible creations, and while I believe it to have unnatural origins, now that it exists, it is a fully natural thing, one which may well plague us for years if it successfully takes root and spreads. I knew that if I came here and declared that I was on the cusp of unraveling the mystery I would make a target of myself, and our killer would have no choice but to attempt to eliminate me at once. They depend on secrecy to continue their terrible work. Announcing my intent to interview you all was a ruse. By selecting a famous interplanar assassin as my first interview, I presented the perfect opportunity to strike. Who better to kill me and flee the scene, only to be so ashamed of her actions that she could never return to Ravnica?" #figure(image("008_Episode 8: Gods of Chaos/04.png.jpg", width: 100%), caption: [Art by: <NAME>], supplement: none, numbering: none) He paused to take a breath, allowing the moment to lengthen dramatically before he continued: "We know, through simple logic, that the substance has limitations. It can only be used to subvert the will of an individual once. Otherwise, our killer would surely have seized Etrata again. She's a known assassin, already implicated in the case, and for her to be found crouching over my body—" "As if I'd have been found," said Etrata. "—would have condemned her without question. But when I was attacked in her presence, it was by another killer, one hired through more ordinary means. I was thus fully confident that Etrata, who is known to have been afflicted once, would be able to protect the rest of you while I waited for our killer to attempt to seize Kaya and aim her in my direction." Proft turned to Tolsimir, nodding respectfully. "Only one guild has the botanical skills to create something of this nature, #emph[and] the respect for the balance of nature to make its effects limited in scope. This is a creation of the Conclave. Our killer is a member of the Selesnya. Once we accept that simple reality, everything else begins to fall together. "The roots of Vitu-Ghazi spread throughout the city. No crack, no crevice, no corner is concealed from the great tree. It's a perfect mechanism to deliver something as natural and inobtrusive as a flower anywhere in Ravnica. They grow quickly, seize control of their victims for long enough to allow the true mastermind of these murders to execute their plans, and then they wither, vanishing, untraceable. They were even able to sprout one of their flowers inside Agency headquarters, compelling one of our own agents to release Anzrag from the evidence locker, which I was able to verify by asking one of my contacts to check the area for traces of the pollen. Anything to keep us pointing fingers away from Selesnya and at each other." Proft stopped, still looking at Trostani. She said nothing, only continued looking back, the expressions on her three faces completely out of alignment. Ses glared, narrow-eyed and furious. Cim, in contrast, was wide-eyed and horrified. Oba looked almost serene, like she was detached from the situation. "You can't be serious," said Aurelia. "Mind control #emph[would] absolve the attackers of their actions, but can we really trust a Golgari leader to have given us accurate information?" "You left us alone with an assassin because you thought we'd be #emph[safer] ?" demanded Krenko. "You say Vitu-Ghazi was used to push these flowers through the city, so you brought us to Vitu-Ghazi. You must be a #emph[real ] genius, pal." "I had to, if I wanted to put our killer at sufficient ease to draw them out." Proft turned to Lavinia. "As Etrata was arrested without cause, I committed no crimes in releasing her to assist me. Are we agreed?" "It'll take months to clear the paperwork, and I'm not happy about it, but yes, we're agreed," said Lavinia. "Then all that remains is for our killer to step forward and face their punishment." "I did it," said Tolsimir, shifting away from the wall where he'd been leaning. "I sent my most faithful to confront the Agency lackeys after they came here to consult the Guildpact. I didn't want to risk the Planeswalker shaking off the compulsion before she could kill the fey." "Noble of you to try to take the burden of blame onto yourself, but you didn't do this," said Proft. "You lack the abilities, sadly. And those assailants were 'your' most faithful only in the sense that you share their adherence to the cause. That plant they swallowed, transforming themselves to moss, was well beyond your capacity to create. I can see a leaf of the same plant protruding from your jacket pocket. You came here prepared to make the ultimate sacrifice for the sake of protecting the true killer." Proft turned again, to Trostani this time, and inclined his head respectfully. "Do you wish to tell them, or shall I?" he asked. "Tell us what?" asked Vannifar. "Oh, that she's the killer, of course." Proft swiveled to face the rest of the room, beaming broadly, a man who had finally been allowed to do the one thing which brought him true satisfaction. "Weren't you listening? Trostani did this, all of it. She's been behind it all along."
https://github.com/jamesrswift/splendid-mdpi
https://raw.githubusercontent.com/jamesrswift/splendid-mdpi/main/README.md
markdown
The Unlicense
# The `splendid-mdpi` Package <div align="center">Version 0.1.1</div> A recreation of the MDPI template shown on the typst.app homepage. ## Media <p align="center"> <img alt="Light" src="./thumbnails/1.png" width="45%"> &nbsp; &nbsp; &nbsp; &nbsp; <img alt="Dark" src="./thumbnails/2.png" width="45%"> </p> ## Getting Started To use this template, simply import it as shown below: ```typ #import "@preview/splendid-mdpi:0.1.1" #show: splendid-mdpi.template.with( title: [Towards Swifter Interstellar Mail Delivery], authors: ( ( name: "<NAME>", department: "Primary Logistics Department", institution: "Delivery Institute", city: "Berlin", country: "Germany", mail: "<EMAIL>", ), ( name: "<NAME>", department: "Communications Group", institution: "Space Institute", city: "Florence", country: "Italy", mail: "<EMAIL>", ), ( name: "<NAME>", department: "Missing Letters Task Force", institution: "Mail Institute", city: "Budapest", country: "Hungary", mail: "<EMAIL>", ), ), date: ( year: 2022, month: "May", day: 17, ), keywords: ( "Space", "Mail", "Astromail", "Faster-than-Light", "Mars", ), doi: "10:7891/120948510", abstract: [ Recent advances in space-based document processing have enabled faster mail delivery between different planets of a solar system. Given the time it takes for a message to be transmitted from one planet to the next, its estimated that even a one-way trip to a distant destination could take up to one year. During these periods of interplanetary mail delivery there is a slight possibility of mail being lost in transit. This issue is considered so serious that space management employs P.I. agents to track down and retrieve lost mail. We propose A-Mail, a new anti-matter based approach that can ensure that mail loss occurring during interplanetary transit is unobservable and therefore potentially undetectable. Going even further, we extend A-Mail to predict problems and apply existing and new best practices to ensure the mail is delivered without any issues. We call this extension AI-Mail. ] ) ```
https://github.com/Kasci/LiturgicalBooks
https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/SK/zalmy/Z084.typ
typst
Pane, svojej krajine si preukázal milosť, \* Jakuba si zbavil poroby. Svojmu ľudu si odpustil vinu \* a zakryl si všetky jeho hriechy. Všetok hnev si v sebe potlačil \* a zmiernil svoje rozhorčenie. Obnov nás, Bože, naša spása, \* a odvráť od nás svoj hnev. Vari sa chceš hnevať na nás naveky \* a z pokolenia na pokolenie svoj hnev prenášať? Či sa k nám nevrátiš a neoživíš nás, \* aby sa tvoj ľud mohol v tebe radovať? Ukáž nám, Pane, svoje milosrdenstvo \* a daj nám svoju spásu. Budem počúvať, čo povie Pán, Boh; \* on ohlási pokoj svojmu ľudu a svojim svätým \* a tým, čo sa k nemu obracajú úprimne. Naozaj: blízko je spása tým, čo sa ho boja, \* a jeho sláva bude prebývať v našej krajine. Milosrdenstvo a vernosť sa stretnú navzájom, \* spravodlivosť a pokoj sa pobozkajú. Vernosť vyrastie zo zeme, \* spravodlivosť zhliadne z neba. Veď Pán dá požehnanie \* a svoje plody vydá naša zem. Pred ním bude kráčať spravodlivosť \* a po stopách jeho krokov spása.
https://github.com/elteammate/typst-compiler
https://raw.githubusercontent.com/elteammate/typst-compiler/main/deobfuscated/compile-x86.typ
typst
#import "utils.typ": * #import "typesystem.typ": * #import "ir-def.typ": * #import "utils-asm-highlighting.typ": * #let registers = ( "rax", "rbx", "rcx", "rdx", "rsi", "rdi", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", ) #let fp_registers = ( "xmm0","xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "xmm8", "xmm9","xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15", ) #let external_function = mk_enum( debug: true, "content_join", "mk_function", "cast_int_to_content", ) //#define ESCAPE $L //# (($L).replace("%", "_P_").replace("@", "_A_").replace(".", "_"))! // Returns the assembly instruction with indentation //#define ASM $I //# (" " + $I)! // Pushes the instruction to the code //#define EMIT $I //# code.push(ASM[$I])! // Pushes the label to the code //#define LABEL $L //# code.push(ESCAPE[$L] + ":")! // Marks register $R as allocated. Register MUST be free //#define ALLOCATE $R //# { let r = $R; let _ = free_num_registers.remove(free_num_registers.position(x => x == r)); //# allocated_num_registers.push(r); r }! // Marks register $R as free. Register MUST be allocated //#define FREE $R //# { let r = $R; let _ = allocated_num_registers.remove(allocated_num_registers.position(x => x == r)); //# free_num_registers.push(r); r }! // Returns a free register and mark it as allocated. // If no free registers are available, a register is forced to be freed/ //#define GET_FREE_REGISTER //#({ //# if free_num_registers.len() > 0 { //# ALLOCATE[free_num_registers.first()] //# } else { //# let reg = FORCE_FREE_REGISTER[allocated_num_registers.first()] //# ALLOCATE[reg] //# } //#})! // Forces an allocated register $R to be freed, returns free register //#define FORCE_FREE_REGISTER $R //# ({ //# let reg = $R //# let pos = temp_values_occupancy.position(x => not x) //# if pos == none { //# pos = temp_values_occupancy.len() //# temp_values_occupancy.push(true) //# } else { //# temp_values_occupancy.at(pos) = true //# } //# EMIT["mov [rbp - " + {str(temp_var_offset + 8 * pos + 8)} + "], " + reg] //# let val = values_in_registers.at(reg) //# let _ = FREE[reg] //# locations.insert(val, "[rbp - " + {str(temp_var_offset + 8 * pos + 8)} + "]") //# reg //#})! // Returns the FREED register that contains the value $V //#define VALUE_IN_REGISTER $V //# ({ //# let val = $V //# if is_register(locations.at(val)) { //# let reg = locations.at(val) //# if last_use.at(val) == line { //# let _ = FREE[reg] //# } //# reg //# } else { //# let reg = GET_FREE_REGISTER[] //# EMIT["mov " + reg + ", " + locations.at(val)] //# if last_use.at(val) != line { //# locations.insert(val, reg) //# values_in_registers.insert(reg, val) //# } //# reg //# } //# })! // Moves value $V to FREE register $R and allocates it //#define MOVE_VALUE_TO_REGISTER $V $R //# ({ //# let val = $V //# let reg = $R //# if locations.at(val) != reg { //# if is_register(locations.at(val)) { //# let _ = FREE[locations.at(val)] //# } //# EMIT["mov " + reg + ", " + locations.at(val)] //# let _ = ALLOCATE[reg] //# locations.insert(val, reg) //# values_in_registers.insert(reg, val) //# } //# reg //# })! // Returns location of the value $V //#define LOCAL_VALUE_LOCATION $V //# ({ //# let location = function.locals.at($V).stack_pos //# "[rbp - " + str(location * 8 + 8) + "]" //# })! // Marks the value $V as used in the register $R, marks the register as allocated //#define ASSIGN_REGISTER_TO_VALUE $R $V //# ({ //# locations.insert($V, $R) //# values_in_registers.insert($R, $V) //# if $R not in allocated_num_registers { //# let _ = ALLOCATE[$R] //# } //# $R //# })! // Returns an allocated register with the value $V assigned to it //#define ASSIGN_FREE_REGISTER_TO_VALUE $V //# ({ //# let reg = GET_FREE_REGISTER[] //# ASSIGN_REGISTER_TO_VALUE[reg; $V] //# })! // Returns a constant label with the name $C //#define ALLOCATE_CONSTANT $C //# ({ //# let c = $C //# let name = ESCAPE["%%const_" + str(constant_counter) + "_" + function_name] //# constants.insert(name, "db `" + c.replace("\n", "\\n") + "`, 0") //# constant_counter = constant_counter + 1 //# name //# })! // Frees all allocated registers required to be unused before a function call //#define PREPARE_FUNCTION_CALL //# ({ //# for reg in allocated_num_registers { //# if reg in ("rax", "rdi", "rsi", "rdx", "rcx", "r8", "r9") { //# FORCE_FREE_REGISTER[reg] //# } //# } //# EMIT["xor rax, rax"] //# }) //#define CLEANUP_FUNCTION_CALL //# ({ //# for reg in allocated_num_registers { //# if reg in ("rdi", "rsi", "rdx", "rcx", "r8", "r9") { //# let _ = FREE[reg] //# } //# } //# }) #let is_register(x) = x in registers #let compile_function(function_name, function) = { let code = () let constants = (:) let constant_counter = 0 let free_num_registers = ( "rdi", "rsi", "rdx", "rcx", "r8", "r9", "rax", "r10", "r11", ) let allocated_num_registers = ( "rbx", "r12", "r13", "r14", "r15", ) let locations = (:) let values_in_registers = (:) let reserved = () for i, reg in allocated_num_registers { let res = "%%res." + str(i) locations.insert(res, reg) values_in_registers.insert(reg, res) reserved.push(res) } let allocated_fp_registers = () let param_locations = () let int_param_counter = 0 let float_param_counter = 0 let stack_param_counter = 0 for param in function.params { if int_param_counter < 6 { param_locations.push(free_num_registers.first()) let _ = ALLOCATE[free_num_registers.first()] int_param_counter += 1 } else { param_locations.push("[rbp + " + str(8 * stack_param_counter + 16) + "]") stack_param_counter += 1 } } let labels_by_line = range(function.code.len() + 1).map(x => ()) for label_name, label_line in function.labels { labels_by_line.at(label_line).push(label_name.replace(".", "_")) } let temp_values_occupancy = () let temp_var_offset = 8 * function.stack_occupancy.len() let last_use = (:) for line, instr in function.code { for arg in instr.args { if type(arg) == "string" and arg.len() > 0 and arg.at(0) == "%" { last_use.insert(arg, line) } } } for line, instr in function.code { for label in labels_by_line.at(line) { LABEL[label] } let opcode = instr.instr let ty = instr.ty let res = instr.res let args = instr.args if opcode == ir_instruction.move_param { let param_no = args.at(0) let location = param_locations.at(param_no) if is_register(location) { locations.insert(res, location) } else { let reg = GET_FREE_REGISTER[] EMIT["mov " + reg + ", " + location] locations.insert(res, reg) values_in_registers.insert(reg, res) } } else if opcode == ir_instruction.store_fast { let reg = VALUE_IN_REGISTER[args.at(1)] EMIT["mov " + LOCAL_VALUE_LOCATION[args.at(0)] + ", " + reg] } else if opcode == ir_instruction.load { let reg = ASSIGN_FREE_REGISTER_TO_VALUE[res] let location = function.locals.at(args.at(0)).stack_pos EMIT["mov " + reg + ", " + LOCAL_VALUE_LOCATION[args.at(0)]] } else if opcode == ir_instruction.const { if ty == ptype.int { let reg = ASSIGN_FREE_REGISTER_TO_VALUE[res] EMIT["mov " + reg + ", " + args.at(0)] } else if ty == ptype.content { let reg = ASSIGN_FREE_REGISTER_TO_VALUE[res] let name = ALLOCATE_CONSTANT[args.at(0)] EMIT["mov " + reg + ", " + name] } //#define BINOP $OPCODE //# if ty == ptype.int { //# let reg1 = VALUE_IN_REGISTER[args.at(0)] //# let reg2 = VALUE_IN_REGISTER[args.at(1)] //# if last_use.at(args.at(0)) == line { //# ASSIGN_REGISTER_TO_VALUE[reg1; res] //# EMIT["$OPCODE " + reg1 + ", " + reg2] //# } else { //# let reg = ASSIGN_FREE_REGISTER_TO_VALUE[res] //# EMIT["mov " + reg + ", " + reg1] //# EMIT["$OPCODE " + reg + ", " + reg2] //# } //# } } else if opcode == ir_instruction.add { BINOP[add] } else if opcode == ir_instruction.sub { BINOP[sub] } else if opcode == ir_instruction.mul { if ty == ptype.int { if "rdx" in allocated_num_registers { FORCE_FREE_REGISTER["rdx"] } if "rcx" in allocated_num_registers { FORCE_FREE_REGISTER["rcx"] } MOVE_VALUE_TO_REGISTER[args.at(1); "rcx"] if "rax" in allocated_num_registers { FORCE_FREE_REGISTER["rax"] } MOVE_VALUE_TO_REGISTER[args.at(0); "rax"] if last_use.at(args.at(0)) == line { ASSIGN_REGISTER_TO_VALUE["rax"; res] EMIT["mul rcx"] } } } else if opcode == ir_instruction.return_ { if ty != ptype.none_ { let reg = VALUE_IN_REGISTER[args.at(0)] EMIT["mov rax, " + reg] } else { EMIT["xor rax, rax"] } EMIT["mov rsp, rbp"] EMIT["pop rbp"] EMIT["ret"] } else if opcode == ir_instruction.join { if ty == ptype.content { PREPARE_FUNCTION_CALL[] MOVE_VALUE_TO_REGISTER[args.at(0); "rdi"] MOVE_VALUE_TO_REGISTER[args.at(1); "rsi"] EMIT["call " + external_function.content_join] ASSIGN_REGISTER_TO_VALUE["rax"; res] CLEANUP_FUNCTION_CALL[] } } else if opcode == ir_instruction.cast { if ty == ptype.content { PREPARE_FUNCTION_CALL[] MOVE_VALUE_TO_REGISTER[args.at(0); "rdi"] EMIT["call " + external_function.cast_int_to_content] ASSIGN_REGISTER_TO_VALUE["rax"; res] CLEANUP_FUNCTION_CALL[] } } else if opcode == ir_instruction.mk_function { PREPARE_FUNCTION_CALL[] let escaped_label = ESCAPE[args.at(0)] EMIT["mov rdi, " + escaped_label] EMIT["mov rsi, " + str(args.at(1))] EMIT["call " + external_function.mk_function] ASSIGN_REGISTER_TO_VALUE["rax"; res] CLEANUP_FUNCTION_CALL[] } else if opcode == ir_instruction.call_fast { FORCE_FREE_REGISTER["rbx"] PREPARE_FUNCTION_CALL[] let arg_regs = ("rdi", "rsi", "rdx", "rcx", "r8", "r9") for arg_no, arg in args.slice(1, calc.min(args.len(), arg_regs.len() + 1)) { MOVE_VALUE_TO_REGISTER[arg; arg_regs.at(arg_no)] } if args.len() > arg_regs.len() + 1 { for arg in args.slice(arg_regs.len() + 1).rev() { MOVE_VALUE_TO_REGISTER[arg; "rbx"] EMIT["push rbx"] FREE["rbx"] locations.remove(arg) values_in_registers.remove("rbx") } } MOVE_VALUE_TO_REGISTER[args.at(0); "rbx"] EMIT["mov rbx, [rbx]"] EMIT["call rbx"] ASSIGN_REGISTER_TO_VALUE["rax"; res] if args.len() > arg_regs.len() { EMIT["add rsp, " + str(8 * (args.len() - arg_regs.len()))] } CLEANUP_FUNCTION_CALL[] } } let allocate_on_stack = 8 * (function.stack_occupancy.len() + temp_values_occupancy.len()) if calc.mod(allocate_on_stack, 16) != 0 { allocate_on_stack += 16 - calc.mod(allocate_on_stack, 16) } code = ( ASM["push rbp"], ASM["mov rbp, rsp"], ASM["sub rsp, " + str(allocate_on_stack)] ) + code return (code: code, constants: constants) } #let compile_x86(functions) = { let code = () let constants = (:) for function_name, function in functions { LABEL[function_name.replace(".", "_")] let res = compile_function(function_name, function) code += res.code constants += res.constants } let externs = external_function.pairs().map(x => " extern " + x.at(1) + "\n").join() let text_segment = "segment .text\n global entry\n\n" + externs + code.join("\n") + "\n" let data_segment = ( "segment .data\n" + constants.pairs().map(x => x.at(0) + ": " + x.at(1)).join("\n") ) + "\n\n" return data_segment + text_segment } #{ import "ir-gen.typ": * import "pprint.typ": * set page(height: auto) let ir = ir_from_ast(parse("#let f(/*int*/x, /*int*/y) = x + y; #f(2, 2)")) pprint(ir); pagebreak() asm_code(compile_x86(ir.functions)) }
https://github.com/darioglasl/Arbeiten-Vorlage-Typst
https://raw.githubusercontent.com/darioglasl/Arbeiten-Vorlage-Typst/main/Anhang/01_Fazit/00_index.typ
typst
== Rückblick Hier folgen unsere persönlichen Fazits zur Studienarbeit. #include "01_anna_abc.typ" #include "02_max_muster.typ"
https://github.com/asmund20/typst-packages
https://raw.githubusercontent.com/asmund20/typst-packages/main/local/num_to_str/1.0.0/main.typ
typst
#let num_to_str(num, digits: 0) = { num = str(calc.round(float(num), digits: digits)) // if digits <= 0, calc.round has the desired behaviour if digits <= 0 { return num } // here, desired digits will be strictly positive. // therefore, the string should contain a decimal point. // If it does not, the number is whole and it should be // concatinated at the end. if not num.contains(".") { num += "." } let i = num.position(".") // while the number of digits is less than the desired number, // concatenate a zero to the end. while num.slice(i+1).len() < digits { num += "0" } return num }
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/meppp/0.1.0/template.typ
typst
Apache License 2.0
#import "table.typ":meppp-tl-table #let meppp-lab-report( title: "", author: "", info: [], abstract: [], keywords: (), author-footnote: [], heading-numbering-array: ("I","A","1","a"), heading-suffix: ". ", doc ) = { // footnote settings show footnote.entry: set align(left) set footnote.entry(separator: { set align(left) line(length:30%) }) set page( paper: "a4", numbering: "1", margin:( top:2cm, bottom:1.6cm, x:2.5cm ) ) set text( font:( "Times New Roman", "SimSun" ), lang: "zh" ) set par( first-line-indent: 2em, leading: 2em, justify: true ) set block(spacing: 2em) set align(center) // title text(16pt, font:"SimHei")[ #strong(title)\ ] // author text(14pt, font:"STFangsong")[ #author ] if author-footnote != []{ footnote( numbering:"*", author-footnote ) } [\ ] // info, e.g. school & studentid text(12pt,info) // (optional) abstract & keywords set align(left) if abstract != [] { pad(left:2em,right:2em, par( leading: 1.5em, )[ \ #h(2em) #abstract \ \ #text(font:"SimHei")[*关键词:*] #for keyword in keywords{ keyword+[, ] }\ ] ) } // heading numbering set heading( numbering: (..args) => { let nums = args.pos() let level = nums.len()-1 let num = numbering(heading-numbering-array.at(level),nums.at(level)) [#num#heading-suffix] }, bookmarked: true ) // heading styling show heading: it =>{ set block(spacing: 2em) set par(first-line-indent: 0em) set text( if it.level == 1 {16pt} else if it.level == 2 {14pt} else {12pt}, weight: "medium", font:("STFangsong"), ) if it.numbering!=none{ counter(heading).display(it.numbering) } it.body } // figure numbering set figure(supplement: "图") show figure.caption: set text(10pt) set cite(style: "gb-7714-2015-numeric") set text(12pt) set bibliography( style: "gb-7714-2015-numeric", title: none ) show bibliography: bib =>{ [\ \ ] align(center,line(length:50%)) bib } doc }
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/text/case_00.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page #let memes = "ArE mEmEs gReAt?"; #test(lower(memes), "are memes great?") #test(upper(memes), "ARE MEMES GREAT?") #test(upper("Ελλάδα"), "ΕΛΛΆΔΑ")
https://github.com/exdevutem/taller-git
https://raw.githubusercontent.com/exdevutem/taller-git/main/src/post-install.typ
typst
#import "@preview/big-todo:0.2.0": * = Post instalación Se debe de configurar el usuario que va a utilizar git. Se recomienda hacerlo de forma global para tu computador personal (o usuario propio si utilizas los computadores del club), o configurarlos individualmente para cada repositorio si utilizas algun computador o usuario público. En la terminal, ingresa los siguientes comandos: ```bash # Utilizando mis datos como ejemplo. $ git config --global user.name "<NAME>" $ git config --global user.email "<EMAIL>" ``` == Llaves de SSH en Linux, Mac y Windows Adicionalmente, y pensando que ya cuentes con una cuenta de github, se recomienda que agregues una llave de SSH para trabajar con github. Existen otros métodos para trabajar HTTPS, pero los desconozco, y realmente pienso que el uso de SSH es más sencillo. Esto debería funcionar igual para todas las plataformas, *pensando que utilizes git bash* en windows. Si seguiste el proceso de instalación por defecto según se describió en @windows-install, deberías contar con un programa para SSH como parte del kit que se instala con git bash. Para el caso de Linux, SSH suele venir instalado en todas las distros, y para Mac, siempre viene instalado. Esto puede hacerse desde la pantalla de configuración, en la sección de "Llaves SSH y GPG", según se ve en @settings y @ssh-keys. Los pasos para agregar una nueva llave SSH son los siguientes: ```bash # Creo una nueva llave. Las configuraciones por defecto son # lo suficientemente buenas para un PC personal. $ ssh-keygen # Obtengo la llave pública de mis credenciales SSH. # Este output lo puedo 'pegar' en la sección de `New SSH key` en Github. $ cat ~/.ssh/id_rsa.pub ``` #figure( image("../assets/post-install/1- Settings.png", width: 75%), caption: "Ubicación de la pantalla de configuración de Github", ) <settings> #figure( image("../assets/post-install/2- keys.png"), caption: "Ubicación de la sección de llaves SSH y GPG", ) <ssh-keys> Para propósitos de esta demostración, se ha creado una llave de SSH llamada "demo" en mi carpeta `~/.ssh` usando el comando provisto anteriormente, tal y como se ve en @demo. Acto seguido, se ha impreso la llave pública y obtenido el output visto en @cat. Finalmente, si se fuera a agregar esta llave, se haría siguiendo las instrucciones en @add. Por razones de no ser tonto, he decidido no agregar esta llave a mi cuenta de Github, lo siento! #figure( image("../assets/post-install/3- Demo generacion.png", width: 75%), caption: "Generando una nueva llave", ) <demo> #figure( image("../assets/post-install/4- Output cat dotpub.png", width: 75%), caption: "Obteniendo la llave pública", ) <cat> #figure( image("../assets/post-install/5- agregando.png", width: 60%), caption: "Agregando la llave pública a Github.", ) <add>
https://github.com/senokentiy/javaLab1
https://raw.githubusercontent.com/senokentiy/javaLab1/master/report.typ
typst
// general #set text( font: "Times New Roman", size: 14pt ) #set page( paper: "a4", width: 649pt, numbering: "- 1 -" ) #align(center + top)[ #image("art/itmo.png") = Университет ИТМО #v(0.5cm) Мегафакультет компьютерных технологий и управления\ Факультет программной инженерии и компьютерной техники ] #v(4cm) #align(center, text(22pt)[ = Лабораторная работа №1 по программированию ]) #v(5cm) #block()[ Вариант: 483974\ Группа: R3140\ Выполнил: <NAME>\ Преподаватель: <NAME> ] #v(3cm) #align(center + bottom)[ Санкт-Петербург\ Сентябрь, 2024 год ] #block(text(16pt)[ = Оглавление #v(0.5cm) Текст задания:........................................................................3\ Исходный код программы...................................................4\ Результат работы программы:.............................................4\ Вывод:......................................................................................5 ]) #v(30cm) #block()[ = Текст задания: #v(0.5cm) + Создать одномерный массив *_f_* типа _*short*_. Заполнить его чётными числами от 4 до 16 включительно в порядке убывания. + Создать одномерный массив *_x_* типа _*float*_. Заполнить его 16-ю случайными числами в диапазоне от -14.0 до 2.0. + Создать двумерный массив *_n_* размером 7x16. Вычислить его элементы по следующей формуле (где $x = x[j]$): #v(0.2cm) - если $f[i] = 12$, то $n[i][j] = (cos((x)^(x/(1/3+x))))⋅(1/3-root(3, sin(x)))^2$; #v(0.2cm) - если $f[i] ∈ {4, 6, 8}$, то $n[i][j] = arcsin(e^root(3, −cos^2(x)))$; #v(0.2cm) - для остальных значений $f[i]$: $n[i][j] = ((arcsin(cos(x)))^3)^(4/(tan(arcsin((x−6)/16)))^tan(cos(x)))$. #v(0.2cm) + Напечатать полученный в результате массив в формате с четырьмя знаками после запятой. ] #v(15cm) #block(text(11pt)[ = Исходный код программы: #v(0.6cm) #link("https://github.com/senokentiy/javaLab1/blob/master/Main.java")[тут] #v(2cm) ]) #block()[ = Результат работы программы: #v(0.4cm) #image("art/output.png") ] #v(20cm) #block()[ = Вывод: #v(0.3cm) #h(1cm) В ходе выполнения лабораторной работы я научился создавать одномерные и двумерные массивы на языке Java, выводить данные в консоль, ознакомился с целочисленными и дробными типами данных, классом Math и циклами for и while, методом format() из класса String, методом nextFloat() из класса Random. ]
https://github.com/typst/packages
https://raw.githubusercontent.com/typst/packages/main/packages/preview/bone-resume/0.3.0/lib.typ
typst
Apache License 2.0
#import "@preview/oxifmt:0.2.1": strfmt #let show-common-state = state("show-common", false) #let resume-init( author: "六个骨头", header: none, footer: none, show-common: true, size:11pt, body, ) = { set document(author: author) set page(margin: (x: 3.2em, y: 3.2em), header: header, footer: footer) set list(marker: [‣]) set text(size:size, font: ("Source Han Sans"), lang: "zh") show emph: set text(font: ("Times New Roman", "LXGW WenKai GB"), style: "italic") show raw: set text(font: ("Hack Nerd Font")) show link: set text(fill: blue, weight: "bold") show heading.where(level: 1): it => { set text(rgb("#448"), font: ("LXGW WenKai GB")) v(1em, weak: true) stack( dir: ttb, spacing: 0.55em, { it.body }, line(stroke: 1.5pt, length: 100%), ) v(0.5em, weak: true) } show par: set block(spacing: 0.65em) set par(justify: true) show-common-state.update(show-common) body } #let info(author) = { stack( dir: ltr, spacing: 1fr, text(24pt)[*#author*], stack(spacing: 0.75em), stack(spacing: 0.75em), image("photo.png", height: 74pt, width: 60pt), ) v(-2.5em) } #let primary-achievement(name, decs, contrib) = { context { if show-common-state.get() { box( fill: color.hsv(240deg, 10%, 100%), stroke: 1pt, inset: 5pt, radius: 3pt, )[ #name #h(1fr) #decs #v(1em, weak: true) #contrib ] } else { box( stroke: 1pt, inset: 5pt, radius: 3pt, )[ #name #h(1fr) #decs #v(1em, weak: true) #contrib ] } } } #let common-achievement(name, decs, contrib) = { context { if show-common-state.get() { box(stroke: 1pt, inset: 5pt, radius: 3pt)[ #name #h(1fr) #decs #v(1em, weak: true) #contrib ] } } } #let achievement(primary: false, name, decs, contrib) = { if primary { primary-achievement(name, decs, contrib) } else { common-achievement(name, decs, contrib) } } #let resume-section(primary: true, name, decs, contrib) = { achievement(primary: primary, name, decs, contrib) } #let link-fn(base) = { let _link(dest, body) = { link(strfmt("{}/{}", base, dest))[#body] } _link } #let grid-fn( columns: auto, align: auto, column-gutter: auto, row-gutter: 6pt, processor: it => it, ) = { let _grid(..content) = { let processed-content = content.pos().map(processor) grid( columns: columns, rows: auto, column-gutter: column-gutter, row-gutter: row-gutter, align: align, ..processed-content.flatten(), ) } _grid } #let github(repo, body: none) = { if body == none { body = repo } link-fn("https://github.com")(repo, body) }
https://github.com/0x1B05/algorithm-journey
https://raw.githubusercontent.com/0x1B05/algorithm-journey/main/practice/note/content/Morris遍历.typ
typst
#import "../template.typ": * #pagebreak() = 二叉树 Morris 遍历 时间复杂度 O(n),空间复杂度 O(1) 通过利用袁术中大量空闲指针的方式,达到节省空间的目的 == 遍历细节 假设来到当前节点 cur,开始时 cur 在头节点 1. 若 cur 没有左孩子,cur 向右移动(`cur = cur.right`) 2. 若 cur 有左孩子,找到左子树上最右的节点 mostRight 1. 若 mostRight 的右指针指向空,让其指向 cur,然后 cur 向左移动(`cur = cur.left`) 2. 若 mostRight 的右指针指向 cur,让其指向 null,然后 cur 向右移动(`cur = cur.right`) 3. cur 为空时停止遍历 举例: #image("./images/2022-03-30-18-06-16.png") 1->2->3->2->5->2->3->6->3->7 前序遍历:只经过一次的直接打印.二次经过的,打印第一次 中序遍历:只经过一次的直接打印.二次经过的,打印第二次 后序遍历:先逆序打印左树右边界,最后再逆序打印整个右边界. when 递归套路?需要第三次信息(左树信息,右树信息,再整合)的强整合. when Morris?没有第三次信息的强整合. 例如搜索二叉树. 时间复杂度分析: 左子树的右边界总代价最多 O(n)
https://github.com/SeniorMars/tree-sitter-typst
https://raw.githubusercontent.com/SeniorMars/tree-sitter-typst/main/examples/compute/construct.typ
typst
MIT License
// Test creation and conversion functions. // Ref: false --- // Compare both ways. #test(rgb(0%, 30%, 70%), rgb("004db3")) // Alpha channel. #test(rgb(255, 0, 0, 50%), rgb("ff000080")) // Test color modification methods. #test(rgb(25, 35, 45).lighten(10%), rgb(48, 57, 66)) #test(rgb(40, 30, 20).darken(10%), rgb(36, 27, 18)) #test(rgb("#133337").negate(), rgb(236, 204, 200)) #test(white.lighten(100%), white) --- // Test gray color conversion. // Ref: true #stack(dir: ltr, rect(fill: luma(0)), rect(fill: luma(80%))) --- // Error for values that are out of range. // Error: 11-14 number must be between 0 and 255 #test(rgb(-30, 15, 50)) --- // Error: 6-11 color string contains non-hexadecimal letters #rgb("lol") --- // Error: 5-7 missing argument: red component #rgb() --- // Error: 5-11 missing argument: blue component #rgb(0, 1) --- // Error: 21-26 expected integer or ratio, found boolean #rgb(10%, 20%, 30%, false) --- // Ref: true #let envelope = symbol( "🖂", ("stamped", "🖃"), ("stamped.pen", "🖆"), ("lightning", "🖄"), ("fly", "🖅"), ) #envelope #envelope.stamped #envelope.pen #envelope.stamped.pen #envelope.lightning #envelope.fly --- // Test conversion to string. #test(str(123), "123") #test(str(50.14), "50.14") #test(str(10 / 3).len() > 10, true) --- // Error: 6-8 expected integer, float, label, or string, found content #str([]) --- #assert(range(2, 5) == (2, 3, 4))
https://github.com/khalilhannechi/Lab-1
https://raw.githubusercontent.com/khalilhannechi/Lab-1/main/Lab-1.typ
typst
#import "Class.typ": * #show: ieee.with( title: [Report Lab], /* abstract: [ #lorem(10). ], */ authors: ( ( name: "<NAME> ", department: [Dept. of EE], organization: [ISET Bizerte --- Tunisia], profile: "khalilhannechi", ), ( name: "<NAME>", department: [Dept. of EE], organization: [ISET Bizerte --- Tunisia], ), ) // index-terms: (""), // bibliography-file: "Biblio.bib", ) = Exercises The following exercises will help you practice various aspects of Julia, such as functions, loops, conditionals, arrays, and file processing. Remember to break down the exercises into smaller steps and test your code along the way. You are required to carry out this lab using either of: #figure( stack( dir: ltr, // left-to-right spacing: 1cm, // space between contents image("Images/Jupyter.png", width: 10%, fit: "contain"), image("Images/Pluto.svg", width: 50%, fit: "contain"), ), ) #exo[Fibonacci Sequence][Write a function that generates the Fibonacci sequence#footnote[The Fibonacci sequence starts with $0$ and $1$, and each subsequent number is the sum of the two preceding numbers.] up to a given number $n$.] // The function should return an array of the Fibonacci sequence. For example, if $n = 10$, the function should return $[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]$. $F_(0) = 0 \ F_(1) = 1 \ F_(n) = F_(n-1)+F_(n-2) quad forall n >= 2$ ```julia Fibonacci Sequence (n::Int) if n <= 1 return n if n>=2 return Fibonacci Sequence(n-1) + Fibonacci Sequence(n-2) end end ``` #test[Display the Fibonacci sequence if $n=16$.] #exo[Prime Number][Write a function that determines if a given number $n$ is prime#footnote[A prime number is a number greater than $1$ that has no positive divisors other than $1$ and itself.]. The function should return true if the number is prime and false otherwise.] ```julia function is_prime(n) if n <= 1 # Numbers less than or equal to 1 are not prime return false end if n <= 3 # 2 and 3 are prime return true end if n % 2 == 0 || n % 3 == 0 # Any number divisible by 2 or 3 (besides 2 and 3) is not prime return false end i = 5 while i * i <= n # Check divisibility up to the square root of n if n % i == 0 || n % (i + 2) == 0 return false end i += 6 # Optimization: Only check numbers of the form 6k ± 1 end return true end # Test the function println(is_prime(5)) # Output: true println(is_prime(8)) # Output: false ``` #test[Give the list of prime numbers less than $100$.] #exo[Palindrome][Write a function that checks if a given string is a palindrome#footnote[A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward.]. The function should return true if the string is a palindrome and false otherwise.] ```julia function fibonacci(n::Int) if n <= 1 return n end a, b = 0, 1 # Initialize first two Fibonacci numbers for _ in 2:n c = a + b a, b = b, c # Update the previous two numbers end return c end # Display Fibonacci sequence for n = 16 n = 16 for i in 1:n println(fibonacci(i-1)) # Print each Fibonacci number (0-based indexing) end ``` #test[Check the sentence "Was it a car or a cat I saw?". Disregard spaces and punctuation marks.] #exo[Matrix Operation][Implement functions to perform basic matrix operations such as matrix addition, matrix multiplication, and determinant calculation.] ```julia # Function for matrix addition (assuming matrices have the same dimensions) function matrix_add(A::Matrix, B::Matrix) if size(A) != size(B) error("Matrices must have the same dimensions for addition") end rows, cols = size(A) C = zeros(rows, cols) for i in 1:rows for j in 1:cols C[i, j] = A[i, j] + B[i, j] end end return C end ``` #test[Test your functions with the following matrices ```julia A = [1 2; 3 4] B = [5 6; 7 8] ``` ] #exo[File Processing][Write a program that reads a text file and counts the occurrences of each word. Display the word count for each unique word in the file.] ```julia function count_words(text::String) # Open the text file for reading file = open(teaxt.txt) # Initialize an empty dictionary to store word counts word_counts = Dict{String, Int}() # Split the line into word words = split(lowercase(replace(line, r"^\W+", "")), r"\W+").filter(x -> x != "") # Add word counts to the dictionary for word in words word_counts[word] = get(word_counts, word, 0) + 1 end end # Display word counts println("Word Counts:") for (word, count) in word_counts println("$word: $count") end end # Example usage: Replace "your_file.txt" with the actual file path count_words("your_file.txt") ``` #test[Redirect the output of 'man ls' command to a dummy file and display the word count for 'ls' ```bash man ls > dummy ``` ]
https://github.com/iceghost/resume
https://raw.githubusercontent.com/iceghost/resume/main/4-skills.typ
typst
== Skills #block[ === Web Development I am experienced at fullstack web development. I have worked with various web frameworks, notably Svelte/SvelteKit and Tailwind CSS, and mostly used TypeScript. ] #block[ === System Programming I gained experience in low-level programming from my university courses, such as manual memory management and network programming. I am comfortable with C++ and Rust. ] #block[ === Toolings I have knowledge on how to use tools to enhance my workflow, such as Docker, Git, GitHub and GitHub Actions. ]
https://github.com/p4perf4ce/typst-ieee-trans-template
https://raw.githubusercontent.com/p4perf4ce/typst-ieee-trans-template/main/ieee-trans/main.typ
typst
Do What The F*ck You Want To Public License
#import "template.typ": * #show: ieee.with( title: [Preparation of Papers for IEEE #smallcaps[Transactions] and #smallcaps[Journals] (_February_ 2022)], journal-name: "IEEE TRANSACTIONS AND JOURNALS TEMPLATE", abstract: [ The process of scientific writing is often tangled up with the intricacies of typesetting, leading to frustration and wasted time for researchers. In this paper, we introduce Typst, a new typesetting system designed specifically for scientific writing. Typst untangles the typesetting process, allowing researchers to compose papers faster. In a series of experiments we demonstrate that Typst offers several advantages, including faster document creation, simplified syntax, and increased ease-of-use. ], authors: ( ( name: "<NAME>", membership: [Student Member,~IEEE], department: [Engineering Dept.], organization: [The Institute], location: [Boston, NY, USA], email: "<EMAIL>" ), ( name: "<NAME>", membership: [Member,~IEEE], department: [Engineering Dept.], organization: [The Institute], location: [Boston, NY, USA], email: "<EMAIL>" ), ( name: "<NAME>", membership: [Senior Member,~IEEE], department: [Engineering Dept.], organization: [The Institute], location: [Boston, NY, USA], email: "<EMAIL>" ), ( name: "<NAME>", membership: [Fellow,~IEEE], department: [Engineering Dept.], organization: [The Institute], location: [Boston, NY, USA], email: "<EMAIL>" ), ), index-terms: ("Scientific writing", "Typesetting", "Document creation", "Syntax"), bibliography-file: "refs.bib", ) // This should be #thanks #footnote(numbering: it => "")[ #par(justify: true, first-line-indent: 1em)[ _This paragraph of the first footnote will contain the date on which you submitted your paper for review. It will also contain support information, including sponsor and financial support acknowledgment. For example, “This work was supported in part by the U.S. Department of Commerce under Grant 123456.”_ _The next few paragraphs should contain the authors’ current affiliations, including current address and e-mail. For example, First A. Author is with the National Institute of Standards and Technology, Boulder, CO 80305 USA (e-mail: <EMAIL>)._ _Second B. Author Jr. was with Rice University, Houston, TX 77005 USA. He is now with the Department of Physics, Colorado State University, Fort Collins, CO 80523 USA (e-mail: <EMAIL>). Third C. Author is with the Electrical Engineering Department, University of Colorado, Boulder, CO 80309 USA, on leave from the National Research Institute for Metals, Tsukuba, Japan (e-mail: <EMAIL>)_ ] ] = Introduction Scientific writing is a crucial part of the research process, allowing researchers to share their findings with the wider scientific community. However, the process of typesetting scientific documents can often be a frustrating and time-consuming affair, particularly when using outdated tools such as LaTeX. Despite being over 30 years old, it remains a popular choice for scientific writing due to its power and flexibility. However, it also comes with a steep learning curve, complex syntax, and long compile times, leading to frustration and despair for many researchers.@netwok2020 == Paper overview In this paper we introduce Typst, a new typesetting system designed to streamline the scientific writing process and provide researchers with a fast, efficient, and easy-to-use alternative to existing systems. Our goal is to shake up the status quo and offer researchers a better way to approach scientific writing. @netwok2021 By leveraging advanced algorithms and a user-friendly interface, Typst offers several advantages over existing typesetting systems, including faster document creation, simplified syntax, and increased ease-of-use. To demonstrate the potential of Typst, we conducted a series of experiments comparing it to other popular typesetting systems, including LaTeX. Our findings suggest that Typst offers several benefits for scientific writing, particularly for novice users who may struggle with the complexities of LaTeX. Additionally, we demonstrate that Typst offers advanced features for experienced users, allowing for greater customization and flexibility in document creation. Overall, we believe that Typst represents a significant step forward in the field of scientific writing and typesetting, providing researchers with a valuable tool to streamline their workflow and focus on what really matters: their research. In the following sections, we will introduce Typst in more detail and provide evidence for its superiority over other typesetting systems in a variety of scenarios. = Methods #lorem(90) $ a + b = gamma $ #lorem(200) = Results #lorem(450) = Conclusion #lorem(300)
https://github.com/VadimYarovoy/CourseWork
https://raw.githubusercontent.com/VadimYarovoy/CourseWork/main/template.typ
typst
#let project( type: "", // name: "", subject: "", abstract: [], authors: (), logo: none, body ) = { // Set the document's basic properties. set document(author: authors.map(a => repr(a.name)).join(", "), title: type) set text(font: "Liberation Serif", lang: "ru") show math.equation: set text(weight: 400) set heading(numbering: none) set par(justify: true) set page(paper: "a4", margin: (left:3cm, right:1.5cm, top:2cm, bottom:2cm), ) // v(0.0fr) align(center)[ #text(1.25em, weight: 200, "Санкт-Петербургский политехнический университет Петра Великого") \ #text(1.25em, weight: 200, "Институт компьютерных наук и кибербезопасности") \ #text(1.25em, weight: 200, "Высшая школа программной инженерии") ] // Title page. v(8cm) align(center)[ #text(2em, weight: 500, type) \ // #v(0.1cm) #text(1.15em, weight: 100, "по теме") #text(1.15em, weight: 100, subject) \ \ #text(1.3em, weight: 100, "Вариант 20") ] //Author information. v(5cm) pad( // top: 0.7em, authors.map(author => columns(2, [ #align(left)[#author.role] #colbreak() #align(right)[#author.name] ]) ).join(), ) v(1fr) align(center)[ #text(1.25em, weight: 200, "Санкт-Петербург \n 2023") ] pagebreak() pagebreak() // Table of contents. outline(depth: 3, indent: true, title: "Оглавление") pagebreak() // Main body. set page(numbering: "1", number-align: center) set par(first-line-indent: 20pt) counter(page).update(4) set heading(numbering: "1.1") body }
https://github.com/ntjess/typst-drafting
https://raw.githubusercontent.com/ntjess/typst-drafting/main/docs/overview/main.typ
typst
The Unlicense
#import "/drafting.typ" as drafting: * #import "../utils.typ": dummy-page #import "@preview/showman:0.1.1" #show <example-output>: set text(font: "Linux Libertine") #let template(doc) = { showman.formatter.template( // theme: "dark", eval-kwargs: (direction: ttb, scope: (drafting: drafting), unpack-modules: true), doc ) } #show: template #set page( margin: (right: 2in, y: 0.8in), paper: "us-letter", height: auto, ) #set-page-properties() #include("content.typ")
https://github.com/juruoHBr/typst_xdutemplate
https://raw.githubusercontent.com/juruoHBr/typst_xdutemplate/main/main.typ
typst
#import "template.typ": * #show: xdudoc.with( fonts: (:), fontsize : 12pt, factor: 1.5, ) #let info = ( title : "某雷达脉压模块与实测数据的分析软件设计", covertitle : "某雷达脉压模块与实测数据的\n分析软件设计", school: "电子工程学院", major: "电子信息工程", name : "郑XX", class : [2101010], tutor : "陈XX", number : "21009100000" ) #cover(info: info) #front-matter(title: info.title)[ #abstract[ 本文结合某阵列雷达开展两方面的研究工作:一是对该雷达实测数据,利用MATLAB图形用户界面(GUI)开发实测数据的分析软件包,实现对实测数据的脱机处理。该软件能实现脉冲压缩、MTI、非相干积累、恒虚警检测等处理,同时具有良好的人机界面,使用灵活方便。二是利用“魂芯”数字信号处理器(BWDSP100)的Demo开发板设计脉冲压缩和链路口的DSP程序,并与其他DSP(TS201)比较,分析DSP处理程序的实时性。另外,设计开发板上的FPGA(EP2C35)的控制逻辑和时序,实现从链路口到FPGA再到串行D/A变换器之间的数据传输,从而通过示波器就可以直观观察脉压处理的结果。 #h(-2em) *关键词* 脉冲压缩 图形用户界面(GUI) 数字信号处理器 DSP程序 脱机分析软件 ][ The paper based on array radar to carry out two aspects of research: The first part of the work is to develop the measured data analysis software package with the help of MATLAB graphical user interface (GUI) and do off-line processing. The software is able to achieve pulse compression, MTI, non-coherent accumulation, CFAR, and also has good man-machine interface, using flexible and convenient. The second part of the work is to design the DSP pulse compression and link port transmission program. With the help of "Brain Ware digital signal processor (BWDSP100)” on the Demo development Board, we finished the work successfully. The processing time of BWDSP100 is estimated and compared with other DSP (TS201) to do the DSP computation time analysis. In addition, we design the control logic and timing of the FPGA (EP2C35) on the Demo development Board. The data is exported to FPGA through the link port and transferred to the serial D/A converter, thus the results of pulse compression can be directly observed on the oscilloscope. #h(-2em) *keywords* PC (Pulse Compression) GUI (Graphical User Interface) DSP Program Off-line Analysis Software ] #thesis-contents() ] // #mainbody(title: info.title)[ = 这是第一章 #lorem(1000) #strong[] $ f=1 $ == 这是第一小节 === 这是第一小小节 $ f=1 $<cc> dddsdfasdf @cc #figure( rect(width: 5cm, height: 5cm), caption: [ddd] ) sdfs #figure( table([1],[2]), caption: [dd] )<dd> @dd = 测试 测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试 #kai[#text(20pt)[楷体]] 测试测试 $ g=1 $ == 测试 测试测测试 #figure( rect(width: 5cm, height: 5cm), caption: [ddd] ) sdfs #figure( table([1],[2]), caption: [dd] ) = 第三章 第三章 ] #after-matter()[ #bibliography("ref.bib") = 致谢 测试 #appendix[ = ddd #figure( rect(width: 5cm, height: 5cm), caption: [测试] ) $ f + g $ ] ]
https://github.com/davawen/Cours
https://raw.githubusercontent.com/davawen/Cours/main/Physique/Electricité/electricite.typ
typst
#import "@local/physique:0.1.0": * #import "@preview/bob-draw:0.1.0": render #import elec: * #show: doc => template(doc) #titleb[Introduction à l'électricité] = Historique (Voir poly) = Mouvements de porteurs de charge == Electrisation Phénomène qui permet de faire apparaître des charges par frottement ou déplacement, qui vont notemment appliquer des forces en utilisant la force de Coulomb: $ arw(f)_(1->2) = 1/(4pi epsilon_0) (q_1 q_2)/(M_1 M_2)^3 arw(M_1 M_2) $ Avec $M_1$, $M_2$ les positions des particules, $q_1$, $q_2$ leur charge. «D'un point de vue, on a $1/(4 pi epsilon_0)$» La force de Coulomb peut être attractive ou répulsive suivant le produit des charges. == Notion de charge électrique La charge électrique est dîte: - Scalaire, c'est un nombre (et pas un vecteur) - Conservative, la quantité totale de charge dans un système fermé reste la même - Invariante, quel que soit le référentiel, la charge aura la même mesure - Quantifiée, $q = plus.minus Z e $ avec $Z$ un entier, et $e$ la charge élémentaire ($approx 1.6 dot 10^(-19)$) Les échanges de charges ne sont pas continus, on ne peut pas ajouter ou retirer moins de $e$ charge électrique. - Extensive, on peut prendre un système, le sub-diviser en sous-systèmes, chacun ayant sa propre charge, et la charge du système sera la sommes charges des sous-systèmes. - Signé, le choix du signe en lui même est arbitraire et est une convention. Les électrons ont une charge négative, et les protons ont une charge positive. == Porteurs de charge On a différents moyens de transporter des charges: - Les électrons dans les métaux qui se déplacent dans les lattices. - les ions (anions ou cations) permettent d'assurer la conduction dans les solutions - Les électrons dans le plasma (milieu ionisé) - Dans les semi-conducteurs: - Par des électrons qui se déplacent et qui crée des charges négatives (dopés N) - Par des trous (manque d'électrons) qui se déplacent et qui crée des charges positives (dopés P) Les porteurs de charges sont soumis à des mouvements: == Mouvement microscopique ou agitation thermique N'importe qu'elle particule va être soumis à un mouvement d'agitation thermique. Plus la température est élevée, plus l'agitation est "intense". Ce mouvement est désordonné et nul en moyenne. Il va créer des micro-courants de manière constante, mais on ne peut pas l'utiliser pour faire transiter de l'énergie à l'échelle macroscopique. On reviendra sur ce mouvement en Thermodynamique. == Mouvement d'ensemble On parle de mouvement d'ensemble quand on a un même déplacement pour de nombreuses particules. On va s'intéresser plus particulier aux mouvements d'ensemble d'origine électrique. Si on place de nombreuses charge dans un même champ électrique, toutes les charges subiront le même mouvement #sym.arrow mouvement d'ensemble électrique. $ arw(f)_(1->2) = q_2 underbrace((1/(4 pi epsilon_0) q_1/(M_1 M_2)^3) arw(M_1 M_2), arw(E)(M_2)) $ $ arw(f)_(1->2) = q_2 arw(E)(M_2) $ On pose $arw(E)(M_2)$ le champ électrique en $M_2$. On va principalement utiliser les mouvement résultant de ce genre de champs. = Courant électrique == Définition #def[Courant électrique]: Le déplacement des charges électriques dans un fil sous l'action d'un champ électrique #figure(canvas({ import draw: * line((-0.5, 1.3), (0.5, 1.3), mark: (end: "straight"), name: "E") content("E.50%", $arw(E)$, anchor: "south", padding: 3pt) line((-3, -1), (3, -1)) line((-3, 0.8), (3, 0.8)) point((0, 0), value: $q > 0$, color: yellow) line((0, -0.2), (1, -.2), mark: (end: "straight"), name: "f", stroke: yellow) content("f.end", $arw(f) = q arw(E)$, anchor: "west") line((0, -0.5), (1.5, -0.5), mark: (end: "straight"), name: "v", stroke: red) content("v.end", $arw(v)$, anchor: "north-west") })) == Sens conventionnel Le courant possède un sens conventionnel arbitraire: il est opposé au sens des électrons #figure(canvas({ import draw: * line((-0.5, 1.3), (0.5, 1.3), mark: (end: "straight"), name: "E") content("E.50%", $arw(E)$, anchor: "south", padding: 3pt) line((-3, -1), (3, -1)) line((-3, 0.8), (3, 0.8)) point((0, 0), value: $e$, color: yellow) line((0, -0.2), (-1, -.2), mark: (end: "straight"), name: "f", stroke: yellow) content("f.end", $arw(f) = q arw(E)$, anchor: "east") line((0, -0.5), (-1.5, -0.5), mark: (end: "straight"), name: "v", stroke: red) content("v.end", $arw(v)$, anchor: "north-east") line((1, 0), (2.5, 0), mark: (end: "straight"), stroke: (dash: "dashed"), name: "sens") content("sens.end", [sens conventionnel \ du courant], anchor: "west") })) == Intensité On appelle la grandeur $I$ l'intensité du courant électrique, exprimée par la mesure du débit des particules. C'est à dire, le nombre de charge qui traverse une section $S$ du fil, par unité de temps. #let dq = $dif q$ On peut donc définir $I$ par: $ I = (dif q)/(dif t) $ Avec $dif q$ la quantité de charges ayant traversé la section, et $dif t$ l'interval de temps. #warn[ L'intensité peut-être négative! \ Si les électrons ne se déplacent pas dans le sens prévu, l'intensité mesurée sera négative (débit en sens inverse). ] == Ordre de grandeur des intensités On peut travailler avec une très large gamme d'intensité: - À la maison: $approx 10 "A"$ - En électronique (transistors, circuits intégrés, capaciteurs): du pA à $approx 10 "mA"$ - Dans l'industrie électrique: du kA au centaines de kA. = Tension et potentiel == Définition #def[Tension]: Différence de potentiel entre deux points sur un circuit. On mesure la tension d'un point par rapport à un point de référence (le port COM sur un voltmètre). On note $U_(B A)$ la tension de $A$ vers $B$, avec: $ U_(B A) = V_B - V_A = -U_(A B) $ #figcan({ serie((0, 0), left: "A", right: "B", name: "D", apply(resistor, u: tenselr($U_(A B)$)) ) tension("D.l", "D.r", (0, 0.6), tenserl($U_(B A)$)) }) == Ordre de grandeur des tensions - Potentiel d'action (nom donné à la tension en biologie...): $75 "mV"$ - Piles électriques: quelques volts - Tension du secteur: de $120$ à $250$ V - Réseau de distribution: $500$ V, $10 "kV"$, $125 "kV"$ - Foudre: $100 "MV"$ == Références de potentiels, Masse et Terre #def[Masse]: origine des potentiels (le point de référence dit plus haut) #def[Terre]: conducteur Terre auxquels sont reliées les carcasses des appareils pour des raisons de sécurités souvent pris comme masse On se sera souvent tenté de prendre la Masse à la Terre. Quand tout les éléments sont reliés à la Terre, tout ces éléments ont déjà un potentiel commun. #warn[Il faut faire bien attention quand on place la Terre: on peut court-circuiter des éléments en la plaçant à deux endroits à la fois ] #figcan({ resistor((1, 0), name: "d1") resistor((2, -1), rot: 90deg, name: "d2") resistor((0, -1), rot: 90deg, name: "d3") ground((2, -2), name: "g") fil("d1.l", "d3.r", "d1.r", "d2.r", "d2.l", "g", "g", "d3.l") }) Si on place une autre terre: #figcan({ resistor((1, 0), name: "d1") resistor((2, -1), rot: 90deg, name: "d2") resistor((0, -1), rot: 90deg, name: "d3") ground((2, -2), name: "g") ground((0, 0), rot: -90deg, name: "g2") fil("d1.l", "d3.r", "d1.r", "d2.r", "d2.l", "g", "g", "d3.l") }) Par contre, on peut: #figcan({ resistor((1, 0), name: "d1") resistor((2, -1), rot: 90deg, name: "d2") resistor((0, -1), rot: 90deg, name: "d3") ground((2, -2), name: "g") ground((0, -2), name: "g2") fil("d1.l", "d3.r", "d1.r", "d2.r", "d2.l", "g", "g", "d3.l") }) = Approximation des régimes quasi-stationnaires (#smallcaps[ARQS]) == Régime continu #def[Régime continu]: Toutes les grandeurs (électriques) sont constantes au cours du temps: 1. Toutes les intensités 2. Toutes les tensions Par exemple, dans un régime continu, si on mesure la tension entre deux dipôles, elle restera la même durant l'entièreté de la vie du circuit. == Régime variable #def[Régime variable]: Grandeurs électriques variables au cours du temps == ARQS La question va être: dans un régime variable, peut-on continuer à appliquer les lois valides dans un régime continu? Si on change un paramètre dans un circuit, l'information ne se propage pas de manière instantané. Il y aura donc un temps de propagation entre la source des variations et le reste du circuit. \ On va comparer deux temps: - $tau$, le temps de propagation de l'information dans le circuit - $T$, le temps caractéristique du régime variable On va se placer dans l'approximation des régimes quasi-stationnaires quand $tau << T$ Autre manière de le voir: les signaux électriques (électromagnétiques donc) se propagent à la vitesse de la lumière. On peut donc utiliser une notion de distance plutôt que de temps: - $L = c tau$, la longueur du circuit - $lambda = c T$, La longueur caractéristique du circuit On se place dans l'ARQS quand $L << lambda$. En pratique, en électricité, on l'applique tout le temps. == Régime continu, permanent, ou transitoire Deux grandes catégories de régimes: 1. Stationnaire / permanent 2. Transitoire Un régime sera dit stationnaire ou permanent si les *caractéristiques du signal* seront constantes au cours du temps. Par exemple: si on a un signal (intensité ou tension à un point du circuit) sinusoïdale, défini donc par: $ s(t) = S cos(omega t + phi) $ Avec $S$ l'amplitude, $omega$ la pulsation et $phi$ la phase initiale. #def[Régime quasi-stationnaire]: Le signal est trivialement variable, mais si ces caractéristiques restent constantes, il sera dit stationnaire/permanent. En général, un signal avec une période et une amplitude constante sera dit stationnaire. Un régime continu est stationnaire, mais un régime stationnaire ne sera pas toujours continu. Tout ce qui n'est pas stationnaire ou permanent sera dit transitoire. #def[Temps caractéristique de charge du condensateur]: ordre de grandeur du régime transitoire de charge du condensateur = <NAME> == Terminologie des circuits #figcan({ serie((0, 0), name: "D", left: "A", right: "C", apply(resistor, label: $X$), apply(resistor) ) node((0, 0), offset: (0, 0.8em), name: "B", round: true) resistor((0, -1.5), rot: -90deg, name: "d1") node((0, -3), offset: (0, -0.8em), name: "E", round: true) serie((0, -3), left: "D", right: "F", name: "D2", apply(resistor), apply(resistor) ) node((0, -4), offset: (0, -0.8em), name: "G", round: true) serie((0, -4), name: "D3", apply(resistor), apply(resistor)) resistor((1.5, -1.5), rot: 45deg, name: "d2") fil((-2.725, 0), (-2.725, -4)) fil((2.725, 0), (2.725, -4)) fil("B", "d1.l", "d1.r", "E") fil("E", "d2.l", "d2.r", (2.725, 0), straight: false) }) #def[Dipôle]: Un élément qui a deux bornes \ Exemple: $X$ #def[Nœud]: Point où sont connectés plus de deux dipoles ($>= 3$) \ Exemples: $B, C, D, E, F$ #def[Branche]: Portion de circuit entre deux nœuds successifs \ Exemples: $B A D, E F, C F, G D$ #def[Maille]: Ensemble de branches partant d'un nœud pour revenir à ce nœud, *sans paser deux fois par la même branche*. \ En clair: on part d'un point, et on fait une boucle pour revenir au même point. \ Exemples: $E B C F, D A B E, E B C, E C F$ #note[Un même circuit a plusieurs représentation équivalentes. Utiliser celle qui marche le mieux pour soi.] == Loi des nœuds Dans un régime continu: #resultb[*La somme des intensités sortant d'un nœud est égale à la somme des intensités entrantes* $ sum_k epsilon_k i_k = 0 $ Avec: $ epsilon_k = cases(1 "si ik arrive", -1 "si ik part") $ ] #figcan({ node((0, 0), round: true, name: "N") fil((-2, 0), "N", i: $i_1$) fil((-2, 2), "N", i: $i_2$, straight: false) fil((2, -2), "N", i: $i_4$, straight: false) fil((-2, -2), "N", i: $i_6$, straight: false) fil("N", (0, 2), i: $i_3$, straight: false) fil("N", (0, -2), i: $i_5$, straight: false) }) $ i_1 + i_2 + i_4 + i_6 = i_3 + i_5 $ == Loi des mailles Dans un régime continu et dans une maille: #resultb[*La somme des potentiels dans le sens de la maille est égale à la somme des potentiels dans le sens inverse à la maille.* $ sum_k epsilon_k u_k = 0 $ Avec: $ epsilon_k = cases(+1 "si uk dans le sens de la maille", -1 "si uk dans le sens opposé à la maille") $ ] #figcan({ node((-3, 0), name: "A") node((0, 0), name: "B") node((3, 0), name: "C") node((3, -2), name: "D") node((0, -4), name: "F") node((-3, -4), name: "G") resistor((-1.5, 0), name: "d1", u: tenselr($u_1$)) resistor((1.5, 0), name: "d2", u: tenserl($u_2$)) resistor((3, -1), rot: -90deg, name: "d3") resistor((3, -3), rot: -90deg, name: "d4") resistor((-1.5, -4), name: "d5") resistor((1.5, -4), name: "d6") resistor((-3, -2), rot: -90deg, name: "d7") fil("A", "d1.l", "d1.r", "d2.l", "d2.r", "C") fil("C", "d3.l", "d3.r", "d4.l", "d4.r", "d6.r", rev: 1) fil("d6.l", "d5.r", "d5.l", "d7.r", "d7.l", "A") }) $ u_1 + u_4 + u_7 = u_2 + u_3 + u_5 + u_6 $ $ $ == <NAME> #def[Lois de Kirchhoff]: 1. Lois des nœuds 2. Lois des mailles = Puissance == Définition Résultat parachuté: $ cal(P) = u dot i $ si $u$ et $i$ de sens opposés. #let different(s) = figcan({ draw.scale(s) resistor((0, 0), name: "D", u: tenserl($u$)) node((-1.5, 0), name: "A") node((1.5, 0), offset: (0.5em, 0.8em), name: "B") fil("A", "D.l", i: $i$) fil("D.r", "B", i: $i'$) }) #different(1) Preuve: On a (définition de l'intensité): $ i = (dif q)/(dif t) $ Autrement dit: $ dif q = i dif t $ L'énergie affectée au dipôle en A peut être notée: $ V_A dif q = V_A i dif t $ Et l'énergie affectée au dipôle en B: $ V_B dif q = V_B i dif t $ On a la variation d'énergie définie par l'énergie apportée moins l'énergie perdue: $ dif E = underbrace(V_A i dif t, "affectée") - underbrace(V_B i dif t, "perdue") = i dif t underbrace((V_A - V_B), "tension") $ $ dif E = u i dif t $ On sait que la puissane est $"energie"/"durée"$, donc: $ cal(P) = (dif E)/(dif t) = u dot i $ == Récepteurs ou générateurs On a $cal(P) = u dot i$ la puissance #text(fill: red)[reçue] On peut se retrouver dans une tension dans le même sens que l'intensité: #let same(s) = figcan({ draw.scale(s) resistor((0, 0), name: "D", u: tenselr($u'$)) node((-1.5, 0), name: "A") node((1.5, 0), name: "B") fil("A", "D.l", i: $i$) fil("D.r", "B", i: $i'$) }) #same(1) On a $u' = -u$ et $i' = i$, donc $ cal(P) = u dot i = (- u') dot i' = -u' i' $ On peut arranger les résultats dans un tableau: #align(center, table( inset: 0.7em, columns: 4, table.header([], [Puissance reçue], [Puissance fournie], [Convention]), [#different(0.5)], $u times i$, $-u times i$, [récepteur], [#same(0.5)], $-u' times i$, $u' times i$, [générateur] )) == Ordres de grandeurs - milliwatt : laser d’un CD-ROM 5 mW, laser d’un graveur de CD-ROM 100 mW, diode életroluminescente LED 36 mW - du watt au kilowatt : radio-transmetteur portatif 5 W, cerveau humain de 20 à 40 W, lampe à incandescence 40-100 W, sortie d’un panneau solaire photovolta¨ıque 150 W, puissance d’un PC 300-400 W - supérieur au kilowatt : bouilloire électrique 1-2 kW, flash d’un appareil photographique amateur 12 kW, éolienne (rotor de 40 m de diamètre et un vent de 43 km.h−1) 500 kW - mégawatt : ordinateur le plus puissant en 2012 : barrage 100 MW, usine marémotrice de la Rance 240 MW, réacteur nucléaire 900 MW - gigawatt : réacteur d’une centrale nucléaire 1 GW• milliwatt : laser d’un CD-ROM 5 mW, laser d’un graveur de CD-ROM 100 mW, diode életroluminescente LED 36 mW - du watt au kilowatt : radio-transmetteur portatif 5 W, cerveau humain de 20 à 40 W, lampe à incandescence 40-100 W, sortie d’un panneau solaire photovolta¨ıque 150 W, puissance d’un PC 300-400 W - supérieur au kilowatt : bouilloire électrique 1-2 kW, flash d’un appareil photographique amateur 12 kW, éolienne (rotor de 40 m de diamètre et un vent de 43 km.h−1) 500 kW - mégawatt : ordinateur le plus puissant en 2012 : barrage 100 MW, usine marémotrice de la Rance 240 MW, réacteur nucléaire 900 MW - gigawatt : réacteur d’une centrale nucléaire 1 GW
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/fuzzers/corpora/layout/par-indent_00.typ
typst
Apache License 2.0
#import "/contrib/templates/std-tests/preset.typ": * #show: test-page #set par(first-line-indent: 12pt, leading: 5pt) #set block(spacing: 5pt) #show heading: set text(size: 10pt) The first paragraph has no indent. But the second one does. #box(image("/assets/files/tiger.jpg", height: 6pt)) starts a paragraph, also with indent. #align(center, image("/assets/files/rhino.png", width: 1cm)) = Headings - And lists. - Have no indent. Except if you have another paragraph in them. #set text(8pt, lang: "ar", font: ("Noto Sans Arabic", "Linux Libertine")) #set par(leading: 8pt) = Arabic دع النص يمطر عليك ثم يصبح النص رطبًا وقابل للطرق ويبدو المستند رائعًا.
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/layout/spacing-02.typ
typst
Other
// Test RTL spacing. #set text(dir: rtl) A #h(10pt) B \ A #h(1fr) B
https://github.com/Isaac-Fate/booxtyp
https://raw.githubusercontent.com/Isaac-Fate/booxtyp/master/src/theorems/corollary.typ
typst
Apache License 2.0
#import "./new-theorem-template.typ": new-theorem-template #let corollary = new-theorem-template("Corollary")
https://github.com/TheRiceCold/resume
https://raw.githubusercontent.com/TheRiceCold/resume/main/modules/experience.typ
typst
#import "../src/template.typ": * #show link: underline #cvSection("Experience") #cvEntry( society: [Proudcloud], logo: "../src/logos/proudcloud.png", title: [Full-Stack Software Engineer], date: [2022, 2023], location: [Remote], description: list( [Project: #link("https://www.ragebite.com/work/playbeyond")[PlayBeyond] - Esports platform to host leagues powered by logitech], [Helped facilitate CI/CD workflows using Jenkins.], [Managed two web clients (players and admin) using javascript, vuejs, and jquery.], [Debugging with nodejs and mongodb backend, as well as building test scripts for the API, including SSO, JWT authentication, etc.], [Project: #link("https://www.medifi.com/")[Medifi] - Telemedicine platform, for patients to remotely connect with their doctors], [Deployment and release of web client, API, and mobile application.], [Maintained and update documentations, docker containers, and project packages.], [Improving, upgrading, and adding features to the Medifi cross-platform mobile app utilizing react native, graphl, and redux.], ) )
https://github.com/songoffireandice03/simple-template
https://raw.githubusercontent.com/songoffireandice03/simple-template/main/templates/latexcolors.typ
typst
#let latexcolors = ( airforceblue : rgb("#5c8aaa"), aliceblue : rgb("#f0f8ff"), alizarin : rgb("#d16a6a"), almond : rgb("#f0dacc"), amaranth : rgb("#e52b50"), amber : rgb("#ffbf00"), ambersaeece : rgb("#ff7e00"), americanrose : rgb("#ff033e"), amethyst : rgb("#9966cc"), anti-flashwhite : rgb("#f2f3f4"), antiquebrass : rgb("#cbac75"), antiquefuchsia : rgb("#915c83"), antiquewhite : rgb("#faebd7"), ao : rgb("#0000ff"), aoenglish : rgb("#008000"), applegreen : rgb("#8db600"), apricot : rgb("#fbceb1"), aqua : rgb("#00ffff"), aquamarine : rgb("#7fffd4"), armygreen : rgb("#4b5320"), arsenic : rgb("#3b4949"), arylideyellow : rgb("#e9d66b"), ashgrey : rgb("#b2beb5"), asparagus : rgb("#87a96b"), atomictangerine : rgb("#ff9966"), auburn : rgb("#6d351a"), aureolin : rgb("#fdee00"), aurometalsaurus : rgb("#6e7f80"), awesome : rgb("#ff2052"), azurecolorwheel : rgb("#007fff"), azurewebazuremist : rgb("#f0ffff"), babyblue : rgb("#89cff0"), babyblueeyes : rgb("#a1caf1"), babypink : rgb("#f4c2c2"), ballblue : rgb("#21abcd"), bananamania : rgb("#fae7b5"), bananayellow : rgb("#ffe135"), battleshipgrey : rgb("#848482"), bazaar : rgb("#98777b"), beaublue : rgb("#bcd4e6"), beaver : rgb("#9f8170"), beige : rgb("#f5f5dc"), bisque : rgb("#ffe4c4"), bistre : rgb("#3d2b1f"), bittersweet : rgb("#fe6f5e"), black : rgb("#000000"), blanchedalmond : rgb("#ffebcd"), bleudefrance : rgb("#318ce7"), blizzardblue : rgb("#ace5ee"), blond : rgb("#faf0be"), blue : rgb("#0000ff"), bluemunsell : rgb("#0093af"), bluencs : rgb("#0087bd"), bluepigment : rgb("#333399"), blueryb : rgb("#0247fe"), bluebell : rgb("#a2a2d0"), bluegray : rgb("#6699cc"), blue-green : rgb("#0095b6"), blue-violet : rgb("#8a2be2"), blush : rgb("#de5d83"), bole : rgb("#79443b"), bondiblue : rgb("#0095b7"), bostonuniversityred : rgb("#cc0000"), brandeisblue : rgb("#0070ff"), brass : rgb("#b5a642"), brickred : rgb("#cb4154"), brightcerulean : rgb("#1dacd6"), brightgreen : rgb("#66ff00"), brightlavender : rgb("#bf94e4"), brightmaroon : rgb("#c32148"), brightpink : rgb("#ff007f"), brightturquoise : rgb("#08e8de"), brightube : rgb("#d19fe8"), brilliantlavender : rgb("#f4bbff"), brilliantrose : rgb("#ff55a3"), brinkpink : rgb("#fb607f"), britishracinggreen : rgb("#004225"), bronze : rgb("#cd7f32"), browntraditional : rgb("#964b00"), brownweb : rgb("#a52a2a"), bubblegum : rgb("#ffc8cd"), bubbles : rgb("#e7feff"), buff : rgb("#f0dc82"), bulgarianrose : rgb("#480607"), burgundy : rgb("#800020"), burlywood : rgb("#deb887"), burntorange : rgb("#cc5500"), burntsienna : rgb("#e97451"), burntumber : rgb("#8a3324"), byzantine : rgb("#bd33a4"), byzantium : rgb("#702963"), cadet : rgb("#536872"), cadetblue : rgb("#5f9ea0"), cadetgrey : rgb("#91a3b0"), cadmiumgreen : rgb("#006b3c"), cadmiumorange : rgb("#ed872d"), cadmiumred : rgb("#e30022"), cadmiumyellow : rgb("#fff600"), calpolypomonagreen : rgb("#1e4d2b"), cambridgeblue : rgb("#a3c1ad"), camel : rgb("#c19a6b"), camouflagegreen : rgb("#78866b"), canaryyellow : rgb("#ffef00"), candyapplered : rgb("#ff0800"), candypink : rgb("#e25e6e"), capri : rgb("#00bfff"), caputmortuum : rgb("#592720"), cardinal : rgb("#c41e3a"), caribbeangreen : rgb("#00cc99"), carmine : rgb("#960018"), carminepink : rgb("#eb4c42"), carminered : rgb("#ff0038"), carnationpink : rgb("#ffd7ce"), carnelian : rgb("#b31b1b"), carolinablue : rgb("#99badd"), carrotorange : rgb("#ed9121"), ceil : rgb("#92a1cf"), celadon : rgb("#ace1af"), celestialblue : rgb("#4997d0"), cerise : rgb("#de3163"), cerisepink : rgb("#ec96a4"), cerulean : rgb("#007ba7"), ceruleanblue : rgb("#2a52be"), chamoisee : rgb("#a0785a"), champagne : rgb("#f7e7ce"), charcoal : rgb("#36454f"), chartreusetraditional : rgb("#dfff00"), chartreuseweb : rgb("#7fff00"), cherryblossompink : rgb("#ffb7c5"), chestnut : rgb("#cd5c5c"), chocolatetraditional : rgb("#7b3f00"), chocolateweb : rgb("#d2691e"), chromeyellow : rgb("#ffa700"), cinereous : rgb("#98817b"), cinnabar : rgb("#e34234"), cinnamon : rgb("#d2691e"), citrine : rgb("#e4d00a"), classicrose : rgb("#fbcce7"), cobalt : rgb("#0047ab"), cocoabrown : rgb("#d2691e"), columbiablue : rgb("#9bddff"), coolblack : rgb("#002e63"), coolgrey : rgb("#8c92ac"), copper : rgb("#b87333"), copperrose : rgb("#996666"), coquelicot : rgb("#ff3800"), coral : rgb("#ff7f50"), coralpink : rgb("#f88379"), coralred : rgb("#ff4040"), cordovan : rgb("#893f45"), corn : rgb("#fbec5d"), cornellred : rgb("#b31b1b"), cornflowerblue : rgb("#6495ed"), cornsilk : rgb("#fff8dc"), cosmiclatte : rgb("#fffeeb"), cottoncandy : rgb("#ffbcd9"), cream : rgb("#fffdd0"), crimson : rgb("#dc143c"), crimsonglory : rgb("#be0032"), cyan : rgb("#00ffff"), cyanprocess : rgb("#00b7eb"), daffodil : rgb("#ffff31"), dandelion : rgb("#f0e130"), darkblue : rgb("#00008b"), darkbrown : rgb("#654321"), darkbyzantium : rgb("#5d3954"), darkcandyapplered : rgb("#a40000"), darkcerulean : rgb("#08457e"), darkchampagne : rgb("#c2b280"), darkchestnut : rgb("#986960"), darkcoral : rgb("#cd5b45"), darkcyan : rgb("#008b8b"), darkelectricblue : rgb("#536878"), darkgoldenrod : rgb("#b8860b"), darkgray : rgb("#a9a9a9"), darkgreen : rgb("#013220"), darkjunglegreen : rgb("#1a2421"), darkkhaki : rgb("#bdb76b"), darklava : rgb("#483c32"), darklavender : rgb("#734f96"), darkmagenta : rgb("#8b008b"), darkmidnightblue : rgb("#003366"), darkolivegreen : rgb("#556b2f"), darkorange : rgb("#ff8c00"), darkorchid : rgb("#9932cc"), darkpastelblue : rgb("#779ecb"), darkpastelgreen : rgb("#03c03c"), darkpastelpurple : rgb("#966fd6"), darkpastelred : rgb("#c23b22"), darkpink : rgb("#e75480"), darkpowderblue : rgb("#003399"), darkraspberry : rgb("#872657"), darkred : rgb("#8b0000"), darksalmon : rgb("#e9967a"), darkscarlet : rgb("#560319"), darkseagreen : rgb("#8fbc8f"), darksienna : rgb("#3c1414"), darkslateblue : rgb("#483d8b"), darkslategray : rgb("#2f4f4f"), darkspringgreen : rgb("#177245"), darktan : rgb("#918151"), darktangerine : rgb("#ffa812"), darktaupe : rgb("#483c32"), darkterracotta : rgb("#cc4e5c"), darkturquoise : rgb("#00ced1"), darkviolet : rgb("#9400d3"), dartmouthgreen : rgb("#00703c"), davysgrey : rgb("#555555"), debianred : rgb("#d70a53"), deepcarmine : rgb("#a9203e"), deepcarminepink : rgb("#ef3038"), deepcarrotorange : rgb("#e9692c"), deepcerise : rgb("#da3287"), deepchampagne : rgb("#fad6a5"), deepchestnut : rgb("#b94e48"), deepfuchsia : rgb("#c154c1"), deepjunglegreen : rgb("#004b49"), deeplilac : rgb("#9955bb"), deepmagenta : rgb("#cc00cc"), deeppeach : rgb("#ffcba4"), deeppink : rgb("#ff1493"), deepsaffron : rgb("#ff9933"), deepskyblue : rgb("#00bfff"), denim : rgb("#1560bd"), desert : rgb("#c19a6b"), desertsand : rgb("#edc9af"), dimgray : rgb("#696969"), dodgerblue : rgb("#1e90ff"), dogwoodrose : rgb("#d71868"), dollarbill : rgb("#85bb65"), drab : rgb("#967117"), dukeblue : rgb("#00009c"), earthyellow : rgb("#e1a95f"), ecru : rgb("#c2b280"), eggplant : rgb("#614051"), eggshell : rgb("#f0ead6"), egyptianblue : rgb("#102faa"), electricblue : rgb("#7df9ff"), electriccrimson : rgb("#ff003f"), electriccyan : rgb("#00ffff"), electricgreen : rgb("#00ff00"), electricindigo : rgb("#6f00ff"), electriclavender : rgb("#f7c0ff"), electriclime : rgb("#ccff00"), electricpurple : rgb("#bf00ff"), electricultramarine : rgb("#3f00ff"), electricviolet : rgb("#8f00ff"), electricyellow : rgb("#ffff00"), emerald : rgb("#50c878"), etonblue : rgb("#96c8a2"), fallow : rgb("#c19a6b"), falured : rgb("#801818"), fandango : rgb("#b53389"), fashionfuchsia : rgb("#f400a1"), fawn : rgb("#e5aa70"), feldgrau : rgb("#4d5d53"), ferngreen : rgb("#4f7942"), ferrarired : rgb("#ff2800"), fielddrab : rgb("#6c541e"), firebrick : rgb("#b22222"), fireenginered : rgb("#ce2029"), flame : rgb("#e25822"), flamingopink : rgb("#fc8eac"), flavescent : rgb("#f7e98e"), flax : rgb("#eedc82"), floralwhite : rgb("#fffaf0"), fluorescentorange : rgb("#ffbf00"), fluorescentpink : rgb("#ff1493"), fluorescentyellow : rgb("#ccff00"), folly : rgb("#ff004f"), forestgreentraditional : rgb("#014421"), forestgreenweb : rgb("#228b22"), frenchbeige : rgb("#a67b5b"), frenchblue : rgb("#0072bb"), frenchlilac : rgb("#8654c9"), frenchrose : rgb("#f64a8a"), fuchsia : rgb("#ff00ff"), fuchsiapink : rgb("#ff77ff"), fulvous : rgb("#e48400"), fuzzywuzzy : rgb("#cc6666"), gainsboro : rgb("#dcdcdc"), gamboge : rgb("#e49b0f"), ghostwhite : rgb("#f8f8ff"), ginger : rgb("#b06500"), glaucous : rgb("#6082b6"), goldmetallic : rgb("#d4af37"), goldwebgolden : rgb("#ffd700"), goldenbrown : rgb("#996515"), goldenpoppy : rgb("#fcc200"), goldenyellow : rgb("#ffdf00"), goldenrod : rgb("#daa520"), grannysmithapple : rgb("#a8e4a0"), gray : rgb("#808080"), grayhtmlcssgray : rgb("#808080"), grayx11gray : rgb("#bebebe"), gray-asparagus : rgb("#465945"), greencolorwheelx11green : rgb("#00ff00"), greenhtmlcssgreen : rgb("#008000"), greenmunsell : rgb("#00a877"), greenncs : rgb("#009f6b"), greenpigment : rgb("#00a550"), greenryb : rgb("#66b032"), green-yellow : rgb("#adff2f"), grullo : rgb("#a99a86"), guppiegreen : rgb("#00ff7f"), halayaube : rgb("#663854"), hanblue : rgb("#446ccf"), hanpurple : rgb("#5218fa"), hansayellow : rgb("#e9d66b"), harlequin : rgb("#3fff00"), harvardcrimson : rgb("#c90016"), harvestgold : rgb("#da9100"), heartgold : rgb("#808000"), heliotrope : rgb("#df73ff"), hollywoodcerise : rgb("#f400a1"), honeydew : rgb("#f0fff0"), hookersgreen : rgb("#007000"), hotmagenta : rgb("#ff1dce"), hotpink : rgb("#ff69b4"), huntergreen : rgb("#355e3b"), iceberg : rgb("#71a6d2"), icterine : rgb("#fcf75e"), inchworm : rgb("#b2ec5d"), indiagreen : rgb("#138808"), indianred : rgb("#cd5c5c"), indianyellow : rgb("#e3a857"), indigodye : rgb("#00416a"), indigoweb : rgb("#4b0082"), internationalkleinblue : rgb("#002fa7"), internationalorange : rgb("#ff4f00"), iris : rgb("#5a4fcf"), isabelline : rgb("#f4f0ec"), islamicgreen : rgb("#009000"), ivory : rgb("#fffff0"), jade : rgb("#00a86b"), jasper : rgb("#d73b3e"), jazzberryjam : rgb("#a50b5e"), jonquil : rgb("#fada5e"), junebud : rgb("#bdda57"), junglegreen : rgb("#29ab87"), kellygreen : rgb("#4cbb17"), khakihtmlcsskhaki : rgb("#c3b091"), khakix11lightkhaki : rgb("#f0e68c"), lasallegreen : rgb("#087830"), languidlavender : rgb("#d6cadd"), lapislazuli : rgb("#26619c"), laserlemon : rgb("#ffff66"), lava : rgb("#cf1020"), lavenderfloral : rgb("#b57edc"), lavenderweb : rgb("#e6e6fa"), lavenderblue : rgb("#ccccff"), lavenderblush : rgb("#fff0f5"), lavendergray : rgb("#c4c3d0"), lavenderindigo : rgb("#9457eb"), lavendermagenta : rgb("#ee82ee"), lavendermist : rgb("#e6e6fa"), lavenderpink : rgb("#fbaed2"), lavenderpurple : rgb("#967bb6"), lavenderrose : rgb("#fba0e3"), lawngreen : rgb("#7cfc00"), lemon : rgb("#fff700"), lemonchiffon : rgb("#fffacd"), lightapricot : rgb("#fdd5b1"), lightblue : rgb("#add8e6"), lightbrown : rgb("#b5651d"), lightcarminepink : rgb("#e66771"), lightcoral : rgb("#f08080"), lightcornflowerblue : rgb("#93ccea"), lightcyan : rgb("#e0ffff"), lightfuchsiapink : rgb("#f984e5"), lightgoldenrodyellow : rgb("#fafad2"), lightgray : rgb("#d3d3d3"), lightgreen : rgb("#90ee90"), lightkhaki : rgb("#f0e68c"), lightmauve : rgb("#dcd0ff"), lightpastelpurple : rgb("#b19cd9"), lightpink : rgb("#ffb6c1"), lightsalmon : rgb("#ffa07a"), lightsalmonpink : rgb("#ff9999"), lightseagreen : rgb("#20b2aa"), lightskyblue : rgb("#87cefa"), lightslategray : rgb("#778899"), lighttaupe : rgb("#b38b6d"), lightthulianpink : rgb("#e68fac"), lightyellow : rgb("#ffffe0"), lilac : rgb("#c8a2c8"), limecolorwheel : rgb("#bfff00"), limewebx11green : rgb("#00ff00"), limegreen : rgb("#32cd32"), lincolngreen : rgb("#1c352d"), linen : rgb("#faf0e6"), liver : rgb("#534b4f"), lust : rgb("#e62020"), macaroniandcheese : rgb("#ffbd88"), magenta : rgb("#ff00ff"), magentadye : rgb("#ca1f7b"), magentaprocess : rgb("#ff0090"), magicmint : rgb("#aaf0d1"), magnolia : rgb("#f8f4ff"), mahogany : rgb("#c04000"), maize : rgb("#fbec5d"), majorelleblue : rgb("#6050dc"), malachite : rgb("#0bda51"), manatee : rgb("#979aaa"), mangotango : rgb("#ff8243"), maroonhtmlcss : rgb("#800000"), maroonx11 : rgb("#b03060"), mauve : rgb("#e0b0ff"), mauvetaupe : rgb("#915f6d"), mauvelous : rgb("#ef98aa"), mayablue : rgb("#73c2fb"), meatbrown : rgb("#e5b73b"), mediumaquamarine : rgb("#66ddaa"), mediumblue : rgb("#0000cd"), mediumcandyapplered : rgb("#e25822"), mediumcarmine : rgb("#af4035"), mediumchampagne : rgb("#f3e5ab"), mediumelectricblue : rgb("#035096"), mediumjunglegreen : rgb("#1c352d"), mediumlavendermagenta : rgb("#cc33cc"), mediumorchid : rgb("#ba55d3"), mediumpersianblue : rgb("#0067a5"), mediumpurple : rgb("#9370db"), mediumred-violet : rgb("#bb3385"), mediumseagreen : rgb("#3cb371"), mediumslateblue : rgb("#7b68ee"), mediumspringbud : rgb("#c9dc87"), mediumspringgreen : rgb("#00fa9a"), mediumtaupe : rgb("#674c47"), mediumtealblue : rgb("#0054b4"), mediumturquoise : rgb("#48d1cc"), mediumviolet-red : rgb("#c71585"), melon : rgb("#fdbcb4"), midnightblue : rgb("#191970"), midnightgreeneaglegreen : rgb("#004953"), mikadoyellow : rgb("#ffc40c"), mint : rgb("#3eb489"), mintcream : rgb("#f5fffa"), mintgreen : rgb("#98ff98"), mistyrose : rgb("#ffe4e1"), moccasin : rgb("#faebd7"), modebeige : rgb("#967117"), moonstoneblue : rgb("#73a9c2"), mordantred19 : rgb("#ae0c00"), mossgreen : rgb("#addfad"), mountainmeadow : rgb("#30ba8f"), mountbattenpink : rgb("#997a8d"), mulberry : rgb("#c54b8c"), mustard : rgb("#ffdb58"), myrtle : rgb("#21421e"), msugreen : rgb("#18453b"), nadeshikopink : rgb("#f6adc6"), napiergreen : rgb("#2a8000"), naplesyellow : rgb("#fada5e"), navajowhite : rgb("#ffdead"), navyblue : rgb("#000080"), neoncarrot : rgb("#ff9933"), neonfuchsia : rgb("#fe4164"), neongreen : rgb("#39ff14"), non-photoblue : rgb("#a4dded"), oceanboatblue : rgb("#0077be"), ochre : rgb("#cc7722"), officegreen : rgb("#008000"), oldgold : rgb("#cfb53b"), oldlace : rgb("#fdf5e6"), oldlavender : rgb("#796878"), oldmauve : rgb("#673147"), oldrose : rgb("#c08081"), olive : rgb("#808000"), olivedrabwebolivedrab3 : rgb("#6b8e23"), olivedrab7 : rgb("#3c3c1f"), olivine : rgb("#9ab973"), onyx : rgb("#0f0f0f"), operamauve : rgb("#b784a7"), orangecolorwheel : rgb("#ff7f00"), orangeryb : rgb("#fb9902"), orangewebcolor : rgb("#ffa500"), orangepeel : rgb("#ff9f00"), orange-red : rgb("#ff4500"), orchid : rgb("#da70d6"), otterbrown : rgb("#654321"), outerspace : rgb("#414a4c"), outrageousorange : rgb("#ff6e4a"), oxfordblue : rgb("#002147"), oucrimsonred : rgb("#990000"), pakistangreen : rgb("#006600"), palatinateblue : rgb("#273be2"), palatinatepurple : rgb("#682860"), paleaqua : rgb("#bcd4e6"), paleblue : rgb("#afeeee"), palebrown : rgb("#987654"), palecarmine : rgb("#af4035"), palecerulean : rgb("#9bc4e2"), palechestnut : rgb("#ddadaf"), palecopper : rgb("#da8a67"), palecornflowerblue : rgb("#abcdef"), palegold : rgb("#eee8aa"), palegoldenrod : rgb("#eee8aa"), palegreen : rgb("#98fb98"), palemagenta : rgb("#f984e5"), palepink : rgb("#fadadd"), paleplum : rgb("#dda0dd"), palered-violet : rgb("#db7093"), palerobineggblue : rgb("#96ded1"), palesilver : rgb("#c9c0bb"), palespringbud : rgb("#ecebbd"), paletaupe : rgb("#bc987e"), paleviolet-red : rgb("#db7093"), pansypurple : rgb("#78184a"), papayawhip : rgb("#ffefd5"), parisgreen : rgb("#50c878"), pastelblue : rgb("#aec6cf"), pastelbrown : rgb("#836953"), pastelgray : rgb("#cfcfc4"), pastelgreen : rgb("#77dd77"), pastelmagenta : rgb("#f49ac2"), pastelorange : rgb("#ffb347"), pastelpink : rgb("#ffd1dc"), pastelpurple : rgb("#b39eb5"), pastelred : rgb("#ff6961"), pastelviolet : rgb("#cb99c9"), pastelyellow : rgb("#fdfe96"), patriarch : rgb("#800080"), paynesgrey : rgb("#40404f"), peach : rgb("#ffe5b4"), peach-orange : rgb("#ffcc99"), peachpuff : rgb("#ffdab9"), peach-yellow : rgb("#fadfad"), pear : rgb("#d1e231"), pearl : rgb("#eae0c8"), peridot : rgb("#e6e200"), periwinkle : rgb("#ccccff"), persianblue : rgb("#1c39bb"), persiangreen : rgb("#00a693"), persianindigo : rgb("#32127a"), persianorange : rgb("#d99058"), peru : rgb("#cd853f"), persianpink : rgb("#f77fbe"), persianplum : rgb("#701c1c"), persianred : rgb("#cc3333"), persianrose : rgb("#ff3399"), persimmon : rgb("#ec5800"), phlox : rgb("#df00ff"), phthaloblue : rgb("#000f89"), phthalogreen : rgb("#123524"), piggypink : rgb("#fddde6"), pinegreen : rgb("#01796f"), pink : rgb("#ffc0cb"), pink-orange : rgb("#ff9966"), pinkpearl : rgb("#e7accf"), pinksherbet : rgb("#f78fa7"), pistachio : rgb("#93c572"), platinum : rgb("#e5e4e2"), plumtraditional : rgb("#8e4585"), plumweb : rgb("#dda0dd"), portlandorange : rgb("#ff5a36"), powderblueweb : rgb("#b0e0e6"), princetonorange : rgb("ff8f00"), prune : rgb("#701c1c"), prussianblue : rgb("#003153"), psychedelicpurple : rgb("#df00ff"), puce : rgb("#cc8899"), pumpkin : rgb("#ff7518"), purplehtmlcss : rgb("#800080"), purplemunsell : rgb("#9f00c5"), purplex11 : rgb("#a020f0"), purpleheart : rgb("#69359c"), purplemountainmajesty : rgb("#9678b6"), purplepizzazz : rgb("#fe4eda"), purpletaupe : rgb("#50404d"), radicalred : rgb("#ff355e"), raspberry : rgb("#e30b5c"), raspberryglace : rgb("#915f6d"), raspberrypink : rgb("#e25098"), raspberryrose : rgb("#b3446c"), rawumber : rgb("#826644"), razzledazzlerose : rgb("#ff33cc"), razzmatazz : rgb("#e3256b"), red : rgb("#ff0000"), redmunsell : rgb("#f2003c"), redncs : rgb("#c40233"), redpigment : rgb("#ed1c24"), redryb : rgb("#fe2712"), red-brown : rgb("#a52a2a"), red-violet : rgb("#c71585"), redwood : rgb("#ab4e52"), regalia : rgb("#522d80"), richblack : rgb("#004040"), richbrilliantlavender : rgb("#f3e5f5"), richcarmine : rgb("#d70040"), richelectricblue : rgb("#0892d0"), richlavender : rgb("#a76bcf"), richlilac : rgb("#b666d2"), richmaroon : rgb("#b03060"), riflegreen : rgb("#414833"), robineggblue : rgb("#00cccc"), rose : rgb("#ff007f"), rosebonbon : rgb("#f9429e"), roseebony : rgb("#674846"), rosegold : rgb("#b76e79"), rosemadder : rgb("#e32636"), rosepink : rgb("#ff66cc"), rosequartz : rgb("#aa98a9"), rosetaupe : rgb("#905d5d"), rosevale : rgb("#ab4e52"), rosewood : rgb("#65000b"), rossocorsa : rgb("#d40000"), rosybrown : rgb("#bc8f8f"), royalazure : rgb("#0038a8"), royalbluetraditional : rgb("#002366"), royalblueweb : rgb("#4169e1"), royalfuchsia : rgb("#ca226b"), royalpurple : rgb("#7851a9"), ruby : rgb("#e0115f"), ruddy : rgb("#ff0028"), ruddybrown : rgb("#bb6528"), ruddypink : rgb("#e18e96"), rufous : rgb("#a81c07"), russet : rgb("#80461b"), rust : rgb("#b7410e"), sacramentostategreen : rgb("#00563f"), saddlebrown : rgb("#8b4513"), safetyorangeblazeorange : rgb("#ff6700"), saffron : rgb("#f4c430"), stpatricksblue : rgb("#23297a"), salmon : rgb("#ff8c69"), salmonpink : rgb("#ff91a4"), sand : rgb("#c2b280"), sanddune : rgb("#967117"), sandstorm : rgb("#ecd540"), sandybrown : rgb("#f4a460"), sandytaupe : rgb("#967117"), sangria : rgb("#92000a"), sapgreen : rgb("#507d2a"), sapphire : rgb("#082567"), satinsheengold : rgb("#cca633"), scarlet : rgb("#ff2400"), schoolbusyellow : rgb("#ffd800"), screamingreen : rgb("#76ff7a"), seagreen : rgb("#2e8b57"), sealbrown : rgb("#321414"), seashell : rgb("#fff5ee"), selectiveyellow : rgb("#ffba00"), sepia : rgb("#704214"), shadow : rgb("#8a795d"), shamrockgreen : rgb("#009e60"), shockingpink : rgb("#fc0fc0"), sienna : rgb("#882d17"), silver : rgb("#c0c0c0"), sinopia : rgb("#cb410b"), skobeloff : rgb("#007474"), skyblue : rgb("#87ceeb"), skymagenta : rgb("#cf71af"), slateblue : rgb("#6a5acd"), slategray : rgb("#708090"), smaltdarkpowderblue : rgb("#003399"), smokeytopaz : rgb("#933709"), smokyblack : rgb("#100c08"), snow : rgb("#fffafa"), spirodiscoball : rgb("#0fc0fc"), splashedwhite : rgb("#fffefc"), springbud : rgb("#a7fc00"), springgreen : rgb("#00ff7f"), steelblue : rgb("#4682b4"), stildegrainyellow : rgb("#fada5e"), straw : rgb("#e4d96f"), sunglow : rgb("#ffcc33"), sunset : rgb("#fad6a5"), tan : rgb("#d2b48c"), tangelo : rgb("#f94d00"), tangerine : rgb("#f28500"), tangerineyellow : rgb("#ffcc00"), taupe : rgb("#483c32"), taupegray : rgb("#8c8c8c"), teagreen : rgb("#d0f0c0"), tearoseorange : rgb("#f88379"), tearoserose : rgb("#f4c2c2"), teal : rgb("#008080"), tealblue : rgb("#367588"), tealgreen : rgb("#00827f"), tennetawny : rgb("#cd5700"), terracotta : rgb("#e2725b"), thistle : rgb("#d8bfd8"), thulianpink : rgb("#de6fa1"), ticklemepink : rgb("#fc89ac"), tiffanyblue : rgb("#0abab5"), tigerseye : rgb("#e08d3c"), timberwolf : rgb("#dbd7d2"), titaniumyellow : rgb("#eee600"), tomato : rgb("#ff6347"), toolbox : rgb("#746cc0"), tractorred : rgb("#fd0e35"), trolleygrey : rgb("#808080"), tropicalrainforest : rgb("#00755e"), trueblue : rgb("#0073cf"), tuftsblue : rgb("#417dc1"), tumbleweed : rgb("#deaa88"), turkishrose : rgb("#b57281"), turquoise : rgb("#30d5c8"), turquoiseblue : rgb("#00ffef"), turquoisegreen : rgb("#a0d6b4"), tuscanred : rgb("#7c2c2e"), twilightlavender : rgb("#8a496b"), tyrianpurple : rgb("#66023c"), uablue : rgb("#0033aa"), uared : rgb("#d9004c"), ube : rgb("#8776bc"), uclablue : rgb("#536895"), uclagold : rgb("#ffb300"), ufogreen : rgb("#3cd070"), ultramarine : rgb("#120a8f"), ultramarineblue : rgb("#4166f5"), ultrapink : rgb("#ff6fff"), umber : rgb("#635147"), unitednationsblue : rgb("#5b92e5"), unmellowyellow : rgb("#ffff66"), upforestgreen : rgb("#014421"), upmaroon : rgb("#7b1113"), upsdellred : rgb("#ae0c00"), urobilin : rgb("#e1ad21"), usccardinal : rgb("#990000"), uscgold : rgb("#ffcc00"), utahcrimson : rgb("#d3003f"), vanilla : rgb("#f3e5ab"), vegasgold : rgb("#c5b358"), venetianred : rgb("#c80815"), verdigris : rgb("#43b3ae"), vermilion : rgb("#e34234"), veronica : rgb("#a020f0"), violet : rgb("#8f00ff"), violetcolorwheel : rgb("#7f00ff"), violetryb : rgb("#8601af"), violetweb : rgb("#ee82ee"), viridian : rgb("#40826d"), vividauburn : rgb("#922724"), vividburgundy : rgb("#9f1d35"), vividcerise : rgb("#da3287"), vividtangerine : rgb("#ffa089"), vividviolet : rgb("#9f00ff"), warmblack : rgb("#004242"), wenge : rgb("#645452"), wheat : rgb("#f5deb3"), white : rgb("#ffffff"), whitesmoke : rgb("#f5f5f5"), wildblueyonder : rgb("#a2add0"), wildstrawberry : rgb("#ff43a4"), wildwatermelon : rgb("#fc6c85"), wisteria : rgb("#c9a0dc"), xanadu : rgb("#738678"), yaleblue : rgb("#0f4d92"), yellow : rgb("#ffff00"), yellowmunsell : rgb("#efcc00"), yellowncs : rgb("#ffd500"), yellowprocess : rgb("#ffef00"), yellowryb : rgb("#fefe33"), yellow-green : rgb("#9acd32"), zaffre : rgb("#0014a8"), zinnwalditebrown : rgb("#2c1608"), )
https://github.com/a-mhamdi/graduation-report
https://raw.githubusercontent.com/a-mhamdi/graduation-report/main/Typst/fr-Rapport/common/metadata.typ
typst
MIT License
// Enter your project data here: #let title = "Titre du projet" #let titre = "Titre" #let diploma = "Licence" #let program = "Génie Electrique" #let supervisor = "M. (Mme) ***" #let author = "Auteur" #let date = datetime.today().display() #let chap1 = "Contexte et problématique" #let chap2 = "Méthodologie" #let chap3 = "Implémentation" #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/SWATEngineering/Docs
https://raw.githubusercontent.com/SWATEngineering/Docs/main/src/2_RTB/Glossario/content.typ
typst
MIT License
#import "functions.typ": glossary, team #let terms = csv("terms.csv", delimiter: ";") #for letter in "ABCDEFGHIJKLMNOPQRSTUVWXYZ" { let words_to_consider = terms.sorted(key: term => term.first()).filter(term => upper((term.first().at(0))) == letter); if( words_to_consider.len() > 0){ heading(level: 1, letter) for term in words_to_consider { linebreak() text(weight: "bold",size: 15pt)[#term.first().trim()] linebreak() term.last().trim() linebreak() } } }
https://github.com/alejandrgaspar/pub-analyzer
https://raw.githubusercontent.com/alejandrgaspar/pub-analyzer/main/pub_analyzer/internal/templates/author/report.typ
typst
MIT License
// This document was generated using Pub Analyzer version {{ version }}. // // Pub Analyzer is a tool designed to retrieve, process and present in a concise and understandable // way the scientific production of a researcher, including detailed information about their articles, // citations, collaborations and other relevant metrics. // // See more here: https://pub-analyzer.com // Packages // // This document uses the Cetz package to render plots and graphs. For more information // on how to edit the plots see: https://typst.app/universe/package/cetz/ #import "@preview/cetz:0.2.2": canvas, plot, chart, palette // Colors // // The following variables control all colors used in the document. // You can modify the color codes by specifying the four RGB(A) components or by // using the hexadecimal code. // // See more here: https://typst.app/docs/reference/visualize/color/#definitions-rgb #let SUCCESS = rgb("#909d63") #let ERROR = rgb("#bc5653") #let CATEGORY_1 = rgb("#42a2f8") #let CATEGORY_2 = rgb("#82d452") #let CATEGORY_3 = rgb("#929292") #let CATEGORY_4 = rgb("#f0bb40") #let CATEGORY_5 = rgb("#eb4025") #let CATEGORY_6 = rgb("#c33375") #let PALETTE = (CATEGORY_1, CATEGORY_2, CATEGORY_3, CATEGORY_4, CATEGORY_5, CATEGORY_6) // Page Layout #set page("us-letter") #set page(flipped: true) #set heading(numbering: "1.") #set page(footer: grid( columns: (1fr, 1fr), align(left)[Made with #link("https://pub-analyzer.com")[_pub-analyzer_] version {{ version }}], align(right)[#counter(page).display("1")], ) ) // Text config #set text(size: 10pt) #set par(justify: true) // Override reference #show ref: it => { let el = it.element if el != none and el.func() == heading { // Override heading references. numbering( el.numbering, ..counter(heading).at(el.location()) ) } else { // Other references as usual. it } } // Title #grid( columns: (1fr), row-gutter: 11pt, [#align(center, text(size: 17pt, weight: "bold")[{{ report.author.display_name }}])], {% if report.author.last_known_institutions %} {% set last_known_institution = report.author.last_known_institutions[0] %} [#align(center, text(size: 15pt, weight: "thin")[{{ last_known_institution.display_name }}])], {% endif %} ) {% include 'author_summary.typ' %} {% include 'works.typ' %} {% include 'works_extended.typ' %} {% include 'sources.typ' %} #pagebreak() = Bibliography <NAME>., <NAME>., & <NAME>. (2022). OpenAlex: A fully-open index of scholarly works, authors, venues, institutions, and concepts. ArXiv. https://arxiv.org/abs/2205.01833
https://github.com/kotatsuyaki/canonical-nthu-thesis
https://raw.githubusercontent.com/kotatsuyaki/canonical-nthu-thesis/main/pages/zh-cover.typ
typst
MIT License
#set heading( numbering: "1.1.1", ) #let cover-heading( degree: "master", // "master" | "doctor" size: 26pt, // Font size tracking: 0.5em, // Intra-character spacing ) = { let heading-from-degree(degree) = ( "master": "碩士論文", "doctor": "博士論文", ).at(degree) stack( text(size: size, tracking: tracking, [國立清華大學]), v(65pt), text(size: size, tracking: tracking, heading-from-degree(degree)), ) } #let cover-titles( title_zh, title_en, size: 16pt, // Font size spacing: 1cm, // Spacing between zh and en titles ) = stack( text(size: size, strong(title_zh)), v(spacing), text(size: size, strong(title_en)), ) #let cover-author-info( department, id, author-zh, author-en, supervisor-zh, supervisor-en, cover-row-heights: (), ) = { set text(size: 16pt) grid( columns: (auto, 1em, 4in), rows: cover-row-heights, align: (right, left, auto), // Row 1 text(tracking: 0.5em, [系所別]), text([:]), grid.cell(stroke: (bottom: (paint: black, thickness: 0.4pt)), text(tracking: 0.5em, department)), // Row 2 text([學號姓名]), text([:]), grid.cell(stroke: (bottom: (paint: black, thickness: 0.4pt)), text(id + author-zh + "(" + author-en + ")")), // Row 3 text([指導教授]), text([:]), grid.cell(stroke: (bottom: (paint: black, thickness: 0.4pt)), text(supervisor-zh + "(" + supervisor-en + ")")), ) } #let cover-year-month( year-zh, month-zh, ) = { set text(size: 16pt) stack( dir: ltr, spacing: 0.75em, text(/* Spacing between characters */ tracking: 0.75em, [中華民國]), text(year-zh), text([年]), text(month-zh), text([月]), ) } #let zh-cover-page( info: (:), style: (:), ) = page( paper: "a4", margin: (top: 1.75in, left: 1in, right: 1in, bottom: 2in), [ #set text( size: 12pt, ) #align( horizon + center, block( height: 100%, // The vertical stack of the content of the cover. stack( dir: ttb, cover-heading(degree: info.degree, size: 26pt, tracking: 0.5em), v(1.25in), cover-titles(info.title-zh, info.title-en, size: 16pt, spacing: 1cm), v(1fr), // This spacing makes the whole stack fill exactly 100% its parent block. cover-author-info( info.department-zh, info.id, info.author-zh, info.author-en, info.supervisor-zh, info.supervisor-en, cover-row-heights: style.cover-row-heights, ), v(1in), cover-year-month(info.year-zh, info.month-zh), ) ) ) ] )
https://github.com/thornoar/hkust-courses
https://raw.githubusercontent.com/thornoar/hkust-courses/master/MATH1023-Honors-Calculus-I/homeworks/homework-5/main.typ
typst
#import "@local/common:0.0.0": * #import "@local/templates:0.0.0": * #import "@local/drawing:0.0.0": * #import "@local/theorem:0.0.0": * #let thmstyle = thmstyle.with(base: none) #show: thmrules #let args = (base: none, titlefmt: it => underline(strong(it))) #let lm = statestyle("lemma", "Lemma", ..args) #let def = plainstyle("definition", "Definition", ..args) #let note = plainstyle("note", "Note", ..args) #show: math-preamble("Part 5", "Fri, Oct 11") #math-problem("1.5.1") Suppose the partial sum $s_n = n/(2n+1)$. Find the series $sum x_n$ and its sum.\ #math-solution First, we find $x_n$: $ x_n = s_n - s_(n-1) = n/(2n+1) - (n-1)/(2n-1) = (1)/(4n^2 - 1). $ Here, the derivation works for all $n >= 1$, with $s_0$ being equal to 0. Now, we find the sum of the series: $ sum_(n = 1)^oo x_n = lim_(n -> oo) s_n = lim_(n -> oo) n/(2n+1) = 1/2. $ #math-problem("1.5.2 (2)") Compute the partial sum and the sum of the series: $ /* sum_(n = 1)^oo x_n = */ sum_(n = 1)^oo 1/((a + n d)(a + (n+1)d)). $ #math-solution The partial sums are $ s_k = sum_(n = 1)^k 1/((a + n d)(a + (n+1)d)) = 1/d sum_(n = 1)^k (1/(a + n d) - 1/(a + (n+1)d)) = 1/d (1/(a+d) - 1/(a + (k+1)d)). $ The sum is $ lim_(k -> oo) s_k = lim_(k -> oo) 1/d (1/(a+d) - 1/(a + (k+1)d)) = 1/(d(a+d)). $ #math-problem("1.5.5") Find the partial sum of $sum_(n = 1)^oo n x^n$ by multiplying $1-x$. Then find the sum.\ #math-solution Assume that $abs(x) < 1$. For the partial sum $s_n = x + 2x^2 + 3x^3 + ... + n x^n$ we write $ (1-x) s_n = (x + 2x^2 + 3n^3 + ... + n x^n) - (x^2 + 2 x^3 + ... + n x^(n+1)) = x + x^2 + ... + x^n - n x^(n+1) =\ = x((1 - x^n)/(1-x) - n x^n),\ s_n = (x(1 - (n+1)x^n + n x^(n+1)))/(1-x)^2. $ The sum will calculate as follows: $ sum_(n = 1)^oo n x^n = lim_(n -> oo) s_n = lim_(n -> oo) (x(1 - (n+1)x^n + n x^(n+1)))/(1-x)^2 = x/(1-x)^2. $ If $abs(x) >= 1$, then the derivation of the partial sums doesn't change, however, the series will diverge, since $n x^n$ will not approach zero. #math-problem("1.5.7") Find the area of the Sierpinski carpet.\ #math-solution Let $K$ denote the Sierpinski carpet and $K_n$ ($n = 1, 2, ...$) denote the intermediate shapes. For a shape $X$ let $S(X)$ denote its area. For $K_n$, we have $S(K_(n+1)) = 8/9 dot S(K_n)$, since every iteration removes one square out of nine: #figure( cz.canvas( length: 4cm, { import cz.draw: * let fillcolor = luma(170) let drawcarpet(pos, scale, first-call, iter) = { if (first-call) { rect( (pos.at(0)-scale*.5, pos.at(1)-scale*.5), (pos.at(0)+scale*.5, pos.at(1)+scale*.5), fill: fillcolor ) } if (iter > 0) { rect( (pos.at(0)-scale/3*.5, pos.at(1)-scale/3*.5), (pos.at(0)+scale/3*.5, pos.at(1)+scale/3*.5), fill: white ) line( (pos.at(0)-scale*.5, pos.at(1)+scale/3*.5), (pos.at(0)-scale/3*.5, pos.at(1)+scale/3*.5), stroke: (paint: luma(100), dash: "dashed"), mark: (end: none) ) line( (pos.at(0)-scale/3*.5, pos.at(1)+scale*.5), (pos.at(0)-scale/3*.5, pos.at(1)+scale/3*.5), stroke: (paint: luma(100), dash: "dashed"), mark: (end: none) ) line( (pos.at(0)+scale/3*.5, pos.at(1)+scale*.5), (pos.at(0)+scale/3*.5, pos.at(1)+scale/3*.5), stroke: (paint: luma(100), dash: "dashed"), mark: (end: none) ) line( (pos.at(0)+scale*.5, pos.at(1)+scale/3*.5), (pos.at(0)+scale/3*.5, pos.at(1)+scale/3*.5), stroke: (paint: luma(100), dash: "dashed"), mark: (end: none) ) line( (pos.at(0)+scale*.5, pos.at(1)-scale/3*.5), (pos.at(0)+scale/3*.5, pos.at(1)-scale/3*.5), stroke: (paint: luma(100), dash: "dashed"), mark: (end: none) ) line( (pos.at(0)+scale/3*.5, pos.at(1)-scale*.5), (pos.at(0)+scale/3*.5, pos.at(1)-scale/3*.5), stroke: (paint: luma(100), dash: "dashed"), mark: (end: none) ) line( (pos.at(0)-scale/3*.5, pos.at(1)-scale*.5), (pos.at(0)-scale/3*.5, pos.at(1)-scale/3*.5), stroke: (paint: luma(100), dash: "dashed"), mark: (end: none) ) line( (pos.at(0)-scale*.5, pos.at(1)-scale/3*.5), (pos.at(0)-scale/3*.5, pos.at(1)-scale/3*.5), stroke: (paint: luma(100), dash: "dashed"), mark: (end: none) ) let dx = scale/3 let dy = scale/3 drawcarpet((pos.at(0)+dx, pos.at(1)-dy), scale/3, false, iter - 1) drawcarpet((pos.at(0)+dx, pos.at(1)+.0), scale/3, false, iter - 1) drawcarpet((pos.at(0)+dx, pos.at(1)+dy), scale/3, false, iter - 1) drawcarpet((pos.at(0)+.0, pos.at(1)+dy), scale/3, false, iter - 1) drawcarpet((pos.at(0)-dx, pos.at(1)+dy), scale/3, false, iter - 1) drawcarpet((pos.at(0)-dx, pos.at(1)+.0), scale/3, false, iter - 1) drawcarpet((pos.at(0)-dx, pos.at(1)-dy), scale/3, false, iter - 1) drawcarpet((pos.at(0)+.0, pos.at(1)-dy), scale/3, false, iter - 1) } } set-style(mark: (end: "stealth")) drawcarpet((-1.5,0), 1, true, 0) content((-1.5, -.65), [ $S = 1$ ]) line((-.9,0), (-.6, 0)) drawcarpet((0,0), 1, true, 1) content((0, -.65), [ $S = 8/9$ ]) line((.6,0), (.9, 0)) drawcarpet((1.5,0), 1, true, 2) content((1.5, -.65), [ $S = (8/9)^2$ ]) } ), gap: 0.6cm, caption: "The areas of Sierpinski carpet iterations" ) <sierpinski> Hence, we see that $S(K_n) = (8/9)^n ->_(n -> oo) 0$. Now, since $K$ is contained in every $K_n$, we see that\ $S(K) <= S(K_n)$ for every $n$. Therefore, $S(K) = 0$. #math-problem("1.5.11") Prove that if $a_n > 0$ and $sum_(n = 1)^oo a_n$ converges, then $sum_(n = 1)^oo a_n^2$ converges. Moreover, prove that the converse is not true.\ #math-solution Since $sum a_n$ converges, we see that $a_n ->_(n -> oo) 0$, meaning that $a_n < 1$ for sufficiently large $n$. For such $n$, we have $a_n^2 < a_n$. Hence, by the comparison test, we conclude that $sum a_n^2$ converges as well.\ The converse is not true, as shown by the example $a_n = 1/n$. We have that $sum a_n^2$ converges, while $sum a_n$ diverges. #math-problem("1.5.14 (2, 5)") Determine the convergence, $b, d, p, q > 0$: 2. $ sum (3n^2 - 2n^3)/(sqrt(4n^5 + 5n^4)); $ 5. $ sum (c + n d)^q/(a + n b)^p. $ #math-solution 2. Consider the square of the common term: $ x_n^2 = (2n^3 - 3n^2)^2/(4n^5 + 5n^4) = (4n^6 - 12n^5 + 9n^4)/(4n^5 + 5n^4). $ This is a rational expression where the degree of the polynomial in the numerator is greater than the that of the polynomial in the denominator. Hence, $x_n^2$ diverges to infinity. As a consequence, $x_n$ diverges as well, and we see that the series diverges since the necessary condition that $x_n ->_(n -> oo) 0$ fails. 5. We manipulate the common term as follows: $ x_n = (c + n d)^q/(a + n b)^p = n^(q-p) (c/n + d)^q/(a/n + b)^p = n^(q-p) dot A_n. $ The multiplier $A_n$ converges to $d^q/b^p$, and can thus be bounded below and above by $mu = 1/2 d^q/b^p$ and $nu = 2 d^q/b^p$, respectively (for sufficiently large $n$). Now, if $q - p < alpha < -1$ for some $alpha$, then we have $ sum_(n = 1)^oo x_n <= sum_(n = 1)^oo nu/n^alpha, $ and the series converges by the comparison test. If, however, $q - p >= 1$, then we have $ sum_(n = 1)^oo x_n >= sum_(n = 1)^oo mu/n, $ and the series diverges by the converse of the comparison test. #math-problem("1.5.17 (3)") Determine the convergence of $ sum (5^(n-1) - n^2 2^n)/(3^(n+1)). $ #math-solution The common term can be expressed as $ x_n = (5^(n-1) - n^2 2^n)/(3^(n+1)) = 1/15 dot (5/3)^n - 1/3 dot n^2 dot (2/3)^n. $ The right part of the resulting difference converges to 0 (since $2/3 < 1$), while the left part diverges to infinity (since $5/3 > 1$). Hence, $x_n$ diverges to infinity, and the series diverges due to the failure of the necessary condition that $x_n ->_(n -> oo) 0$. #math-problem("1.5.18 (2)") Determine the convergence of $ sum n x^(n^2). $ #math-solution If $abs(x) >= 1$, then the series obviously diverges, since the common term does not converge to 0. Otherwise, we have $abs(x) < 1$. // It immediately follows from the comparison test that if $sum abs(x_n)$ converges, then $sum x_n$ converges (by taking $y_n = abs(x_n)$). We recall that the series $sum n abs(x)^n$ converges, as was shown in Exercise 1.5.5. Now, since $abs(x) < 1$, we write $ abs(n x^(n^2)) = n abs(x)^(n^2) <= n abs(x)^n, $ and conclude the convergence of the original series due to the convergence test. #math-problem("1.5.19 (1, 5)") Determine the convergence, $a, b > 0$: 1. $ sum_(n = 0)^oo (a^n + b^n)^p; $ 5. $ sum_(n = 1)^oo n^p/(a + b/n)^n. $ #math-solution 1. If either of $a, b$ equals or exceeds $1$ (say, $a$), then we have $ sum (a^n + b^n)^p >= sum (a^p)^n = +oo, $ and the series diverges. If both $a$ and $b$ lie in the interval $(0,1)$, then we have $ sum_(n = 0)^oo (a^n + b^n)^p <= sum_(n = 0)^oo (2 dot max(a,b)^n)^p = 2^p dot sum_(n = 0)^oo (max(a,b)^p)^n = 2^p dot 1/(1 - max(a,b)^p), $ and the series converges by the comparison test. 5. Consider three cases for $a$: - $0 < a < 1$. Then, for sufficiently large $n$, we have $b/n < (1-a)/2$ and $a + b/n < a + (1-a)/2 = 1 - (1-a)/2 = alpha < 1$. Then, we have $ n^p/(a + b/n)^n >= n^p (1/alpha)^n. $ Since the series of the right terms diverges (as $1/alpha > 1$ and $n^p (1/alpha)^n ->_(n -> oo) +oo$), the series of the left terms must diverge as well. - $a = 1$. Then, if $p >= -1$, then we have $ (a + b/n)^n = (1 + b/n)^n = ((1 + 1/(n\/b))^(n\/b))^b < e^b, $ and therefore $ sum n^p/(a + b/n)^n >= sum n^p/e^b >= sum 1/(e^b dot n) = +oo, $ and the series diverges. If, however, $p < -1$, then we write $ sum n^p/(1 + n/b)^n <= sum n^p, $ and the former series converges by the comparison test, since the latter series converges. - $a > 1$. We again consider different cases for $p$. If $p <= 1$, we write $ sum n^p/(a + b/n)^n <= sum n^p/a^n <= sum n dot (1/a)^n. $ The convergence of the last series has been established in Exercise 1.5.5, and so the original series converges as well, by the comparison test. If $p > 1$, we do a trick: $ n^p/a^n = (n/(a^(1\/p))^n)^p. $ Since $alpha = a^(1\/p)$ is still greater than 1, we have $n/(alpha^n) = n dot (1/alpha)^n ->_(n -> oo) 0$, and so $n/alpha^n < 1$ for sufficiently large $n$. Since $p > 1$, for such $n$ we also have $(n/alpha^n)^p < n/alpha^n$. Finally, we write $ n^p/(a + b/n)^n <= n^p/a^n = (n/alpha^n)^p <= n/alpha^n, $ and then apply the comparison test to conclude that the original series converges. #math-problem("1.5.20 (2)") Determine convergence: $ 2/4 + (2 dot 6)/(4 dot 7) + (2 dot 6 dot 10)/(4 dot 7 dot 10) + dots.h.c . $ #math-solution Seeing through the pattern, we recognize this as $ sum_(n = 0)^oo (2 dot 6 dot ... dot (2 + 4n))/(4 dot 7 dot ... dot (4 + 3n)) = sum_(n = 0)^oo (product_(k = 0)^n (2 + 4n)/(4 + 3n)) $ Consider the ratio of consecutive terms (here $x_n$ are the terms of the series): $ x_n/x_(n-1) = (2+4n)/(4+3n). $ We see that $x_n/x_(n-1)$ converges to $4/3 > 1$. As a consequence, there is a number $alpha$ such that $1 < alpha < 4/3$ and for sufficiently large $n$ (say, from $n = N$) we have $ x_n/x_(n-1) > alpha. $ Now, for $n > N$ $ x_n = x_N dot x_(N+1)/x_N dot ... dot x_n/x_(n-1) > x_N dot alpha^(n-N) ->_(n -> oo) +oo. $ Hence $x_n$ diverges to $+oo$, and thus the series $sum x_n$ diverges, since the necessary condition that $x_n -> 0$ fails. #math-problem("1.5.21 (4)") Determine convergence: $ sum_(n = 1)^oo ((a+c)(a+2c)^2 dots.h.c (a+n c)^n)/((b+d)(b+2d)^2 dots.h.c (b+n d)^n). $ #math-solution Consider the ratio of consecutive terms: $ x_n/x_(n-1) = (a + n c)^n/(b + n d)^n = ((c + a/n)/(d + b/n))^n, // = (c/d)^n dot ((1 + 1/(n dot c/a))^(n dot c/a))^(a\/c) dot ((1 + 1/(n dot d/b))^(n dot d/b))^(-b\/d) $ where $x_n$ are the terms of the series. First, assume that $abs(c) < abs(d)$. Then we see that $ abs((c + a/n)/(d + b/n)) ->_(n -> oo) abs(c/d) < 1. $ Then there is $alpha$ such that $abs(c\/d) < alpha < 1$ and for sufficiently large $n$ (say, from $n > N$), we have $ abs(x_n/x_(n-1)) = abs((c + a/n)/(d + b/n))^n < alpha^n < alpha. $ // for some $abs(c\/d) < alpha < 1$. As a result, we can bound $x_n$ above by $x_N dot alpha^(n-N)$, and the original series converges by the comparison test, since $sum alpha^n$ converges. Now, let $abs(c) >= abs(d)$. We will have to consider some more cases: - $d = 0$. Then $b != 0$, and we consider another couple of cases: + $c = 0$. Then the ratio $x_n\/x_(n-1)$ reduces to $(a\/b)^n$. If $abs(a) < abs(b)$, then the series converges, by the same reason we provided in the case $abs(c) < abs(d)$. If $a = b$, then $x_n = 1$ for all $n$, and thus the series diverges to $+oo$. If $abs(a) > abs(b)$, then $ abs(x_n/x_(n-1)) = abs(a/b)^n > abs(a/b) > 1,\ abs(x_n) = abs(x_1) dot abs(x_2/x_1) dot ... dot abs(x_n/x_(n-1)) > abs(a/b)^n ->_(n -> oo) +oo, $ and therefore $abs(x_n)$ diverges to $+oo$, which means that the series diverges as well. + $c != 0$. Then we have $ abs(x_n/x_(n-1)) = abs((a + c n)/b)^n ->_(n -> oo) +oo, $ which again means that the series diverges, by logic similar to the previous case (where $abs(a) > abs(b)$). - $d != 0$. Then $c != 0$, since $abs(c) >= abs(d) > 0$. Another couple of cases: + $abs(c) > abs(d)$. Then, since $ abs((c + a/n)/(d + b/n)) ->_(n -> oo) abs(c/d) > 1, $ we have that $abs(x_n/x_(n-1)) > alpha > 1$ for some $alpha$, for sufficiently large $n$. Again, the series diverges, by logic similar to previous cases. + $c = d$. Denote $f = c = d$. We will require the following lemma: #lm(numbering: "1.")[ For all $x in RR$, we have the convergence $ (1 + x/n)^n ->_(n -> oo) e^x. $ ] #pf[ If $x = 0$, then the result is obvious, a constant sequence converging to $1 = e^0$. If $x > 0$, then $ (1 + x/n)^n = ((1 + 1/(n\/x))^(n\/x))^x = ((1 + 1/k)^k)^x ->_(k -> oo) e^x. $ Here we do a substitution $k = n\/x$. This is justified since $n -> oo$ if and only if $k -> oo$. If $x < 0$, then we write $ (1 + x/n)^n = (1 - (-x)/n)^n = ((1 - 1/(-n\/x))^(-n\/x))^(-x) = ((1 - 1/k)^k)^(-x) ->_(k -> oo) (1/e)^(-x) = e^x, $ substituting $-n\/x$ with $k$. ] #note(numbering: "1.")[ The formulation of the lemma is usually taken as the _definition_ of the function $exp(x) = e^x$, and subsequently for defining real number exponentiation. If the present course adopts the same approach, the lemma is unnecessary. Plus, prof. <NAME> claimed that putting this exercise at this stage of the course was a mistake, since we haven't learned the right tools yet. If my reasoning is insufficiently rigorous, all questions to him. ] With this statement, we write $ abs(x_n/x_(n-1)) = abs((f + a/n)/(f + b/n))^n = abs((1 + (a\/f)/n)/(1 + (b\/f)/n))^n ->_(n -> oo) e^(a\/f)/e^(b\/f) = e^((a-b)/f) $ If $a = b$, then all of the terms $x_n$ equal 1, and the series diverges.\ If $(a-b)f < 0$, then we have $ abs(x_n/(x_(n-1))) < alpha < 1 $ for some $alpha$ for sufficiently large $n$, since $e^((a-b)/f) < 1$. In this case, the series converges by logic already stated before.\ If $(a-b)f > 0$, then for some $alpha$ we will have $ abs(x_n/x_(n-1)) > alpha > 1 $ for sufficiently large $n$. This means that $x_n$ does not converge to 0, and thus the series diverges.\ This concludes the cases. *So, what's the result?* The series converges in the following cases and only then: + $abs(c) < abs(d)$; + $c = d = 0$ and $abs(a) < abs(b)$; + $c = d$ and $(a-b)d < 0$. #math-problem("1.5.22 (4, 5)") Determine convergence. There might be values of $x$ for which no conclusion can yet be made. 4. $ sum n^n/n! x^n; $ 5. $ sum n!/n^n x^n. $ #math-solution 4. Consider the ratio of consecutive terms: $ x_(n+1)/x_n = ((n+1)^(n+1)/(n+1)! x^(n+1))/(n^n/n! x^n) = x (1 + 1/n)^n ->_(n -> oo) e dot x. $ If $abs(x) < 1/e$, then we see that $ lim_(n -> oo) abs(x_(n+1)/x_n) = e dot abs(x) < 1, $ meaning that the series converges.\ If $abs(x) = 1/e$, then the series diverges, but the proof requires integration techniques we now lack.\ If $abs(x) > 1/e$, then for sufficiently large $n$ $ abs(x_(n+1)/x_n) > 1, $ meaning that $x_n$ does not converge to 0, and the series diverges. #math-problem("1.6.5") Prove that $limits(lim)_(n -> oo) (x_n,y_n) = (k,l)$ with respect to the $L^1$-norm if and only if $limits(lim)_(n -> oo) x_n = k$ and $limits(lim)_(n -> oo) y_n = l$.\ #math-solution / $==>:$: Assume $limits(lim)_(n -> oo) (x_n, y_n) = (k,l)$. We will prove that $limits(lim)_(n -> oo) x_n = k$. Let $epsilon > 0$ be arbitrary. Then there is $N$ such that $n > N$ implies $ norm((x_n, y_n) - (k,l))_1 = abs(x_n - k) + abs(y_n - l) < epsilon. $ Consequently, $abs(x_n - k) < epsilon$ for $n > N$. Hence, $x_n$ converges to $k$.\ Similarly, $y_n$ also converges to $l$, by the same logic (or by symmetry). / $<==:$: Assume $limits(lim)_(n -> oo) x_n = k$ and $limits(lim)_(n -> oo) y_n = l$. Let $epsilon > 0$ be freely chosen. For $delta = epsilon/2$, we have $N_1$ and $N_2$ such that $ n > N_1 ==> abs(x_n - k) < delta #h(1cm) "and" #h(1cm) n > N_2 ==> abs(y_n - l) < delta. $ Hence, for $n > N = max(N_1, N_2)$ we have $ norm((x_n, y_n) - (k,l))_1 = abs(x_n - k) + abs(y_n - l) < 2 delta = epsilon. $ Therefore, $(x_n, y_n)$ converges to $(k,l)$. #math-problem("1.6.8") Extend the relation between the $L^2$-norm and the $L^oo$-norm on $RR^n$.\ #math-solution First of all, we see that $ norm(arrow(x))_oo = max_(1 <= k <= n) abs(x_k) = sqrt((max_(1 <= k <= n) abs(x_k))^2) <= sqrt(sum_(k = 1)^n x_k^2) = norm(arrow(x))_2. $ On the other hand, $ norm(arrow(x))_2 = sqrt(sum_(k = 1)^n x_k^2) <= sqrt(n dot (max_(1 <= k <= n) x_k)^2) = sqrt(n) dot norm(arrow(x))_oo. $
https://github.com/nimalu/mustermann-cv
https://raw.githubusercontent.com/nimalu/mustermann-cv/main/main.typ
typst
#import "lib.typ": * #show: resume.with( author: ( firstname: "Max", lastname: "Mustermann", address: "Musterstraße 10, 22374 Musterstadt", phone: "+49 1923655", email: "<EMAIL>", github: "mustermann", linkedin: "mustermann", ) ) = Experience #resume-entry( title: link("https://www.duckduckgo.com/", "Tech Solutions GmbH"), date: "2024 - Present", description: "Software Engineer", location: "Berlin" ) #resume-item[ - Leading a team of 5 developers to create and maintain web applications, improving user experience and performance - Designing and implementing REStful APIs using Nojde.js and Express.js ] #resume-entry( title: link("https://www.google.com/", "Innovatech AG"), date: "2020 - 2023", description: "Junior Software Engineer", location: "Munich" ) #resume-item[ - Assisted in developing and deploying full-stack web applications using JavaScript, HTML, CSS, and Python - Participated in the design and architecture of new software projects, focusing on scalability and performance ] = Education #resume-entry( title: "Karlsruhe Institute of Technology", date: "2023 - Present", description: "M. Sc. Computer Science" ) #resume-item[ - Focusing on data structures and algorithms ] #resume-entry( title: "Technical University of Munich", date: "2019 - 2023", description: "B. Sc. Computer Science" ) #resume-item[ - Final GPA: 1.0 (German scale, best 1.0) - Relevant Coursework: Database Systems, Web Development, Machine Learning ] #resume-entry( title: "Albert-Einstein-Gymnasium", date: "2011 - 2019", description: "Abitur (High school diploma)", location: "Dresden" ) #resume-item[ - Final GPA: 1.2 (German scale, best 1.0) ] = Projects #resume-entry( title: "E-commerce Web Application", date: "2024", description: github-link("typst/typst") ) #resume-item[ - Developed a full-featured e-commerce platform using React.js for the frontend and Node.js for the backend ] #resume-entry( title: "Internal Tool for Project Management", date: "2023", description: github-link("typst/typst"), location: "Musterverein" ) #resume-item[ - Created an internal project management tool to track project progress, manage tasks, and allocate resources. ] #resume-entry( title: "Real-Time Chat Application", date: "2023", description: github-link("typst/typst") ) #resume-item[ - Designed and developed a real-time chat application using Socket.io for real-time communication and Node.js for the server-side ]
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/data-05.typ
typst
Other
// Error: 6-16 failed to parse csv file: found 3 instead of 2 fields in line 3 #csv("test/assets/files/bad.csv")
https://github.com/frectonz/the-pg-book
https://raw.githubusercontent.com/frectonz/the-pg-book/main/book/005.%20javacover.html.typ
typst
#set page( paper: "a5", margin: (x: 1.8cm, y: 1.5cm), ) #set text( font: "Liberation Serif", size: 10pt, hyphenate: false ) #set par(justify: true) #set quote(block: true) #v(10pt) = Java's Cover #v(10pt) _April 2001_ #rect[ This essay developed out of conversations I've had with several other programmers about why Java smelled suspicious. It's not a critique of Java! It is a case study of hacker's radar. Over time, hackers develop a nose for good (and bad) technology. I thought it might be interesting to try and write down what made Java seem suspect to me. Some people who've read this think it's an interesting attempt to write about something that hasn't been written about before. Others say I will get in trouble for appearing to be writing about things I don't understand. So, just in case it does any good, let me clarify that I'm not writing here about Java (which I have never used) but about hacker's radar (which I have thought about a lot). ] The aphorism _"you can't tell a book by its cover"_ originated in the times when books were sold in plain cardboard covers, to be bound by each purchaser according to his own taste. In those days, you couldn't tell a book by its cover. But publishing has advanced since then: present-day publishers work hard to make the cover something you can tell a book by. I spend a lot of time in bookshops and I feel as if I have by now learned to understand everything publishers mean to tell me about a book, and perhaps a bit more. The time I haven't spent in bookshops I've spent mostly in front of computers, and I feel as if I've learned, to some degree, to judge technology by its cover as well. It may be just luck, but I've saved myself from a few technologies that turned out to be real stinkers. So far, Java seems like a stinker to me. I've never written a Java program, never more than glanced over reference books about it, but I have a hunch that it won't be a very successful language. I may turn out to be mistaken; making predictions about technology is a dangerous business. But for what it's worth, as a sort of time capsule, here's why I don't like the look of Java: + It has been so energetically hyped. Real standards don't have to be promoted. No one had to promote C, or Unix, or HTML. A real standard tends to be already established by the time most people hear about it. On the hacker radar screen, Perl is as big as Java, or bigger, just on the strength of its own merits. + It's aimed low. In the original Java white paper, Gosling explicitly says Java was designed not to be too difficult for programmers used to C. It was designed to be another C++: C plus a few ideas taken from more advanced languages. Like the creators of sitcoms or junk food or package tours, Java's designers were consciously designing a product for people not as smart as them. Historically, languages designed for other people to use have been bad: Cobol, PL/I, Pascal, Ada, C++. The good languages have been those that were designed for their own creators: C, Perl, Smalltalk, Lisp. + It has ulterior motives. Someone once said that the world would be a better place if people only wrote books because they had something to say, rather than because they wanted to write a book. Likewise, the reason we hear about Java all the time is not because it has something to say about programming languages. We hear about Java as part of a plan by Sun to undermine Microsoft. + No one loves it. C, Perl, Python, Smalltalk, and Lisp programmers love their languages. I've never heard anyone say that they loved Java. + People are forced to use it. A lot of the people I know using Java are using it because they feel they have to. Either it's something they felt they had to do to get funded, or something they thought customers would want, or something they were told to do by management. These are smart people; if the technology was good, they'd have used it voluntarily. + It has too many cooks. The best programming languages have been developed by small groups. Java seems to be run by a committee. If it turns out to be a good language, it will be the first time in history that a committee has designed a good language. + It's bureaucratic. From what little I know about Java, there seem to be a lot of protocols for doing things. Really good languages aren't like that. They let you do what you want and get out of the way. + It's pseudo-hip. Sun now pretends that Java is a grassroots, open-source language effort like Perl or Python. This one just happens to be controlled by a giant company. So the language is likely to have the same drab clunkiness as anything else that comes out of a big company. + It's designed for large organizations. Large organizations have different aims from hackers. They want languages that are (believed to be) suitable for use by large teams of mediocre programmers -- languages with features that, like the speed limiters in U-Haul trucks, prevent fools from doing too much damage. Hackers don't like a language that talks down to them. Hackers just want power. Historically, languages designed for large organizations (PL/I, Ada) have lost, while hacker languages (C, Perl) have won. The reason: _today's teenage hacker is tomorrow's CTO_. + The wrong people like it. The programmers I admire most are not, on the whole, captivated by Java. Who does like Java? Suits, who don't know one language from another, but know that they keep hearing about Java in the press; programmers at big companies, who are amazed to find that there is something even better than C++; and plug-and-chug undergrads, who are ready to like anything that might get them a job (will this be on the test?). These people's opinions change with every wind. + Its daddy is in a pinch. Sun's business model is being undermined on two fronts. Cheap Intel processors, of the same type used in desktop machines, are now more than fast enough for servers. And FreeBSD seems to be at least as good an OS for servers as Solaris. Sun's advertising implies that you need Sun servers for industrial strength applications. If this were true, Yahoo would be first in line to buy Suns; but when I worked there, the servers were all Intel boxes running FreeBSD. This bodes ill for Sun's future. If Sun runs into trouble, they could drag Java down with them. + The DoD likes it. The Defense Department is encouraging developers to use Java. This seems to me the most damning sign of all. The Defense Department does a fine (though expensive) job of defending the country, but they love plans and procedures and protocols. Their culture is the opposite of hacker culture; on questions of software they will tend to bet wrong. The last time the DoD really liked a programming language, it was Ada. Bear in mind, this is not a critique of Java, but a critique of its cover. I don't know Java well enough to like it or dislike it. This is just an explanation of why I don't find that I'm eager to learn it. It may seem cavalier to dismiss a language before you've even tried writing programs in it. But this is something all programmers have to do. There are too many technologies out there to learn them all. You have to learn to judge by outward signs which will be worth your time. I have likewise cavalierly dismissed Cobol, Ada, Visual Basic, the IBM AS400, VRML, ISO 9000, the SET protocol, VMS, Novell Netware, and CORBA, among others. They just smelled wrong. It could be that in Java's case I'm mistaken. It could be that a language promoted by one big company to undermine another, designed by a committee for a "mainstream" audience, hyped to the skies, and beloved of the DoD, happens nonetheless to be a clean, beautiful, powerful language that I would love programming in. It could be, but it seems very unlikely. == Trevor Re: Java's Cover _(<NAME> had another take on Java's Cover. He raises an interesting question: are dumbed-down languages actually better for some subset of programmers?)_ I think it isn't as clear-cut as Java and its ilk being good or bad. I would make the following argument: There are two kinds of programmers: brilliant hackers, and corporate drones. It's natural that they should want different kinds of tools. As a hacker, you can only shine if you use the right tools. Don't let yourself be saddled with inappropriate tools by your management, and don't be led by the media into using the tools meant for drones. Because there are 100x more drones than hackers, most new commercial technologies are aimed at them. You have to learn to quickly identify which tools are and aren't meant for you. Any technology that has the outward features of Java (hype, accessibility, committee design, ulterior commercial motives, ...) is probably designed for drones, so avoid it for the same reason you would avoid a novel with Fabio on the cover, or an inn that advertises parking for trucks. They may be right for their target audience. They may be created by smart people. They're just not meant for you. == Berners-Lee Re: Java #quote(attribution: [<NAME>, keynote at JavaOne, 1996])["Java is sweeping across the world so that if you go to your boss and say, "I'll think I'll write it in Java," then your boss will be very impressed and she won't tell you, "Don't be silly; we don't program like that here.""]
https://github.com/wj461/operating-system-personal
https://raw.githubusercontent.com/wj461/operating-system-personal/main/HW3/document.typ
typst
#align(center, text(17pt)[ *Operating-system homework\#3* ]) #(text(14pt)[ = Programming problems ]) Kernel: 6.8.1-arch1-1\ gcc (GCC) 13.2.1 = compile #align(center, image("./image/make.png",width: 70%, fit: "contain") ) = 7.15 #align(center, image("./image/fibonacci.png",width: 70%, fit: "contain") ) = 8.32 #align(center, image("./image/biridge.png",width: 70%, fit: "contain") ) = 9.28 #align(center, image("./image/address.png",width: 70%, fit: "contain") )
https://github.com/7sDream/fonts-and-layout-zhCN
https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/07-localisation/USE.typ
typst
Other
#import "/template/template.typ": web-page-template #import "/template/components.typ": note #import "/template/lang.typ": telugu, balinese, sharada, taitham #import "/lib/glossary.typ": tr #show: web-page-template // ## The Universal Shaping Engine == 通用#tr[shaping]引擎 // In the previous section we looked at how shapers contain specialist knowledge, automatically activating particular features and performing glyph reordering based on the expectations of a particular script. The Indic shaper has a lot of linguistic information in it - it knows how to reorder glyphs around the base consonant, and it further knows that when half forms or reph forms are present, the way that reordering happens should change. 上一节中我们主要讨论的是#tr[shaper]需要内置一些知识,也就是在某些#tr[scripts]下要激活特定的特性,以它们期望的方式处理#tr[glyph]重排等。印度系#tr[scripts]尤其如此,处理它们需要大量的关于语言的信息,比如如何围绕基本辅音来重排#tr[glyph],以及使用半字和reph时排序方式需要怎样变化。 // Of course, there's a problem with this. If the shaper contains all the knowledge about how to organise a script, that means that when a new script is encoded and fonts are created for it, we need to wait until the shaping engines are updated with new handling code to deal with the new script. Even when the code *is* added to the shaper, fonts won't be properly supported in older versions of the software, and in the case of commercial shaping engines, it may not actually make economic sense for the developer to spend time writing specific shaping code for minority scripts anyway. 很明显这样有问题。如果#tr[shaper]需要了解所处理#tr[scripts]的所有知识的话,那么就意味着每次有新#tr[scripts]被#tr[encoding]时,我们必须要等到#tr[shaper]更新代码支持这种新#tr[scripts]后才能开始为它制作字体。即使#tr[shaper]真的会更新代码,那些老旧的软件也无法正确处理新的#tr[scripts]。而对于那些作为商业软件的#tr[shaper]来说,为这些少数民族#tr[script]费心费力地编写专用处理代码基本没有什么经济价值。 // After overseeing the development of far more script-specific shapers than one person really should, <NAME> of Microsoft wondered whether it would be possible to develop one shaping engine for all of Unicode. A similar endeavour by SIL called Graphite attempts to acts as a universal shaping engine by moving the script-specific logic from the shaper into the font: Graphite "smart fonts" contain a bytecode program which is executed by the shaper in place of the shaper's script-specific knowledge. In Glass' idea of the Universal Shaping Engine, however, the intelligence is neither in the font nor in the shaping engine, but provided by the Unicode Character Database. 在监制了远超其职责数量的特定#tr[scripts]专用#tr[shaper]之后,微软的<NAME>开始思考是否有可能开发一个对整个Unicode#tr[character set]都适用的#tr[shaping]引擎。SIL的Graphite技术也在努力尝试同样的事情,它通过将特定#tr[scripts]的处理逻辑从#tr[shaper]里移动到字体里来完成通用#tr[shaping]引擎的目标。Graphite将这种字体称为“智能字体(smart fonts)”。这种字体中包含一个字节码构成的程序,#tr[shaper]会执行这段程序,而自身并不包含对任何#tr[scripts]的知识。Glass对于通用#tr[shaping]引擎(Uniersal Shaping Engine, USE)的想法和Graphite并不一样。在他的设想中,关于#tr[scripts]的知识既不在#tr[shaper]中,也不在字体里,而是由Unicode#tr[character]数据库提供。 // Each character that enters the Universal Shaping Engine is looked up in the Unicode Character Database. Based on its Indic Syllabic Category, General Category, and Indic Positional Category entries, is placed into one of twenty-four character classes, further divided into 26 sub-classes. The input characters are then formed into clusters based on these character classes, and features are applied to each cluster in turn. 通用#tr[shaping]引擎会在Unicode#tr[character]数据库中查询输入的每个#tr[character]。根据#tr[general category]、印度系音节分类(Indic Syllabic Category)、印度系位置分类(Indic Positional Category)等条目信息,将#tr[character]分为24个类别,进一步分为26个子类。接下来,输入的#tr[character]依据上述分类被组织成#tr[cluster]。最后以#tr[cluster]为单位应用特性。 // One problem that the USE attempts to solve is that the order that characters are encoded in Unicode is not the same as the order in which their respective glyphs are meant to be displayed. A USE shaper looks at the character classes of the incoming input and forms them into a cluster by matching the following characteristics: USE试图解决#tr[character]在Unicode中的#tr[encoding]顺序和它们对应#tr[glyph]的最终显示顺序不一致的问题。USE分析输入#tr[character]的分类,然后将他们按照各自的特征组织成#tr[cluster]。这个流程如下: #figure( placement: none, caption: [ USE将#tr[character]组织成#tr[cluster]的流程。 // If you want a more formal grammar for a USE cluster, you can find one in the Microsoft [script development specs](https://docs.microsoft.com/en-us/typography/script-development/use). 更加正式的USE#tr[character]#tr[cluster]构成法可以在微软的《通用#tr[shaping]引擎字体开发规范》#[@Microsoft.DevelopingUSE]中找到。 ] )[#include "USE-cluster.typ"] // But the USE expects those characters to be formed into a glyph which looks like this: USE 允许将#tr[character]们最终组合为一个如@figure:USE-form 这样的#tr[glyph]。 #figure( caption: [USE中一个标准#tr[cluster]的构成] )[#image("use-form.png")] <figure:USE-form> // For instance, in Telugu, we know that the series of characters ఫ్ ట్ వే should be formed into a single cluster (ఫ్ట్వే), because it is made up of a base character ఫ, followed by two halant groups (virama, base consonant), and a final top-positioned vowel. The script development spec mentioned above explained how these categories are derived from the Indic Positional Category and Indic Syllabic Category information in the Unicode Character Database. 例如在泰卢固文中,我们知道 #telugu[ఫ్ ట్ వే] 这个#tr[character]序列需要被组合成 #box(baseline: -0.2em)[#telugu[ఫ్ట్వే]] 这样一个#tr[cluster],因为它是由一个基本字符 #telugu[ఫ్],两个半音组(半音加一个基本字符)和一个结尾的上方元音组成的。之前提到的字体开发规范中,详细介绍了如何根据Unicode#tr[character]数据库中的印度系位置分类和印度系音节分类,将#tr[character]划分为USE中定义的各种类别。 // This "computational" model of a cluster does not know anything about the linguistic rules used in real-life scripts; you can create valid USE clusters which would be shaped "correctly" according to the script grammar defined in the specification, even though they have no relationship with anything in the actual language. For example, we can imagine a Balinese sequence made up of the following characters: 这个用于组合#tr[cluster]的计算模型并不具备任何现实中的语言学知识。你可以根据规范中构成法的定义创建出一个和现实语言没有任何关联,但却依然合法的#tr[cluster]。比如,我们可以使用如下#tr[character]合成出一个想象中的巴厘文字#tr[cluster]: /* * ᬳ BALINESE LETTER HA, Base * ᬴ BALINESE SIGN REREKAN, Consonant modifier above * Halant group: * ᭄ BALINESE ADEG ADEG, Halant * ᬗ BALINESE LETTER NGA, Base * ᬴ BALINESE SIGN REREKAN, Consonant modifier above * Halant group: * ᭄ BALINESE ADEG ADEG, Halant * ᬢ BALINESE LETTER TA, Base * Vowels: * ᬶ BALINESE VOWEL SIGN ULU, Vowel above * ᬹ BALINESE VOWEL SIGN SUKU ILUT, Vowel below * ᬸ BALINESE VOWEL SIGN SUKU, Vowel below * ᬵ BALINESE VOWEL SIGN TEDUNG, Vowel post * Vowel modifiers: * ᬀ BALINESE SIGN ULU RICEM, Vowel modifier above * ᬁ BALINESE SIGN ULU CANDRA, Vowel modifier above * ᬄ BALINESE SIGN BISAH, Vowel modifier post * Final consonants: * ᬃ BALINESE SIGN SURANG, Consonant final above */ #let gobbledegook = ( (codepoint: 0x1B33, name: "BALINESE LETTER HA", class: [基本#tr[character]]), (codepoint: 0x1B34, name: "BALINESE SIGN REREKAN", class: [辅音上方修饰符]), ( group: [半音组], children: ( (codepoint: 0x1B44, name: "BALINESE ADEG ADEG", class: [半音符号]), (codepoint: 0x1B17, name: "BALINESE LETTER NGA", class: [基本#tr[character]]), (codepoint: 0x1B34, name: "BALINESE SIGN REREKAN", class: [辅音上方修饰符]), ) ), ( group: [半音组], children: ( (codepoint: 0x1B44, name: "BALINESE ADEG ADEG", class: [半音符号]), (codepoint: 0x1B22, name: "BALINESE LETTER TA", class: [基本#tr[character]]), ), ), ( group: [元音组], children: ( (codepoint: 0x1B36, name: "BALINESE VOWEL SIGN ULU", class: [上方元音]), (codepoint: 0x1B39, name: "BALINESE VOWEL SIGN SUKU ILUT", class: [下方元音]), (codepoint: 0x1B38, name: "BALINESE VOWEL SIGN SUKU", class: [下方元音]), (codepoint: 0x1B35, name: "BALINESE VOWEL SIGN TEDUNG", class: [后方元音]), ), ), ( group: [元音修饰组], children: ( (codepoint: 0x1B00, name: "BALINESE SIGN ULU RICEM", class: [上方元音修饰符]), (codepoint: 0x1B01, name: "BALINESE SIGN ULU CANDRA", class: [上方元音修饰符]), (codepoint: 0x1B04, name: "BALINESE SIGN BISAH", class: [后方元音修饰符]), ), ), ( group: [结尾辅音], children: ( (codepoint: 0x1B03, name: "BALINESE SIGN SURANG", class: [上方结尾辅音]), ), ) ) #let gobbledegook-to-list(arr) = { for item in arr [ #if "group" in item [ #list[#item.group:#gobbledegook-to-list(item.children)] ] else [ #list[#box(width: 1em)[#balinese(str.from-unicode(item.codepoint))] #raw(item.name),#item.class] ] ] } #gobbledegook-to-list(gobbledegook) // It's complete gobbledegook, obviously, but nevertheless it forms a single valid graphemic cluster according to the Universal Shaping Engine, and Harfbuzz (which implements the USE) bravely attempts to shape it: 很明显这基本就是在胡编乱造,但即使这样我们还是能根据USE构成法将它们组合成一个合法的字形#tr[cluster]。HarfBuzz(它实现了USE)也会尽其所能的对它进行#tr[shaping]: #figure( placement: none, )[ #let flatten-gobbledegook(arr) = arr.fold((), (acc, item) => { if "group" in item { return (..acc, ..flatten-gobbledegook(item.children)) } else { return (..acc, item.codepoint) } }) #let gobbledegook-string = flatten-gobbledegook(gobbledegook).map(str.from-unicode).join() #block(inset: (top: 2em, bottom: 5em))[#balinese(size: 5em)[#gobbledegook-string]] ] // When USE has identified a cluster according to the rules above, the first set of features are applied - `locl`, `ccmp`, `nukt` and `akhn` in that order; next, the second set of features - `rphf` and `pref` in that order; then the third set of features - `rkrf`, `abvf`, `blwf`, `half`, `pstf`, `vatu` and `cjct` (not *necessarily* in that order). 当USE根据上述构成法确定一个#tr[cluster]后,首先会应用第一个特性集,包括 `locl`、`ccmp`、`nukt`、`akhn`,按上述顺序应用。然后是第二个特性集 `rphf`、`pref`,也是按此顺序。接下来是第三个特性集 `rkrf`、`abvf`、`blwf`、`half`、`pstf`、`vatu`、`cjct`,不一定按照以上顺序应用。 // After these three feature groups are applied, the glyphs are *reordered* so that instead of their logical order (the order that Unicode requires them to be entered in a text) they now represent their visual order (reading from left to right). Rephs are keyed into a text *before* the base character, but are logically *after* it in the glyph stream. So in the Śāradā script used in Kashmir, we can enter 𑇂 (U+111C2 SHARADA SIGN JIHVAMULIYA) 𑆯 (U+111AF SHARADA LETTER SHA), and this is reordered by the shaping engine like so: 在三个特性集应用完毕后,会将#tr[glyph]序列从逻辑顺序(Unicode要求它们在文本中的出现顺序)重新排序为显示顺序(从左到右)。Reph在文本中会写在基本字符之后,当此时就会移动到前面了。所以我们可以依次输入用于书写克什米尔语的夏拉达文中的两个字母 `U+111C2 SHARADA SIGN JIHVAMULIYA` 和 `U+111AF SHARADA LETTER SHA`,但它们会被#tr[shaping]引擎重排为如下的样子: #[ #show regex(`\p{Sharada}+`.text): sharada ```bash $ hb-shape NotoSansSharada-Regular.ttf '𑇂𑆯' [Sha=0+700|Jihvamuliya.ns=0@-680,0+0] ``` ] // Notice how the Jihvamuliya (reph) has been placed after the base glyph in the glyph stream (even though it's then positioned on top). 注意这个 `Jihvamuliya`(reph)在#tr[glyph]流中的位置是在基本#tr[glyph]之后(在后续的#tr[positioning]阶段被放在了上方)。 // Similarly, glyphs representing pre-base characters (specifically pre-base vowels and pre-base vowel modifiers - and glyphs which have been identified with the `pref` feature, which we'll talk about in a minute) are moved to the beginning of the cluster but after the nearest virama to the left. Here we have a base (U+111A8 BHA), a halant (U+111C0 VIRAMA), another base (U+11193 GA), and a pre-base vowel (U+111B4 VOWEL SIGN I). 类似地,显示在基本#tr[glyph]前的#tr[glyph](前方元音、前方元音修饰符、被`pref`特性命中的#tr[glyph]等)会被移动到#tr[glyph]#tr[cluster]中较前的位置,位于其最近的半音符的右边。比如我们依次输入基本#tr[character]`U+111A8 BHA`、半音符号`U+111C0 VIRAMA`、另一个基本#tr[character]`U+11193 GA`、基前元音`U+111B4 VOWEL SIGN I`,则重排结果为: #[ #show regex(`\p{Sharada}+`.text): sharada ```bash $ hb-shape NotoSansSharada-Regular.ttf '𑆨𑇀𑆓𑆴' [Bha=0+631|virama=0+250|I=2+224|Ga=2+585] ``` ] 显示为: #figure( placement: none, )[ #sharada(size: 5em)[\u{111A8}\u{111C0}\u{11193}\u{111B4}] ] // The i-matra has been correctly moved to before the base GA, even though it appeared after it in the input stream. 这个`i-matra` 被正确地移动到了基本#tr[character]`GA`之前。 // Pre-base *consonants*, however, are *not* reordered. If you want to put these consonants before the base in the glyph stream, you can do so by mentioning the relevant glyph in a substitution rule in the `pref` feature. For example, to move a Javanese medial ra (U+A9BF) to before the base, you create a rule like so: 但基前*辅音*不会被重排。如果你希望在#tr[glyph]流中也把它们放到基本#tr[character]前,可以通过在`pref`特性中提及相关#tr[glyph]来完成。比如我们想把 `U+A9BF JAVANESE MEDIAL RA` 移到基本#tr[character]前,则可以编写下面的规则: ```fea feature pref { script java; sub j_Jya j_RaMed' by j_RaMed.pre; } pref; ``` // The `j_RaMed.pre` glyph will be moved before the `j_Jya` by the shaper. When I say the glyph should be "mentioned" in a substitution rule, I do mean "mentioned"; you can, if needed, substitute a glyph *with itself*, just to tell the shaper that you would like it moved before the base. This code reorders a Tai Tham medial ra, by ensuring that the `pref` feature has "touched" it: 这样`j_RaMed.pre`就会被移动到`j_Jya`之前。我上面用的词是“提及”,它就是字面意思。如果需要的话,你也可以通过将某个#tr[glyph]#tr[substitution]为它自己的方式,来告诉#tr[shaper]你想把它移动到基本字符前。下面的代码通过在`pref`中提及了`Tai Tham Medial Ra`来确保它会被重排: ```fea feature pref { script lana; sub uni1A55 by uni1A55; } pref; ``` #note[ // > In days before the Universal Shaping Engine, fonts had to cheat, by swapping the characters around using positioning rules instead. Here in Noto Sans Tai Tham, the base (TAI THAM LETTER WA) is shifted forward 540 units, while the prebase medial ra is shifted backwards 1140 units, effectively repositioning it while keeping the characters in the same order in the glyph stream: 在通用#tr[shaping]引擎出现之前,字体需要通过使用#tr[positioning]规则来进行作弊式的#tr[character]位置交换。比如在Noto Sans Tai Tham字体中,基本#tr[character] `TAI THAM LETTER WA`向右移动了540个单位,而应显示在基本#tr[character]前的`MEDIAL RA`#tr[character]则向左移了1140个单位,在#tr[glyph]流顺序不变的情况下高效地完成了#tr[positioning]: #[ #show regex(`\p{Tai Tham}+`.text): taitham ```bash $ hb-shape NotoSansTaiTham-Regular.ttf 'ᩅᩕ' [uni1A45=0@540,0+1103|uni1A55=0@-1140,0+100] ``` ] ] // Next, after re-ordering, positional features (`isol`, `init`, `medi`, `fina`) are applied to each cluster, and finally the usual run of substitution and positioning features are applied as normal. (See the [USE script development spec](https://docs.microsoft.com/en-us/typography/script-development/use#opentype-feature-application-ii) for the full list.) 在重排后的下一步是以#tr[cluster]为单位应用`isol`、`init`、`medi`、`fina`这几个和#tr[positioning]相关的特性。之后会执行一遍通常的#tr[substitution]和#tr[positioning]流程。(完整列表可以在通用#tr[shaping]引擎字体开发规范#[@Microsoft.DevelopingUSE]中找到。) // The Universal Shaping Engine is a tremendous boost for those creating fonts for minority scripts; it allows font development to press ahead without having to wait for shaping engines to encode script-specific logic. However, the shaping engine still needs to hand off control of a specific script to the USE for processing, rather than handling it as a normal (non-complex) script. This means there *is* still a list of scripts within the shaping engine, and only scripts on the list get handed to the USE - or perhaps another way to put it is that the shaping engines still have script-specific routines for *some* scripts, but not for others. In fact, the list of languages which use the USE (as it were) are different between different engines - see <NAME>'s [USE presentation](http://tiro.com/John/Universal_Shaping_Engine_TYPOLabs.pdf) for more details. 通用#tr[shaping]引擎对于为小语种制作字体的人来说是一个巨大的助力。他们不再需要等待#tr[shaping]引擎加入新#tr[encoding]的#tr[scripts]所需要的特殊逻辑,可以直接开始字体开发。但问题是,#tr[shaping]引擎需要决定,在接收到某种#tr[script]的文本时,它到底是使用内置知识还是使用USE流程。这就表示它还是需要一个记录哪些#tr[scripts]使用USE的内置列表。换句话说,即使实现了USE,#tr[shaping]引擎还是需要为某些#tr[scripts]保留特殊逻辑的。事实上,不同的#tr[shaping]引擎中,决定哪些语言要使用USE的列表也是不同的。关于这点你可以参考<NAME>关于USE的主题报告@Hudson.MakingFonts.2016。 // Rather than having to write a new shaper for each script, shaping engine maintainers now only have to add a line of code to the list of USE-supported scripts - but they still have to add that line of code. Supporting new scripts is easier, but not automatic. (I hope that one day, USE will become the default for new scripts, rather than the exception, but we are not there yet.) #tr[shaping]引擎的维护人员现在只需要在USE支持的#tr[scripts]列表中添加几行代码,而不再需要为每一种新#tr[scripts]单独编写#tr[shaping]了。但几行代码也是代码,虽然不难写,不过因为有这个列表存在,支持新#tr[scripts]的流程就没法自动化。(我希望有朝一日USE能成为新#tr[scripts]的默认处理方式,而不再是像现在这样是作为一个特例存在。) // Additionally, the USE's maximal cluster model (which allows us to produce crazy clusters such as the Balinese example above) *more or less* fits all scripts, although <NAME> has found an exception in the case of Tai Tham. In his words, "the Universal Shaping Engine turns out to be not quite universal in this sense either. But it’s pretty darn close, and is a remarkable achievement." It most certainly is. 另外,USE中构成#tr[cluster]的最复杂(也就是我们创造上面那个疯狂的巴厘文例子时使用的)模型可以说是几乎能够适用于所有#tr[scripts]。虽然<NAME>在傣曇文中发现了一个例外,但他评价说:“虽然这表明通用#tr[shaping]引擎在某些情况下并不足够通用,但它已经非常接近了。这是一个非常杰出的成就。”确实如此。
https://github.com/totikom/slides
https://raw.githubusercontent.com/totikom/slides/main/2024-05-01-turing-blockchain/slides.typ
typst
Creative Commons Attribution Share Alike 4.0 International
#import "slides-theme.typ": * #set text(lang: "ru", size: 25pt, font: "Fira Sans") #show raw: set text(size: 25pt, font: "Fira Mono") #show: inverse-theme #set raw(theme: "themes/Halcyon.tmTheme") #let qr(caption, name, href, size) = link(href, figure( caption: caption, numbering: none, image("figures/qr/" + name + ".png", width: size), )) #let clickable-qrs-footer = [ #set align(center) #set text(size: 0.8em) _(QR кликабельны в PDF)_ ] #title-slide( title: [ Что такое блокчейн? ], author: "<NAME>", extra: [Междисциплинарная неделя "Кроссворда Тьюринга" и школы "Лес"], ) #slide(title: "Обо мне")[ #side-by-side[ - Закончил Физфак МГУ по специальности "Квантовые вычисления" - Поработал в криптостартапе - Разрабатываю компиляторы для DSP - Организую школу "Лес" ][ #qr( [ Канал физического отделения "Лес" ], "fiz_forest", "https://t.me/physicists_in_the_forest", 80%, ) ] ] #focus-slide[ Часть 1: Немного истории и постановка задачи ] #slide(title: "Обмен в доцифровую эпоху")[ #side-by-side[ #image("figures/coins.jpg", width: 100%) ][ #uncover("2-")[ #image("figures/cheque.jpg", width: 100%) ] ] ] #slide(title: "Компьютерные системы и Интернет")[ #side-by-side[ #align(center)[ #uncover("2-")[ #text(4em)[???] ] ] ][ #image("figures/card.png", width: 100%) ] ] #slide(title: "Наличные и банковская система")[ #side-by-side[ #align(top)[ #align(center, [= Наличные]) #line-by-line(start: 2)[ - Нет посредника - Необратимость без согласия сторон - Нет накладных расходов ] ] ][ #align(top)[ #align(center, [= Банк]) #line-by-line(start: 2)[ - Банк является доверенной третьей стороной - Банковкая операция может быть отменена - Банковский перевод - платная услуга ] ] ] ] #slide(title: "Электронные деньги")[ #line-by-line(start: 2)[ - Нет посредника, которому необходимо доверять - Необратимые операции - Низкая стоимость транзакций - Обязательная авторизация - Приватность ] ] #slide(title: "Новая модель приватности")[ #align(center)[ #rect(fill: gray)[ #image("figures/privacy-model.svg", width: 100%) ] ] ] #slide(title: "Проблемы, которые надо решить")[ #side-by-side[ #line-by-line(start: 2)[ - Подтверждение личности отправителя - Проверка наличия средств у отправителя - Невозможность тратить одни и те же деньги несколько раз ] ][ #image("figures/cheque.jpg", width: 100%) ] ] #focus-slide[ Часть 2: Криптографический ликбез ] #slide(title: "Односторонние функции")[ $ y = f(x) &<- #[Вычисляется _легко_]\ x = f^(-1)(y) &<- #[Не существует или вычисляется _сложно_] $ ] #slide(title: "Односторонние функции: примеры")[ #line-by-line()[ - *Умножение:* $c = a b$ -- легко, но $(a,b) = f(c)$ -- трудно - *Возведение в степень:* $c = a^b$ -- легко, но $b = log_a (c)$ -- трудно ] ] #set quote(block: true) #slide(title: "Хеш-функции")[ #quote(attribution: "Википедия")[Хеш-функция -- функция, преобразующая массив входных данных произвольного размера в выходную битовую строку фиксированного размера.] #pause $ h(x) = x mod N, #[где $N$ -- простое число] $ ] #slide(title: "Хеш-функции: свойства")[ - *Коллизия* -- пара входных значений $m$ и $m'$, такие что $h(m) = h(m')$ #pause - *Лавинный эффект* -- малое изменение входных данных полностью изменяет значение хеш-функции ] // Надо бы что-то сказать про лавинный эффект #slide(title: "Требования к криптографическим хеш-функциям")[ #line-by-line[ - *Сопротивление поиску прообраза:* для значения хэша $x$ должно быть трудно найти $m$ такое, что $x = h(m)$ - *Сопротивление поиску второго прообраза:* для $m_1$ должно быть сложно найти $m_2$ такое, что: $h(m_1) = h(m_2)$ - *Стойкость к поиску коллизий:* должно быть сложно найти $m$, $m'$ такие, что $h(m)=h(m')$ ] ] #slide(title: "Цифровая подпись")[ #quote(attribution: "Wikipedia(en)")[ *Цифровая подпись* -- метод подтверждения подлинности цифрового сообщения. Подтвержденная цифровая подпись доказывает, что сообщение пришло от отправителя, а не кого-то другого. ] ] #slide(title: [Односторонняя функция с _секретом_])[ - $f_(S) (m) = c$ _легко_ вычислить без знания _секрета_ - $f^(-1)_(S)(c) = m$ -- _сложно_ - $f^(-1)_(S)(c) = m$ -- _легко_ ] // TODO: Добавить картинку #slide(title: "Цифровая подпись: общая схема")[ #line-by-line[ - *Генерация ключей:* С помощью генератора случаных чисел создаются открытый ($P$) и закрытый ($S$) ключи - *Публикация открытого ключа* - *Подписывание сообщений с использованием закрытого ключа* ] ] #focus-slide[ Часть 3: Блокчейн (наконец-то) ] #slide(title: "Проблемы, которые надо решить")[ - Подтверждение личности отправителя - Проверка наличия средств у отправителя - Невозможность тратить одни и те же деньги несколько раз ] #slide(title: "Цепочка транзакций")[ #align(center)[ #rect(fill: gray)[ #image("figures/transaction-chain.svg", width: 70%) ] ] ] #slide(title: "Устройство транзакции")[ #only(1)[ #rect(fill: gray)[ #image("figures/transaction.svg", width: 100%) ] ] #only(2)[ #side-by-side[ #rect(fill: gray)[ #image("figures/transaction.svg", width: 100%) ] ][ - $sum "In" = sum "Out"$ - Биткоины из входных транзакций полностью переводятся в выходные - Для "сдачи" адрес отправителя включается в _выходы_ транзакции ] ] ] #slide(title: "Цепочка транзакций")[ #align(center)[ #rect(fill: gray)[ #image("figures/transaction-chain.svg", width: 70%) ] ] ] #slide(title: "Цепочка блоков")[ #align(center)[ #rect(fill: gray)[ #image("figures/block-chain.svg", width: 100%) ] ] ] #slide(title: "Proof of work")[ *Идея:* сделаем так, чтобы создавать блоки было вычислительно трудно. #pause - Добавим в блок поле *Nounce*(_англ._ соль), значение которого может быть любым - Потребуем, чтобы значение хеша блока удовлетворяло некоторому условию ] #slide(title: "Устройство блока")[ #align(center)[ #table( columns: (auto, auto), inset: 10pt, stroke: white, align: horizon, table.header( [*Поле*], [*Значение*], ), "Timestamp (не показано)", "Время генерации этого блока", "Prev Hash", "Хеш предыдущего блока", "Nonce", "Значение, которое нужно подобрать", "Difficulty (не показано)", "количество нулей, которое должно быть у хеша этого блока", "Tx1, Tx2...", "Транзакции, которые включены в этот блок", ) ] ] #slide(title: "Хранение списка транзакций")[ #align(center)[ #side-by-side[ #image("figures/merkle-full.svg", width: 70%) ][ #image("figures/merkle-cut.svg", width: 70%) ] ] ] #slide(title: "А если цепочка раздвоится?")[ #align(center)[ #rotate(90deg, origin: center, reflow: true)[ #rect(fill: gray)[ #image("figures/sidechains.svg", width: 100%) ] ] ] ] #slide(title: "Ссылки", footer: clickable-qrs-footer)[ #set align(center + horizon) #stack(dir: ltr, spacing: 5%, qr("На меня", "totikom", "https://totikom.github.io/", 30%), qr([На канал "Леса"], "forest", "https://t.me/forest_school_am", 30%), qr([На "ФизЛес"], "fiz_forest" ,"https://t.me/physicists_in_the_forest", 30%), ) ] #focus-slide[ Bonus: Как всё-таки работает цифровая подпись? ] #slide(title: "Эллиптические кривые")[ #side-by-side[ - $y^2=x^3+a x+b$ - $Delta = -16 (4 a^3 +27 b^2) != 0$ ][ #rect(fill: gray)[ #image("figures/EC.svg", width: 100%) ] ] ] #slide(title: "Эллиптические кривые: закон сложения точек")[ #rect(fill: gray)[ #image("figures/EC-addition.svg", width: 100%) ] ] #slide(title: "Эллиптические кривые: закон сложения точек")[ Пусть $P = (x_P, y_P)$ и $Q = (x_Q, y_Q)$ -- точки на кривой. Допустим, что $x_P != x_Q$ и пусть $s = (y_P − y_Q)/(x_P − x_Q)$ Тогда $R = P + Q = (x_R, y_R)$: $ x_R &= s^2 - x_P - x_Q\ y_R &= − y_P + s (x_P − x_R) $ ] #slide(title: "Эллиптические кривые: закон сложения точек")[ Если $x_P = x_Q$: - $y_P = − y_Q => P + Q = O$ -- по определению. - $y_P = y_Q != 0$, тогда $P + Q = 2P = (x_R, y_R)$: $ s &= (3 x_(P)^2 + a)/(2 y_P)\ x_R &= s^2 − 2 x_P\ y_R &= − y_P + s (x_P − x_R) $ Если $y_P = y_Q = 0$ то $P + P = O$ ] #slide(title: "Алгоритм ECDSA")[ Параметры алгоритма: - Эллиптическая кривая $y^2 = x^3 + 486662 x^2+x$ над $\GF(2^255 - 19)$ - Точка G с координатой $x = 9$ - Порядок группы, образуемой точкой: $n = 2^252 + 27742317777372353535851937790883648493$ (Curve25519) ] #slide(title: "Алгоритм ECDSA: создание секретного ключа")[ + Выбрать случайное число $d$ в интервале $[0, n-1]$ + Вычислить $Q = d times G$ Закрытый ключ: $(d, Q)$ Открытый ключ: $Q$ ] #slide(title: "Алгоритм ECDSA: подпись сообщения")[ #line-by-line()[ 1. Хешировать сообщение $e = h(m)$ 2. Взять $z = e_(L..0)$, где $L$ - битовая длина $n$. 3. Выбрать криптографически случайное число $k in [0, n - 1]$ 4. Вычислить $(x_1,y_1)= k times G$ 5. Вычислить $r=x_1 mod n$, если $r = 0$, вернуться к шагу 3. 6. Вычислить $s=k^(-1)(z + r d) mod n$, если $s = 0$, вернуться к шагу 3. ] #uncover("7-")[ Подписью сообщения будет пара $(r, s)$ ] ] #slide(title: "Алгоритм ECDSA: проверка подписи")[ #line-by-line()[ 1. Хешировать сообщение $e = h(m)$ 2. Взять $z = e_(L..0)$, где $L$ - битовая длина $n$. 3. Вычислить $u_1= z s^(-1) mod n$ и $u_2= r s^(-1) mod n$ 4. Вычислить $C = (x_2, y_2) = u_1 times G + u_2 times Q$, если $(x_2,y_2) = O$, то подпись недействительна. ] #uncover("5-")[ Подпись верна, если $r = x_2 mod n$ ] ] #focus-slide[ Почему это работает? ] #slide(title: "Алгоритм ECDSA: доказательство корректности")[ #line-by-line()[ 1. $С = u_1 times G + u_2 times Q$ 2. $С = u_1 times G + u_2 d times G$ 3. $С = (u_1 + u_2 d) times G$ 4. $С = (z s^(-1) + r s^(-1) d) times G$ 5. $С = (z + r d)s^(-1) times G$ 6. $С = (z + r d) k/(z + r d) times G$ 7. $С = k times G = (x_2, y_2)$ ] #uncover("7-")[ При этом $r = x_1$, $(x_1,y_1) = k times G$, а проверка подписи заключалась в $r = x_2 mod n$ ] ] #slide(title: [Почему $k$ должно быть случайным?])[ Допустим, одно и то же $k$ использовалось для двух подписей $(r,s)$ и $(r,s')$ известных сообщений $m$ и $m'$. #line-by-line(start: 2)[ 1. $z$ и $z'$ известны $=> k = (z - z')/(s - s')$ 2. $s = k^(-1)(z + r d) => d = (s k - z) / r$ ] ] #slide(title: "Ссылки", footer: clickable-qrs-footer)[ #set align(center + horizon) #stack(dir: ltr, spacing: 5%, qr("На меня", "totikom", "https://totikom.github.io/", 30%), qr([На канал "Леса"], "forest", "https://t.me/forest_school_am", 30%), qr([На "ФизЛес"], "fiz_forest" ,"https://t.me/physicists_in_the_forest", 30%), ) ]
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/ops-07.typ
typst
Other
// Test boolean operators. // Test not. #test(not true, false) #test(not false, true) // And. #test(false and false, false) #test(false and true, false) #test(true and false, false) #test(true and true, true) // Or. #test(false or false, false) #test(false or true, true) #test(true or false, true) #test(true or true, true) // Short-circuiting. #test(false and dont-care, false) #test(true or dont-care, true)
https://github.com/YDX-2147483647/statistical-dsp
https://raw.githubusercontent.com/YDX-2147483647/statistical-dsp/main/template.typ
typst
#import "@preview/oxifmt:0.2.0": strfmt #let project( title: none, author: (name: none), date: none, //! Strings are passed to `strfmt`, and contents or other types are shown literally. info: (), body, ) = { // Document's basic properties set document(author: author.name, title: title) // Font families let body-font = ("Linux Libertine", "Source Han Serif") let sans-font = ("Inria Sans", "Source Han Sans") // Text formats set text(font: body-font, lang: "en") show heading: set text(font: sans-font) set heading(numbering: "1.1") //! Title page //! Headings align(left, image("assets/logo.png", height: 5em)) // The logo was modified from images in BIThesis. // https://github.com/BITNP/BIThesis/tree/a4daadbb00ea8cee8587ba79f8ed79ddbc3da8a9/templates/undergraduate-thesis/images v(1fr, weak: true) align( center, text(font: sans-font, 2em, weight: "bold")[Undergraduate Experiment Report], ) v(1fr, weak: true) align(center)[ #set text(font: body-font, 2em, weight: "bold") Laboratory: #set text(style: "italic") #title ] //! Information table let formatted_info = info.pairs().map(((key, value))=>{ if type(value) == str { (key, strfmt(value, date: date, ..author)) } else { (key, value) } }) let n_cols = 2 let n_rows = calc.ceil(formatted_info.len() / n_cols) v(1fr, weak: true) align(center, table( columns: (auto, auto) * n_cols, align: center + horizon, inset: (x: 1em, y: 1em), ..range(n_rows).map(r=>{ range(n_cols).map(c=>{ let i = r + n_rows * c if i < formatted_info.len() { let pair = formatted_info.at(i) ({ set text(weight: "bold") pair.at(0) }, pair.at(1)) } }) }).flatten(), )) v(2fr, weak: true) pagebreak() //! Main body set page(numbering: "1 / 1", number-align: center) counter(page).update(1) set par(justify: true) outline(indent: 2em) body }
https://github.com/RaphGL/ElectronicsFromBasics
https://raw.githubusercontent.com/RaphGL/ElectronicsFromBasics/main/main.typ
typst
Other
#set document( title: [Electronics From Basics], author: "<NAME>", keywords: ("Electronics", "Electricity"), ) #set page(numbering: "1") #set par(justify: true) #set text( font: "Noto Sans", size: 10pt, kerning: true, lang: "en", ligatures: true, ) #show math.equation: set text(font: "Noto Sans Math") #show raw: set text(font: "JetBrains Mono", size: 10pt) #set heading( numbering: "1.1" ) #show heading.where(level: 1): head => [ #set text(size: 2.5em) #align(center)[ #block(head.body) ] ] #show heading.where(level: 2): head => [ #set align(center) #pad(y: 2em)[ #head ] ] #show image: img => [ #align(center)[ #img ] ] #show table: tbl => [ #align(center)[ #tbl ] ] #show raw.where(block: true): code => [ #pad(x: 2em, 1em)[ #code ] ] #outline(indent: auto,) #pagebreak() #include "DC/dc.typ"
https://github.com/ffasbend/refcards
https://raw.githubusercontent.com/ffasbend/refcards/main/python_refcard/readme.md
markdown
MIT License
# Python Reference Card This Python Reference Card (french version) is used in schools in Luxembourg. The document has been typeset with **typst**, a new markup-based typesetting system that is designed to be as powerful as LaTeX while being much easier to learn and use (see https://typst.app/). Latest version of typst has been used to typeset this docuemnt. Fonts used in the document: - Wingdings - Calibri - Iosevka Fixed (https://typeof.net/Iosevka/), or download font directly from https://github.com/be5invis/Iosevka/releases/download/v27.3.3/ttf-iosevka-fixed-27.3.3.zip # Editing and compiling typst files with Visual Studio Code To typeset the document locally, download typst from its github repository (https://github.com/typst/typst). If you are using **vsCode** to edit typst files, install the following extensions: - Typst LSP - Typst Preview Inside the folder `.vscode` is the task configuration file `tasks.json` for vscode. On Mac press SHIFT + CMD + B to compile the **typst** document and choose one of the following options - Watch typst file (auto-compile on save)... - Compile typst file...
https://github.com/wagaaa/HZAU_Typst
https://raw.githubusercontent.com/wagaaa/HZAU_Typst/main/README.md
markdown
MIT License
# HZAU_Typst Typst template for HZAU dissertation 华中农业大学学位论文Typst模版(开发中) ## 使用方法 1. 安装[Typst](https://typst.app/) 2. 安装字体依赖(宋体、黑体、Times New Roman等) 3. 使用推荐的编辑器(VSCode)编辑`main.typ` ## 待完善功能 - [x] 页眉页脚 - [x] 目录 - [x] 简单图表 - [ ] 装订页边距 - [ ] 格式调整 - [x] 自动生成参考文献?CSL格式支持不佳 - [ ] 参考文献、附录、致谢暂未加入目录 ## 文件结构 ``` . ├── LICENSE ├── README.md ├── assets 🖼️图片、媒体等 │ ├── HZAU_LOGO.png LOGO图 │ ├── ref.bib 参考文献 │ └── sample_image.jpg 图片 ├── dependents 项目依赖 │ ├── appendix.typ 随附页面 │ ├── figures.typ 图表 │ ├── hzau.csl 引用格式 │ └── style.typ 项目格式设置 ├── main.typ ⭐主文件,请编辑此文件完成论文 └── playground.typ ``` ## 致谢 - [werifu/HUST-typst-template](https://github.com/werifu/HUST-typst-template/tree/main) - [lucifer1004/pkuthss-typst](https://github.com/lucifer1004/pkuthss-typst/tree/main) - [OrangeX4/typst-tablem](https://github.com/OrangeX4/typst-tablem) - [HZAU-CSL](https://github.com/redleafnew/Chinese-STD-GB-T-7714-related-csl/blob/main/403huazhong-agricultural-university.csl)
https://github.com/Kasci/LiturgicalBooks
https://raw.githubusercontent.com/Kasci/LiturgicalBooks/master/CSL_old/oktoich/Hlas3/6_Sobota.typ
typst
#let V = ( "HV": ( ("", "<NAME>", "Stráždušče dóbliji múčenicy krípko, i rány, i vjazánija, i razlíčnyja múki preterpívše, k neboľíznennomu voístinnu i blažénnomu nasľídiju privedóšasja, po dostojániju boľíznej."), ("", "", "Íže slóvo blahočestívo i božéstvenno otrýhnuvše, Hospódni svjatítelije, i vsjá jeretíčeskaja soprotivoslóvija razrušíste, i vírnym vsím pervoďíteľnicy javístesja: sehó rádi počitájemi jesté."), ("", "", "Neveščéstvennych i bezplótnych čínu upodóbistesja otcý Bohonósniji, v ťilesí veščéstvenňi, ťích preslávno žitijé pokazújušče: ťímže vo obítelech ťích živeté."), ("", "<NAME>", "Vélija krestá tvojehó Hóspodi síla: vodruzísja bo na mísťe, i ďíjstvujet v míri, i pokazá ot rýbarej apóstoly, i ot jazýk múčeniki, da móľatsja o dušách nášich."), ("", "", "Vélija múčenik tvojích Christé síla: vo hrobích bo ležášče dúchi prohóňat: i uprazdníša vrážiju vlásť, víroju Tróičeskoju podvíhšesja po blahočéstiji."), ("", "", "Prorócy, i apóstoli Christóvy, i múčenicy, naučíša ný píti Tróicu jedinosúščnuju, i prosvitíša jazýki preľščényja, i pričástniki, ánhelom sotvoríša sýny čelovíčeskija."), ("Bohoródičen", "", "Káko ne divímsja Bohomúžnomu roždéstvú tvojemú, prečestnája? Iskušénija bo múžeskaho ne priímši vseneporóčnaja, rodilá jesí bez otcá Sýna plótiju, préžde vík ot Otcá roždénnaho bez mátere, nikákože preterpívšaho izminénija, ilí smišénija, ilí razďilénija: no obojú suščestvú svójstvo cílo sochránšaho. Ťímže Máti Ďívo Vladýčice, tohó molí spastísja dušám, pravoslávno Bohoródicu ispovídajuščich ťá."), ), "S": ( ("", "", "Múčenicy tvojí Hóspodi víroju utverdívšesja, i nadéždeju ukrípľšesja, ľubóviju krestá tvojehó dušévňi sojedinívšesja, vrážije mučíteľstvo razrušíša, i ulučíša vincý: so bezplótnymi móľatsja o dušách nášich."), ("Mértven", "", "Vsé sújetije čelovíčeskoje, jelíko ne prebúdet po smérti: ne prebúdet bohátstvo, ni snídet sláva: našédši bo smérť, vsjá sijá pohubít. Ťímže Christú bezsmértnomu carjú vozopijím: prestávlennyja ot nás upokój, iďíže vsích jésť veseľáščichsja žilíšče u tebé."), ("Mértven", "", "Čelovícy, čtó vsúje mjatémsja? Púť krátok jésť, ímže tečém, dým jésť žitijé, pára i pérsť i pépel: vmáľi javľájetsja, i vskóri pohibájet. Ťímže Christú bezsmértnomu carjú vozopijím: prestávlennyja ot nás upokój, iďíže vsích jésť veseľáščichsja žilíšče u tebé."), ("Bohoródičen", "", "V ženách svjatája Bohoródice Máti beznevístnaja, molí jehóže rodilá jesí, carjá i Bóha nášeho, da spasét ný, jáko čelovikoľúbec."), ), ) #let P = ( "1": ( ("", "", "Vódy drévle, mánijem božéstvennym, vo jedíno sónmišče sovokupívyj, i razďilívyj móre Izráiľteskim ľúdem, séj Bóh náš, preproslávlen jésť: tomú jedínomu poím, jáko proslávisja."), ("", "", "Spaséniju načáľnika i žiznodávca róždšaja páče smýsla vsehó, soúz razrišíla jesí osuždénija Jévy pramátere. Ťímže tvár vsjá blažít ťá, Bohorodíteľnice čístaja."), ("", "", "Ozlóblennaho ľútymi boľízňmi, dušéju i ťílom, presvjatája Ďívo, ischití ot hlubiný nečájanija, vsích núždnych izbavľájušči mjá: tý bo jesí prečístaja, milosérdija istóčnik."), ("", "", "Sovlekóchsja odéždy vesélija, v skórb vpád i boľízň, i ľúťi ujazvíchsja otvsjúdu: predvarí i izbávi mjá ot oderžáščija prélesti: tý bo mí jesí Vladýčice, pribížišče i nadéžda."), ("", "", "Predstáteľnicu ťá tvérdu sťažáv Bohonevísto, ko tvojemú pokróvu pritekáju, moľásja: ne prézri mjá tvojehó rabá, mnóhimi strasťmí i boľízňmi i skorbmí oťahčéna, no molítvami tvojími iscilí Máti Bóžija."), ), "3": ( ("", "", "Íže ot ne súščich vsjá privedýj, slóvom sozidájemaja, soveršájemaja Dúchom, vsederžíteľu výšnij, v ľubví tvojéj utverdí mené."), ("", "", "V nedoumíniji i skórbi boľíznenňi jésm okajánnyj, vo sľíd sebé smérť zrjá: ťímže prečístaja, tvojéju molítvoju spasí mja."), ("", "", "Vsé žitijé rastľínno zlými i blúdnymi ďijániji klevéščet na mjá, i otčájanijem mjá pohružájet: čístaja, spasí mja."), ("", "", "Ščedrót tvojích bézdna, vsjúdu prolivájema Vladýčice, jedínyja rádi bláhosti, vo jeléi mastíťi umaščájet vsích prísno ťá pojúščich."), ("", "", "Jáko ot načála ťá jestestvá nášeho prijém Bohonevísto, Sýn tvój i Hospóď, sovokupľájet molítvami tvojími tebé pojúščyja."), ), "4": ( ("", "", "Položíl jesí k nám tvérduju ľubóv Hóspodi, jedinoródnaho bo tvojehó Sýna za ný na smérť dál jesí. Ťímže tí zovém blahodarjášče: sláva síľi tvojéj Hóspodi."), ("", "", "Vsjú na ťá nadéždu položích Vladýčice, moľúsja i pripádaju ot duší: smertonósnyja izbávi boľízni, vozvoďášči mjá k žízni spasénija, jáže žízň róždšaja."), ("", "", "Iscilí mja čístaja, molítvami tvojími otčájannaho rabá tvojehó, podóbijem ľútych i rastľínnych rán: vračá bo rodilá jesí, v mílosti bohátaho Bóha nášeho."), ("", "", "V strásti ľútyja vpádšaho mjá izbávi, i vesélija odéždu posiščénijem tvojím božéstvennym podážď mí, jáže preimúščuju vsják úm rádosť Ďívo, prorastívšaja."), ("", "", "Druhóje Nébo Bohoródice javílasja jesí, sólnce právdy neskazánno na zemlí čístaja, vozsijávšaja: ímže nám vozsijá Bohorazúmija svít prisnosúščnyj."), ), "5": ( ("", "", "K tebí útreňuju vsích tvorcú, preimúščemu vsják úm mírovi: zané svít poveľínija tvojá, v níchže nastávi mjá."), ("", "", "Mértvosť tvorjáščij i strásti priblížichsja, ot mojích bezmírnych hrichóv: Máti Bóžija, ťá izbavlénije mnóhich zlých mojích býti, moľú priľížno."), ("", "", "Dušévniji mojí rúci prostiráju k tebí čístaja, plotskími bo razslabích okajánnyj: no tý ot mnóhich rán izbávi mjá, podajúšči iscilénije."), ("", "", "Sovlekóchsja zdrávyja odéždy, i plačévnuju rízu v boľíznech oblék: tebí moľúsja Vladýčice, oblecý mja vo zdrávije."), ("", "", "Jáko múčenikov i apóstolov svjaščénnoje súšči blahoľípije Bohoródice, i vírnych zastuplénije, vsí dostójno ťá slávim."), ), "6": ( ("", "", "Vozvedí ot tlí mja Hóspodi Bóže mój, Jóna vopijáše. I áz vopijú ti: iz hlubiný izbávi mjá Spáse, mnóhich mojích zól, i k svítu tvojemú, moľúsja, nastávi."), ("", "", "Naprjažé na mjá mnóžestvo boľíznej, ot mojích bezmírnych sohrišénij tletvórnyj, i umerščvlénijem mjá obložíša: no tý samá Bohoródice, ot sích mjá izbávi, i vsjákija núždy ischití."), ("", "", "Vvéržen bých vo hlubinú prehrišénij, i boľíznej i skorbéj bezmírnych, i v sích nýňi otňúd podavľájusja: no tý Bohorodíteľnice, prostérši rúku ko spaséniju vozvedí mja."), ("", "", "Ťá osnovánije tvérdoje vím Bohoródice, i deržávnuju pómošč súščym v skórbi: ťímže k tvojemú pokróvu pribíh, moľú ťa, ot ľútych bíd izbávi mjá i ot ťážkich boľíznej."), ("", "", "Brazdú júže božéstvennyj klás prorástšuju, ímže vírnych serdcá pitájutsja víroju, i mýslennyj hlád prestá, Bóžij kovčéh vospoím, jáko Ďívu Bohomáter."), ), "S": ( ("", "", "Božéstvennaho jestestvá ne otlučísja, plóť býv vo črévi tvojém: no Bóh vočelovíčisja i prebýsť, íže po roždeství Máter ťá Ďívu, jáko préžde roždestvá sochranív vseneporóčnu jedín Hospóď: tohó priľížno molí, darováti nám véliju mílosť."), ), "7": ( ("", "", "Jákože drévle blahočestívyja trí ótroki orosíl jesí v plámeni chaldéjsťim, svítlym Božestvá ohném i nás ozarí, blahoslovén jesí vzyvájuščyja, Bóže otéc nášich."), ("", "", "Umilosérdisja na mjá Ďívo Bohonevísto, vo otčájanija hlubinú popóľzšasja: tebé tišinú býti mí, moľú prečístaja, spasénij bo jesí pristánišče súščym v núždach prísno."), ("", "", "Neizhlahólanno páče umá múdrosť i sílu Bóžiju rodilá jesí Christá: ťímže síľna v mílosti, i ščédra súšči, dážď mí spasítelnyja ciľbý tvojá Bohoródice, nadéžde vírnych."), ("", "", "Obohatívši božéstvennym roždestvóm koncý, netľínija sládostiju, ot tletvórnyja mjá boľízni, i hórkich strastéj svobodí, i spasénije podážď, Bóžija Máti preslávnaja."), ("", "", "Íže dvér ťá tájnuju sebí predložív, i zastúpnicu dívnuju súščym na zemlí, tobóju čístaja dvér podadé čelovíkom vo víčnuju žízň vsích vvoďášču, jáko ščédr, i vsích Bóh."), ), "8": ( ("", "", "Vavilónskaja péšč ótroki ne opalí, nižé Božestvá óhň Ďívu rastlí. Ťím so ótroki vírniji vozopijém: blahoslovíte ďilá Hospódňa Hóspoda."), ("", "", "Prehrišénij neizčétnuju pučínu sťažáv, nýňi soudavľájusja, čístaja, v boľíznech pohružájem. Ťímže mí rúku pómošči prostérši, iz hlubiný boľíznej vozvedí, moľúsja."), ("", "", "Prestól Bóhu zemlényj, dvér že nebésnaja javílasja jesí prisnoďívo čístaja, Bohoródice vsepítaja. Ťímže mí spasénija dvér otvérzi Bohomáti, i ťmý strastéj svobodí."), ("", "", "Jáko vinohrád vozrastíla jesí, hrózd nevozďílan čístaja, vinó istočájušč dušám, veseľáščeje vírno pojúščich jehó, vseneporóčnaja."), ("", "", "Jáže po roždeství netľínna prebývši vseneporóčnaja, mólimsja, čístaja, izbávi ot tlí rabý tvojá, vírno pojúščyja jedinomyšlénijem duší: blahoslovíte vsjá ďilá Hóspoda, i prevoznosíte jehó vo víki."), ), "9": ( ("", "", "Na Sinájsťij horí víďi ťá v kupiňí Moiséj, neopáľno óhň Božestvá začénšuju vo črévi: Danijíl že ťá víďi hóru nesikómuju, žézl prozjábšij, Isáia vzyváše, ot kórene Davídova."), ("", "", "O Ďívo blahája! O míra rádoste i pribížišče! O chranílišče vírnych, i izbavlénije skorbéj! Tý predstáni mí v čás smérti, i izbávi ot bisóv, íščuščich rastlíti mjá."), ("", "", "Jáko ziždíteľa i Bóha začénši vo utróbi, Ďívo Máti čístaja, síloju jáže v tebí nizloží bisóv šatánija, i voznesí róh pojúščich deržávu tvojú božéstvennuju, i vírno poklaňájuščichsja óbrazu tvojemú."), ("", "", "Novosoďílav náše jestestvó, íže ot tebé voploščéjsja, Ďívo čístaja, nóvo ďílajet i obnovľájet, máterneju tvojéju molítvoju, svítluju i bódruju zastúpnicu, i súščuju Bohoródicu v písnech neprestánno ťá veličájuščich."), ("", "", "Tý ánhelov rádosť, tý právednikov dobróta, tý vírnych nadéžda, tý sobľudénije náše: tý móst, íže k žízni nesostaríjuščejsja prevoďáščij, víroju i ľubóviju ťá veličájuščyja."), ), ) #let U = ( "S1": ( ("", "", "Blahodúšnoje terpínija vášeho pobidí kózni zlonačáľnaho vrahá strastotérpcy vsechváľniji: sehó rádi víčnaho spodóbistesja blažénstva. No molítesja Hóspodevi, Christoľubívych ľudéj spastí stádo, múčenicy súšče ístinniji."), ("", "", "Sijájete víroju presvítlaja svitíla svjatíji, nedúhujuščich vráčeve, strástotérpcy prechváľniji, mučítelej úbo rán ne ubojástesja, ídoľskoje zločéstije nizložíste, pobídu imúšče nepobidímuju, krest ístinnyj."), ("Bohoródičen", "", "Ťá chodátajstvovavšuju spasénije róda nášeho, vospivájem Bohoródice Ďívo: plótiju bo ot tebé vosprijátoju Sýn tvój i Bóh náš, krestóm vospriím strásť, izbávi nás ot tlí, jáko čelovikoľúbec."), ), "S2": ( ("", "", "Vooružívšesja vseorúžestvom Christóvym, i obólkšesja vo orúžije víry, polkí vrážija stradáľčeski nizložíste, usérdno bo upovánijem žízni, preterpíste vsjá mučítelej preščénija že i rány. Ťímže i vincý prijáste, múčenicy Christóvy terpilivodúšniji."), ("", "", "Strástotérpcy svjatíji, molíte mílostivaho Bóha, da prehrišénij ostavlénije podást dušám nášym."), ("", "", "Jehdá slóvom tvojím predstánem bezmézdnomu tvojemú sudíšču Hóspodi, ne posramí v ťá vírovavšich Spáse náš: vsí bo sohrišíchom, no tebé ne otstupíchom. Ťímže mólim ťá, v selénijich právednych tvojích, Christé, íchže prijál jesí, upokój: jedín bo jesí bezhríšen."), ("Bohoródičen", "", "Prorócy propovídaša, apóstoli naučíša, múčenicy ispovídaša, i mý vírovachom, Bohoródicu ťá voístinnu súščuju: ťímže i veličájem roždestvó tvojé, prečístaja."), ), "K": ( "P1": ( "1": ( ("", "", "Dívno, slávno tvorjáj čudesá tý jesí Bóže, bézdnu ozemlenívyj, i kolesnícy potopívyj, i ľúdi spasýj pojúščyja tebí, jáko carjú nášemu i Bóhu."), ("", "", "Mučénija slávu, premúdriji, obritóste vsí stradáľcy, mučénija mnohoobráznaja dóblestvenňi preterpíste, strastotérpcy: ťímže slávimi jesté prísno."), ("", "", "Prevýššij imúšče živót javístesja božéstvenniji služítelije, premúdriji svjaščennotaínnicy voplóščšahosja Slóva, upásše dóbri Hospódne stádo síloju božéstvennoju."), ("", "", "Raspénšesja mírovi prepodóbniji, plotskích vsích slastéj otverhóstesja, i sosúdi Dúcha jávľšesja, dúchi preléstnyja božéstvennoju síloju pohubíste vkúpi."), ("", "", "Íže ot zemlí poveľínijem tvojím Hóspodi, víroju blahočéstnoju ščédre prestávľšyjasja, žízni bezkonéčnyja i svíta nevečérňaho spodóbiv, upokój jáko bláh."), ("Bohoródičen", "", "Jáko Bóha róždšuju plótiju prečístaja, nrávom blahočéstnym čtím ťá neprestánno, s čéstnými ženámi, postóm prosijávšimi, i stradáňmi vrahá nizložívšimi."), ), "2": ( ("", "", "Presikájemoje móre žezlóm drévle Izrájiľ prójde jáko po pustýni, i krestoobrázno jávi preduhotovľájet stezí: sehó rádi pojím vo chvaléniji čúdnomu Bóhu nášemu, jáko proslávisja."), ("", "", "Pohrebénijem tvojím smérť umertvív, i nizložív ádovo mučíteľstvo, na nebesá predtéča nám vozšédyj, strastotérpčeskij lík sovoznésl jesí. Nýňi že dúši upokój prestávlennyja k tebí Christé."), ("", "", "Íže božéstvennyja múčeniki ukripľájaj, i ťími prélesť potrebívyj, moľbámi ích, jáko Bóh, skončávšymsja jáže o tebí Spáse, bezsmértije i blažénnoje nasľídije ulučíti blahovolí."), ("", "", "Za rabý Vladýko, tvojú króv zaklávsja izlijál jesí jáko ščédr, dólh že za ních vozdajá: sehó rádi milosérde, tebé mólim, prestávlennyja rabý tvojá k tebí upokój."), ("", "", "Čístuju vospojím Bohoródicu, Bóha róždšuju, smértiju svojéju smérť nášu isprovérhšaho, i žízň istočívšaho nestaríjuščujusja, i vo víki prebyvájuščeje blažénstvo."), ), ), "P3": ( "1": ( ("", "", "Neplódnaja dušé i bezčádnaja, sťaží plód blahoslávnyj, veseľáščisja vozopíj: utverdíchsja tobóju Bóže, ňísť svját, ňísť práveden, páče tebé Hóspodi."), ("", "", "Síloju Bóžijeju ukripľájemi múčenicy slávniji, pahuboródnuju sílu, íže v zlóbi síľnaho vrahá, do koncá pohubíste, i pobídnyja prijáste božéstvennyja vincý."), ("", "", "Íže prepodóbnyja Vladýko, javíl jesí vrahá pobidíteli, i svjatíteli pomázanijem presvjatým osvjatívyj Christé, ťích moľbámi osvjatí i prosvití pojúščyja ťá."), ("", "", "So proróki vsími voschválim žén božéstvennych lík, jáže v posťí prosijávšyja, i víroju postradávšyja, i mnohokóznennaho zmíja poprávšyja."), ("", "", "Íchže ot nás prestávil jesí božéstvennoju vóleju Christé, so svjatými učiní, jáže v žitijí prezrív ščédre, ťích prehrišénija, mólimsja, molítvami svjatých tvojích."), ("Bohoródičen", "", "Íže spaséni prečístaja, tvojím svjatým roždestvóm, hlás Havriílov vopijém tí vírno, jéže rádujsja, i mólimsja: tvojími molítvami, prehrišénij proščénije vsím nám isprosí."), ), "2": ( ("", "", "Íže ot ne súščich vsjá privedýj, slóvom sozidájemaja, soveršájemaja Dúchom, vsederžíteľu výšnij, v ľubví tvojéj utverdí mené."), ("", "", "Sozdávyj mjá ot zemlí, i k zemlí vozvraščéna okajánnaho obnovívyj svitľíje, dúšy usópšich upokój molítvami múčenik."), ("", "", "Strastotérpec múčenik, bijéňmi že i vjazáňmi, ránami i jázvami, umolén byvája, dúšy ráb tvojích vo svjatých selénijich učiní ščédre."), ("", "", "Izbávi čelovikoľúbče rabý tvojá hejénny, ohňá že i mráčnych selénij áda, íže víroju Vladýko, usópšyja tvojéju nadéždeju."), ("", "", "Svjaščénňijšaja, jáko Máti ziždíteľa tvári súšči, smérti razóršaho sílu, Bohoródice prečístaja, i netľínije nám darovávšaho."), ), ), "P4": ( "1": ( ("", "", "Priosinénnuju hóru Avvakúm prozrjáše prečístuju tvojú utróbu čístaja. Ťím vzyváše: ot júha priídet Bóh, i svjatýj ot horý priosinénnyja čášči."), ("", "", "Jákože ovčáta privedóstesja vsí vóleju zaklávšesja jákože áhncy, múdriji stradáľcy, áhncu na drévi kréstňim blahoizvólivšemu Bóžiju Slóvu zaklátisja za ród čelovíčeskij."), ("", "", "So prepodóbnymi počtím blahoslávnyja pervosvjaščénniki, svitíľniki bývšyja vírnym: jéresi že razrušívšyja, i strastéj ťmú hlubókuju, i k nezachodímomu svítu víroju prelóžšyjasja."), ("", "", "Krasotóju slovés, Bohohlásniji prorócy prosviščájut vírnych dúšy, pódvihov že svitlosťmí, i čudés vostókami ozarjájut serdcá Bohonósnyja žený."), ("", "", "Íže žitijé ostávľšyja, premírňij slávi pričástniki pokaží, Slóve Bóžij, prehrišénij izbavlénije sím dárujaj bláže, jáže soďíjaša na zemlí v rázumi i ne v rázumi."), ("Bohoródičen", "", "Múčenikov slávu, svjatítelej i prepodóbnych božéstvennoje udobrénije, i vírnych utverždénije, prorókov ohlašénije, vsepítuju vospojím Hospódňu Máter."), ), "2": ( ("", "", "Položíl jesí k nám tvérduju ľubóv Hóspodi: jedinoródnaho bo tvojehó Sýna za ný na smérť dál jesí. Ťímže tí zovém blahodarjášče: sláve síľi tvojéj Hóspodi."), ("", "", "Vo hrób za ný mílostivno vselívsja Vladýko, hróby istoščíl jesí jáko Bóh, i pobidonóscy jávľ múčeniki, v mísťi oslablénija usópšyja rabý tvojá učiní."), ("", "", "Íže stradálec krípkija pódvihi, i rány, i udóv otsičénija, jáže za ťá preterpíša Vladýko, rádujasja prijémyj, i jáže prijál jesí, izbávi ot mučénija."), ("", "", "Íže manovénijem svoím životá imíja umírenije, bezkonéčnyja tvojejá žízni i netľínnyja slávy spodóbi, jáže k tebí prestávil jesí, hrichóvnoje razór sredohrádije."), ("", "", "Máti voístinnu i Ďíva javílasja jesí vseneporóčnaja, začátije i roždestvó ístinno, k Ďívstvu jedína sočetávši: Bóha bo rodilá jesí, smérti razóršaho sílu."), ), ), "P5": ( "1": ( ("", "", "Svítom tvojím nevečérnim Christé ozarí Bóže smirénnuju mojú dúšu, i nastávi na strách tvój, zané svít poveľínija tvojá."), ("", "", "Rány váša i jázvy, vrahú úbo javíšasja jázvy neiscíľnyja: jázvy že nýňi isciľájut vsích vírnych stradáľcy Hospódni."), ("", "", "Vospojím prepodóbnych mnóžestvo, i ublažím svjatíteli Christóvy, i počtím proróki jehó, nýňi o nás prísno moľáščyjasja."), ("", "", "Bóha voplóščšasja nás rádi, ľúbjaščja vseslávnyja žený, nrávom právym postradávša, i postívšasja, na nebesích nýňi prebyvájut."), ("", "", "V rájsťij Hóspodi píšči, vo straňí živých Christé, iďíže sijájet tvój svít, vselí jáže prestávil jesí ot zemlí, vírnyja tvojá rabý."), ("Bohoródičen", "", "Iz tebé prečístaja, Bóh voplotísja, i výššuju ťá ánhel pokazá nýňi, tvárej že vsích preimúščuju Vladýčice: ťímže ťá vospivájem."), ), "2": ( ("", "", "K tebí útreňuju vsích tvorcú, preimúščemu vsják úm mírovi, zané svít poveľínija tvojá, v níchže nastávi mjá."), ("", "", "V cérkvi pérvenec bláže, prešédšyja ot nás múčenik rádi, i čestných stradálec moľbámi: s právednymi pričtí."), ("", "", "Za izbavlénije mnóhich prehrišénij, presvjatúju króv tvojú Christé, izlijál jesí: i nýňi múčenik tvojích Spáse, moľbámi, blahočéstno usópšyja upokój."), ("", "", "Uprávi Slóve, otšédšich dúšy vo víčnoje místo sládosti tvojejá, jáže páče umá, i svjatých božéstvennyja svítlosti spodóbi."), ("", "", "Tebé Ďívu, júže páče slóva vo črévi neobiménnoje Slóvo začénšuju, mértvym žízň dajúščaho, dostójno blažím."), ), ), "P6": ( "1": ( ("", "", "Hlubiná strastéj vostá na mjá, i búrja protívnych vítrov: no predvarív mjá tý spasí Spáse, i izbávi ot tlí, jáko spásl jesí ot zvírja proróka."), ("", "", "Svitíľniki čestnýja cérkve, áhnca i pástyrja svjaščénňijšiji vseslávniji Christóvy stradáľcy da počtútsja svjaščénnymi písňmi."), ("", "", "Voznesésja prepodóbnych sobór voznesýj Bóha vo smiréniji: i proslávisja mnóžestvo svjatítelej v ďíľich dóbrych, proslávivšich svjatúju Tróicu."), ("", "", "Čudés pokazániji božéstvennych, i boľíznej terpínijem soveršénnym, bezzakónnujuščich vráh, svjaščénnych žén lík ujazví, múžeski dóblestvovavše."), ("", "", "Vo víri íchže ot zemlí prijál jesí, svjatých sopričtí sobórom, i v ňídrich vírnaho Avraáma učiní Christé, prísno sláviti tvojé mnóhoje blahoutróbije."), ("Bohoródičen", "", "múčenikov, prorókov i prepodóbnych, i vsích ot víka právednych pochvalá, tý jesí prečístaja: ťímže hlásy jávi rádostnymi čtím ťá s ními, Bohoródice."), ), "2": ( ("", "", "Vozvedí ot tlí mja Hóspodi Bóže mój, Jóna vopijáše, i áz vopijú ti: iz hlubiný izbávi mjá Spáse, mnóhich mojích zól, i k svítu tvojemú, moľúsja, nastávi."), ("", "", "Preloží na rádosť vo víri usópšich rydánije, molítvami strastotérpec, prepojasúja ích blahoľípňi Christé, vesélijem, i k svítu tvojemú napravľája i nastavľája."), ("", "", "Upokój Bóže, mnóžestvom ščedrót tvojích u patriárchov v ňídri prestávlenyja, iďíže svít sijájet svítlyj tvojehó licá, Christé, prezirája ích vsjá prehrišénija."), ("", "", "Udiví na otšédšich otsjúdu, i ľútych žitijá izbávlenych, čúdnuju mílosť, Christé, čelovikoľúbija tvojehó, i rádosti tvojejá nasýti, i krótosti."), ("", "", "Mértvosti i tlí, i smérti izbávichomsja, preslávnym roždestvóm tvojím, Bohomáti: tý bo nám rodilá jesí čístaja, netľínija istóčnik, i tvojím svítom mír vés prosvitíla jesí."), ), ), "P7": ( "1": ( ("", "", "Trijé ótrocy v peščí Tróicu proobrazívše, preščénije óhnennoje popráša, i pojúšče vopijáchu: blahoslovén jesí Bóže otéc nášich."), ("", "", "Stojášče posreďí ohňá, preslávniji strastotérpcy Hospódni, božéstvennuju rósu prijimáste s nebesé, i umertvívšesja múkami, mnohokóznennaho vrahá mértva soďílaste."), ("", "", "Božéstvenniji svjatítelije, jáko korábľ isprávivše cérkov Christóvu, nepotopľájemu tú sobľudóša, prélesti izbíhše voístinnu zlých vóln."), ("", "", "Umertvívše plóť svjaščénnymi pódvihi póstnicy ístinniji, bezstrástija nasľídovaste živót nesostaríjuščijsja, pojúšče: blahoslovén jesí Hóspodi Bóže otéc nášich."), ("", "", "Ne pokaží povínny na suďí rabý tvojá, jáže prestávil jesí vírnyja, no upokój Slóve, vo svítlosti svjatých tvojích, píti blahoutróbije tvojé."), ("Bohoródičen", "", "Múčenikov i prepodóbnych, i prorókov vseneporóčnaja, i svjatých žén, i vsích pervosvjaščénnikov svjáščennopožívšich, tý jesí sláva voístinnu, s nímiže čtím ťá."), ), "2": ( ("", "", "Jákože drévle blahočestívyja trí ótroki orosíl jesí v plámeni chaldéjsťim, svítlym Božestvá ohném i nás ozarí, blahoslovén jesí, vzyvájuščyja, Bóže otéc nášich."), ("", "", "Íže vsím živonačáľnaja, viná že i síla tvoríteľnaja, Slóve Bóžij, obiščánnyja múčenikom píšči spodóbi dúšy prestávlennych ráb tvojích. Blahoslovén jesí Bóže otéc nášich."), ("", "", "O ťilesích úbo jáko tľínnych, dóblestvenňi neradíša slávniji múčenicy Christé: nýňi že so derznovénijem móľatsja k tebí: dúšy pokój prestávlennych ráb tvojích. Otéc nášich Bóže, blahoslovén jesí."), ("", "", "Tróstiju krestnoju podpisál jesí ostavlénije hrichóv vsím vírnym, jemúže nýňi dúšy, jáže prestávil jesí k tebí, pričastítisja spodóbi, i vesélijem píti ťá: otéc nášich Bóže, blahoslovén jesí."), ("", "", "Slóvo Ótčeje, íže vsjá vóleju soďivájaj, jestestvó čelovíčeskoje pohrebénoje strasťmí. Jáko Bóh obnoví: blahoslovén , prečístaja, plód tvojehó čréva."), ), ), "P8": ( "1": ( ("", "", "Ánhelmi nemólčno vo výšnich slávimaho Bóha, nebesá nebés, zemľá, i hóry, i chólmi, i hlubiná, i vés ród čelovíčeskij, písňmi tohó jáko sozdáteľa i izbáviteľa blahoslovíte, i prevoznosíte vo vsjá víki."), ("", "", "Nanesénijem rán, i boľíznej priložéňmi obderžími ziló, ne otverhóstesja ístinnaho životá, Hospódni strastotérpcy, ni istukánnym podáste póčesti, prélesti lukávij."), ("", "", "Svitíla, jákože na svíščnicich položéni, čestných dobroďítelej, vsích ozaríste dúšy, vsjáku ťmú othnávše strastotérpcy svjaščennoďíjstvenniji, nebésnym umovóm sožítelije."), ("", "", "Dostochváľniji prorócy, i prepodóbnych soslóvije, i žén vsích blahohovíjnych mnóžestvo dostoslávnoje, da vospojétsja dostójno, o nás moľáščesja Spásu i Bóhu."), ("", "", "Tý íže živými obladájaj, jáže ot zemlí prestávil jesí vírnyja, so svjatými vo svíťi licá tvojehó učiní, proščénije prehrišénij, mnóhaho rádi, Spáse, milosérdija podajá sím."), ("Bohoródičen", "", "Mnohopítaja Ďíva, prorókov ohlašénije, svjatítelej i stradáľcev, i prepodóbnych udobrénije, i žén svjatých rádosť, da pojétsja po dólhu vo víki."), ), "2": ( ("", "", "Služíti živómu Bóhu, vo Vavilóňi ótroki preterpívše, o musikíjskich orháňich neradíša, i posreďí plámene stojášče, Bohoľípnuju písň vospiváchu hlahóľušče: blahoslovíte vsjá ďilá Hospódňa Hóspoda."), ("", "", "Sýj sokróvišče bezsmértija, tý živonačáľniče, mértvym netľínije provozvistíl jesí, jéže tvojím múčenikom, Christé, blahočéstno víroju tebí pojúščym darovál jesí: blahoslovíte vsjá ďilá Hospódňa Hóspoda."), ("", "", "Múdrostiju duchóvnoju, i terpínijem ďíl krípcyji stradáľcy o múkach neradíša, dušám prestávlennym ot Christá ostavlénija prósjat, zovúšče: blahoslovíte vsjá ďilá Hospódňa Hóspoda."), ("", "", "Očísti bláže, kopijém rébr tvojích rasterzáv rukopisánije k tebí prestávlennych, i sredohrádije otjém prehrišénij, pisnoslóviti ťá prijém ích Spáse, blahovolí: blahoslovíte vsjá ďilá Hospódňa Hóspoda.."), ("", "", "Óblak ťá mýslennyj pretrúždšymsja žáždeju umerščvlénija, Ďívo čístaja, vímy, vódu žívu ostavlénija istočájušču, i mértvym bezsmértije vsím podajúščuju, víroju prísno zovúščym: blahoslovíte vsjá ďilá Hospódňa Hóspoda."), ), ), "P9": ( "1": ( ("", "", "Na sinájsťij horí víďi ťá v kupiňí Moiséj, neopáľno óhň Božestvá začénšuju vo črévi: Daniíl že ťá víďi hóru nesikómuju, žézl prozjábšij, Isáia vzyváše ot kórene Davídova."), ("", "", "Jákože ovčáta privedóstesja zaklávšemusja nás rádi, i božéstvennyja líki ánhel ispólniste rádosti, strastotérpcy Christóvy. Ťímže molítvami vášimi vsích utverdíte, i ot vrahá vrédnyja prélesti vsích izbávite."), ("", "", "Jáko svitíľnicy živótnoje Slóvo imúšče, prosvitíste dúšy, pervosvjaščénnicy Christóvy svjaščénňijšiji, božéstvennyja slávy pričástnicy: jáko óhň priímše Dúcha prepodóbniji, strásti popalíste, i ídoľskoje razžizánije pohubíste."), ("", "", "So proróki svjatými počtím prepodóbnych mnóžestvo, préžde zakóna, i v zakóňi vozsijávšich žitijém čístym, žén že svjatých líki voschválim, i vozopijím: Hóspodi, molítvami ích spasí vsích nás."), ("", "", "Pohrebénije tvojé Christé, i voskresénije, vsím býsť živót. Sehó rádi derzájušče vopijém tí: so vsími izbránnymi vírnyja, jáže prijál jesí rabý tvojá upokój sích sohrišénija vsjá proščája, jáko Bóh preblahíj."), ("Bohoródičen", "", "Strášno místo sijé, vozopí, jehdá Jákov tvojé voobražénije v ľístvici víďi, Bohoródice, nelóžňi: múčenikov slávo, i prepodóbnych pochvaló, ánhelov ukrašénije, i vsích prorókov, i vírnych spasénije."), ), "2": ( ("", "", "Kupinóju i ohném propísannuju v Sinái zakonopolóžniku Moiséju, i Bóžij vo črévi neopálno začénšuju óhň, vsesvítluju i nehasímuju sviščú, súščuju Bohoródicu písňmi čtúšče veličájem."), ("", "", "Nýňi jáko jedín bláh, i čelovikoľúbec Bóh, prestávlennyja k tebí, múčenik moľbámi, v straňí krótkich zemlí vselí, razrišénije prehrišénij podajá mílostive sím, da neprestánno písňmi ťá veličájem."), ("", "", "Vo svjatých selénijich, v ňídrich Avraáma, jáže prijál jesí Christé, pričtí s právednymi tvojími: iďíže sijájet svít licá tvojehó neizrečénnyj i božéstvennyj, i prebyvájuščeje vo víki voístinnu prisnosúščnoje rádovanije."), ("", "", "Blažénnyja tvojejá žízni, i víčnych bláh neprestánnyja píšči, vesélija ístinnaho spodóbi rabý tvojá, jáže prestávil jesí vóleju žiznodávče, v mísťi zláčňi, na vodách pokójnych."), ("", "", "Jáko svjatýj kovčéh, i sviďínija skínija zakonodávca Bóha, prijála jesí vo utróbi vseneporóčnaja ziždíteľa tvojehó, izrečénije drévnija kľátvy, i zakón smérti svojéju smértiju isprovérhšaho."), ), ), ), "CH": ( ("", "", "Svjatých múčenik pámjať, prijidíte ľúdije, vsí počtím, jáko pozór býša ánhelom i čelovíkom i pobídy vincý ot Christá prijáša, i móľatsja o dušách nášich."), ("", "", "Caréj i mučítelej strách otrínuša Christóvy vóini, i blahoderznovénno i múžeski tohó ispovídaša, vsjáčeskich Hóspoda Bóha i carjá nášeho, i móľatsja o dušách nášich."), ("", "", "Síly svjatých ánhel udivíšasja múčeničeskim stradánijem, jáko plótiju smértnoju obložéni, o múkach neradíša, podóbnicy bývše strastém Spása Christá, i móľatsja o dušách nášich."), ("", "", "Jáko svitíla v míri sijájete, i po smérti svjatíji múčenicy, pódvihom dóbrym podvíhšesja: i imúšče derznovénije, Christá umolíte, pomílovatisja dušám nášym."), ("Mértven", "", "Čelovícy, čtó vsúje matémsja? Púť krátok jésť, tecém: dým jésť žitijé, pára, pérsť i pépeľ: vmáľi javľájetsja, i vskóri pohibájet. Ťímže Christú bezsmértnomu carjú vozopijím: prestávlennyja ot nás upokój, iďíže vsích jésť veseľáščichsja žilíšče u tebé."), ("Bohoródičen", "", "Bez símene začalá jesí ot Dúcha Svjatáho, i slavoslóvjašče vospivájem ťá: rádujsja presvjatája Ďívo."), ), "ST": ( ("", "", "Slávľu krest tvój čéstnýj, ímže živót darovásja, i píšči naslaždénije, víroju i ľubóviju ťá pojúščym, jedíne mnohomílostive. Ťímže vopijém tí Christé Bóže: prestávľšyjasja ot nás upokój, iďíže vsích jésť veseľáščichsja žilíšče u tebé."), ("", "", "Jedíne mílostive i blahoutróbne, imíjaj nepostižímuju bláhosti pučínu, svídyj jestestvó čelovíčeskoje, jéže soďílal jesí: ťá mólim Christé Bóže, prestávlennyja ot nás upokój, iďíže jésť vsích veseľáščichsja žilíšče u tebé."), ("", "", "Usnúv vo hróbi jáko čelovík, síloju že nepobidímoju jáko Bóh voskresíl jesí, jáže vo hrobích spjáščyja, nemólčnyja písni tebí prinosjáščyja. Ťímže mólim ťá Christé Bóže: prestávlennyja ot nás upokój, iďíže jésť vsích veseľáščichsja žilíšče u tebé."), ("Bohoródičen", "", "Sviščú razúmnuju ťá, nosjáščuju svít Božestvá, sovokúpľšasja debeľstvú čelovíčeskaho suščestvá, Bohoródice, vsí vímy: tvojehó molí Sýna i Bóha, prestávlennyja ot nás upokóiti, iďíže jésť vsích veseľáščichsja rádovanije."), ) ) #let L = ( "B": ( ("", "", "Otvérhša Christé, zápoviď tvojú práotca Adáma, iz rajá izhnál jesí: razbójnika že ščédre, ispovídavša ťá na kresťí, vóň vselíl jesí, zovúšča: pomjaní mja Spáse, vo cárstviji tvojém."), ("", "", "Óhnennym ránam primišájuščesja strastotérpcy Christóvy, rósu nebésnuju obritóste, prochlaždájuščuju že i ukripľájuščuju vás terpíti plotskíja hórkija boľízni: ťímže oblehčevájete vsjáku boľízň prísno ot dúš nášich."), ("", "", "Svjatítelije svjaščénniji, prorócy slávniji, prepodóbnych mnóžestvo, i žén božéstvennych sobór, postradávšich víroju, i nizložívšich prélesť vrážiju, nebésnuju slávu polučíša: íchže molítvami Spáse, uščédri rabý tvojá."), ("", "", "Iďíže sijájet tvój svít, vo chrámich izbránnych tvojích Bóže, iďíže píšča prisnosúščnaja, jáže ot nás víroju prestávlennyja učiní Iisúse, prezrjá ích Spáse, sohrišénija: da ťá Vladýko, priľížno slávim."), ("", "", "Otcú, i Sýnu, i Dúchu božéstvennomu, poklaňájemsja vírniji Tróici nesozdánňij, v trijéch lícich, i vo jedínom Božeství, prísno ot bezplótnych síl, v trijéch svjaščénijich slavoslóvimij vírno."), ("", "", "Prosviščénije i očiščénije, iz tebé javísja vsích izbáviteľ, Bohorádovannaja Vladýčice, jehóže priľížno molí v búduščij súd strášnyj, osuždénija vsjákaho nás izbáviti prečístaja, vírno vsehdá pojúščich ťá."), ) )
https://github.com/floriandejonckheere/utu-thesis
https://raw.githubusercontent.com/floriandejonckheere/utu-thesis/master/thesis/helpers.typ
typst
// Helpers for systematic literature review #let total = (category) => category.values().sum().len() #let count = (category, item) => category.at(item).len() #let percentage = (category, item) => [#calc.round((100 * count(category, item) / total(category)), digits: 1)%] #let slr = yaml("/bibliography/literature-review.yml") #let artifacts = slr.at("categories").at("artifacts") #let algorithms = slr.at("categories").at("algorithms") #let metrics = slr.at("categories").at("metrics") #let bibliography = ( "01-introduction", "02-methodology", "03-background", "04-related-work", "05-modular-monolith", "06-automated-modularization", "07-proposed-solution", "08-case-study", "09-conclusion", ).map(c => yaml("/bibliography/" + c + ".yml")).fold({}, (a, b) => a + b) #let slr_bibliography = yaml("/bibliography/literature-review/acm.yml") + yaml("/bibliography/literature-review/ieee.yml") + yaml("/bibliography/literature-review/snowballing.yml") // Create a reference to a paper #let slr_reference = ((t, l) => [ #show figure.where(kind: "paper"): set block(breakable: false) #figure( box(width: 100%)[#align(left)[#t]], kind: "paper", supplement: none, numbering: (..nums) => "[P" + nums.pos().map(str).join("") + "]", ) #label(l) ]) // Find a reference in the bibliography #let entry = (key) => { if (slr_bibliography.at(str(key), default: none) != none) { slr_bibliography.at(str(key)) } else { bibliography.at(str(key)) } } // Cite a paper (author) #let cite_author = (key) => { let names = entry(key).at("author").map(a => a.split(", ").at(0)) if (names.len() == 1) { names.at(0) } else if (names.len() == 2) { names.at(0) + " and " + names.at(1) } else if (names.len() == 3) { names.at(0) + ", " + names.at(1) + " and " + names.at(2) } else { names.at(0) + " et al." } } // Cite a paper (author and reference) #let cite_full = (key) => { let names = entry(key).at("author").map(a => a.split(", ").at(0)) if (names.len() == 1) { names.at(0) + " " + ref(key) } else if (names.len() == 2) { names.at(0) + " and " + names.at(1) + " " + ref(key) } else { names.at(0) + " et al. " + ref(key) } } // Create a reference to a scenario #let scn_reference = ((t, l) => [ #show figure.where(kind: "scenario"): set block(breakable: false) #figure( box(width: 100%)[#align(left)[#text(weight: "thin", t)]], kind: "scenario", supplement: "Scenario", numbering: (..nums) => "[S" + nums.pos().map(str).join("") + "]", ) #label(l) ])
https://github.com/VisualFP/docs
https://raw.githubusercontent.com/VisualFP/docs/main/SA/project_documentation/content/meeting_minutes/week_11.typ
typst
= Project Meeting 28.11.2023 08:15 - 09:00 (MS Teams) == Participants - Prof. Dr. <NAME> - <NAME> - <NAME> == Agenda - Presentation of current state of PoC - UI mostly integrated with inference part - There are still some issues with lambdas & polymorphic functions - Plan for the rest of the semester: - Until mid/end of week 12: Fixing bugs in PoC, graphics improvements, better lambda support - Week 12 & Week 13: catching up with documentation, creating abstract - Week 14: final improvements in documentation (typos, rephrasing), writing personal reports, submission Input from Advisor: - Think about license agreements. The possibilities are MIT, GPL 3 or the default agreement by OST - Make sure that the different UI components (type holes, functions, etc.) are distinguishable
https://github.com/typst-jp/typst-jp.github.io
https://raw.githubusercontent.com/typst-jp/typst-jp.github.io/main/docs/tutorial/3-advanced.md
markdown
Apache License 2.0
--- description: Typst's tutorial. --- # 高度なスタイリング このチュートリアルの前の2つの章では、Typstで文書を書く方法とその書式を変更する方法を学びました。 それらの章を通して書いたレポートが優れた評価を得たため、指導教員はそれを基に学会論文を書いてほしいと考えています! もちろん、論文は学会のスタイルガイドに従わなければなりません。 どうすればそれを達成できるか見てみましょう。 始める前に、チームを作成して、そのチームに教員を招待して追加しましょう。 まず、エディターの左上にある戻るアイコンでアプリのダッシュボードに戻ります。 次に、左のツールバーのプラスアイコンを選択し、チームを作成します。 最後に、新しいチームをクリックし、チーム名の横にあるmanage teamをクリックして設定に進みます。 これで教員をメールで招待することができます。 ![The team settings](3-advanced-team-settings.png) 次に、プロジェクトをチームに移動します。 プロジェクトを開き、左のツールバーの歯車アイコンを選んで設定に行き、Ownerのドロップダウンから新しいチームを選択します。 変更を保存するのを忘れないでください! あなたの教員もプロジェクトを編集することができ、お互いにリアルタイムで変更を確認できます。 公式の[Discordサーバー](https://discord.gg/2uDybryKPe)に参加して他のユーザーを見つけ、一緒にチームを組んでみることも可能です! ## 学会ガイドライン { #guidelines } レイアウトのガイドラインは学会ウェブサイトに掲載されております。 ここでは以下の条件であった場合を考えましょう。 - フォントは11ptのセリフ体 - タイトルは17ptで太字 - アブストラクトは1段組みで本文は2段組み - アブストラクトは中央揃え - 本文は両端揃え - 第1レベルのセクションの見出しは13ptで中央に配置し、小さな大文字で表示 - 第2レベルの見出しは斜体で、本文と同じ大きさ - ページはUSレターサイズとし、下中央にページ番号を付け、各ページの右上に論文のタイトルを記載 これらのうち、多くの項目については既に対応方法を知っていますが、いくつかについては新しい記法を学ぶ必要があります。 ## setルール { #set-rules } まず、文書のsetルールを書くことから始めましょう。 ```example #set page( >>> margin: auto, paper: "us-letter", header: align(right)[ A fluid dynamic model for glacier flow ], numbering: "1", ) #set par(justify: true) #set text( font: "Libertinus Serif", size: 11pt, ) #lorem(600) ``` ここで行われていることの大半は、すでに分かりでしょう。 テキストサイズを`{11pt}`に、フォントをLibertinus Serifに設定しています。 また、段落の両端揃えを有効にし、ページサイズをUSレターとしています。 ここで、`header`は新しい引数で、各ページの上部の余白に置くコンテンツを設定できます。 ヘッダーには、学会のスタイルガイドで要求されているように、論文のタイトルを指定します。 `align`関数を用いてそのテキストを右寄せにします。 最後に `numbering` 引数について説明します。 ここでは、ページ番号の付け方を定義する[numbering pattern]($numbering)を指定できます。 例えば`{"1"}`と設定すると、Typstは素のページ番号のみを表示します。 また`{"(1/1)"}`と設定すると、カッコで囲まれた現在のページと総ページ数が表示されるでしょう。 さらに、カスタム関数を用意して完全に好みの書式にすることも可能です。 ## タイトルと要旨 { #title-and-abstract } それでは、タイトルとアブストラクトを追加しましょう。 まずはタイトルを中央揃えにし、`[*stars*]`で囲んでフォントを太文字にします。 ```example >>> #set page(width: 300pt, margin: 30pt) >>> #set text(font: "Libertinus Serif", 11pt) #align(center, text(17pt)[ *A fluid dynamic model for glacier flow* ]) ``` 正しく動作していることが確認できます。 `text`関数を使って、前のテキストのsetルールをローカルで上書きし、関数の引数で文字サイズを17ptに大きくしました。 次に、著者リストも追加しましょう。 指導教員と一緒にこの論文を書いているため、自分の名前と教員の名前を追加します。 ```example >>> #set page(width: 300pt, margin: 30pt) >>> #set text(font: "Libertinus Serif", 11pt) >>> >>> #align(center, text(17pt)[ >>> *A fluid dynamic model >>> for glacier flow* >>> ]) #grid( columns: (1fr, 1fr), align(center)[ <NAME> \ Artos Institute \ #link("mailto:<EMAIL>") ], align(center)[ Dr. <NAME> \ Artos Institute \ #link("mailto:<EMAIL>") ] ) ``` 著者情報が記載された2つのブロックが隣り合わせにレイアウトされています。 このレイアウトを作るために[`grid`]関数を使っています。 これにより、各列の大きさや、どのコンテンツをどのセルに入れるかを正確に制御することができます。 `columns`引数には、[相対長さ]($relative)または[割合]($fraction)の配列を渡します。 この場合、2つの等しい割合のサイズを渡し、使用可能なスペースを2つの等しい列に分割するように指示します。 次に、grid関数に2つの内容引数を渡しました。 ひとつは主著者であるあなたの情報で、もうひとつは指導教員の情報です。 ここでも `align` 関数を使用して、コンテンツを列の中央に配置しています。 grid関数はセルを指定するcontent引数を任意の数で受け取れます。 行は自動的に追加されますが、`rows`引数で手動でサイズを指定することも可能です。 それでは、アブストラクトを追加しましょう。 学会は、アブストラクトを中央に配置することを望んでいることを忘れないでください。 ```example:0,0,612,317.5 >>> #set text(font: "Libertinus Serif", 11pt) >>> #set par(justify: true) >>> #set page( >>> "us-letter", >>> margin: auto, >>> header: align(right + horizon)[ >>> A fluid dynamic model for >>> glacier flow >>> ], >>> numbering: "1", >>> ) >>> >>> #align(center, text(17pt)[ >>> *A fluid dynamic model >>> for glacier flow* >>> ]) >>> >>> #grid( >>> columns: (1fr, 1fr), >>> align(center)[ >>> <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ], >>> align(center)[ >>> Dr. <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ] >>> ) >>> <<< ... #align(center)[ #set par(justify: false) *Abstract* \ #lorem(80) ] >>> #lorem(600) ``` できました!特筆すべき点は、`align`のcontent引数の中にあるsetルールを使って、アブストラクトの両端揃えをオフにしたことです。 これは、最初のsetルールの後に指定されたにもかかわらず、文書の残りの部分には影響しません。 コンテンツ・ブロック内で設定されたものは、そのブロック内のコンテンツにのみ影響します。 ヘッダーとタイトルの2回入力する必要がないように、論文タイトルを変数に保存することも可能です。 変数の宣言には`{let}`を使用します。 ```example:single #let title = [ A fluid dynamic model for glacier flow ] <<< ... >>> #set text(font: "Libertinus Serif", 11pt) >>> #set par(justify: true) #set page( >>> "us-letter", >>> margin: auto, header: align( right + horizon, title ), <<< ... >>> numbering: "1", ) #align(center, text(17pt)[ *#title* ]) <<< ... >>> #grid( >>> columns: (1fr, 1fr), >>> align(center)[ >>> <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ], >>> align(center)[ >>> Dr. <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ] >>> ) >>> >>> #align(center)[ >>> #set par(justify: false) >>> *Abstract* \ >>> #lorem(80) >>> ] >>> >>> #lorem(600) ``` `title`変数にコンテンツを設定した後は、関数内やマークアップ内(関数のように接頭辞に`#`をつける)で使用できます。 こうすることで、別のタイトルに決めた場合、一箇所で簡単に変更することができます。 ## Adding columns and headings { #columns-and-headings } 上の論文は、残念ながら文字が単調にぎっしり詰まっていて読みにくい見た目をしています。 これを修正するために、見出しを追加し、2段組のレイアウトに変更してみましょう。 Fortunately, that's easy to do: We just need to amend our `page` set rule with the `columns` argument. By adding `{columns: 2}` to the argument list, we have wrapped the whole document in two columns. However, that would also affect the title and authors overview. To keep them spanning the whole page, we can wrap them in a function call to [`{place}`]($place). Place expects an alignment and the content it should place as positional arguments. Using the named `{scope}` argument, we can decide if the items should be placed relative to the current column or its parent (the page). There is one more thing to configure: If no other arguments are provided, `{place}` takes its content out of the flow of the document and positions it over the other content without affecting the layout of other content in its container: ```example #place( top + center, rect(fill: black), ) #lorem(30) ``` If we hadn't used `{place}` here, the square would be in its own line, but here it overlaps the few lines of text following it. Likewise, that text acts like as if there was no square. To change this behavior, we can pass the argument `{float: true}` to ensure that the space taken up by the placed item at the top or bottom of the page is not occupied by any other content. ```example:single >>> #let title = [ >>> A fluid dynamic model >>> for glacier flow >>> ] >>> >>> #set text(font: "Libertinus Serif", 11pt) >>> #set par(justify: true) >>> #set page( >>> margin: auto, paper: "us-letter", header: align( right + horizon, title ), numbering: "1", columns: 2, ) #place( top + center, float: true, scope: "parent", clearance: 2em, )[ >>> #text( >>> 17pt, >>> weight: "bold", >>> title, >>> ) >>> >>> #grid( >>> columns: (1fr, 1fr), >>> [ >>> <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ], >>> [ >>> Dr. <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ] >>> ) <<< ... #par(justify: false)[ *Abstract* \ #lorem(80) ] ] = Introduction #lorem(300) = Related Work #lorem(200) ``` In this example, we also used the `clearance` argument of the `{place}` function to provide the space between it and the body instead of using the [`{v}`]($v) function. We can also remove the explicit `{align(center, ..)}` calls around the various parts since they inherit the center alignment from the placement. 最後に見出しのスタイルの設定をしましょう。 ガイドラインに従うために、見出しは中央揃えにして、小さな大文字を使わなければなりません。 `heading`関数はそのような設定を提供していないため、独自の見出しshowルールを書く必要があります。 ```example:50,250,265,270 >>> #let title = [ >>> A fluid dynamic model >>> for glacier flow >>> ] >>> >>> #set text(font: "Libertinus Serif", 11pt) >>> #set par(justify: true) >>> #set page( >>> "us-letter", >>> margin: auto, >>> header: align( >>> right + horizon, >>> title >>> ), >>> numbering: "1", >>> columns: 2, >>> ) #show heading: it => [ #set align(center) #set text(13pt, weight: "regular") #block(smallcaps(it.body)) ] <<< ... >>> >>> #place( >>> top + center, >>> float: true, >>> scope: "parent", >>> clearance: 2em, >>> )[ >>> #text( >>> 17pt, >>> weight: "bold", >>> title, >>> ) >>> >>> #grid( >>> columns: (1fr, 1fr), >>> [ >>> <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ], >>> [ >>> Dr. <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ] >>> ) >>> >>> #par(justify: false)[ >>> *Abstract* \ >>> #lorem(80) >>> ] >>> ] >>> >>> = Introduction >>> #lorem(35) >>> >>> == Motivation >>> #lorem(45) ``` うまくできました! すべての見出しに適用されるshowルールを使用しました。 この関数にパラメータとして見出しを渡します。 このパラメータはコンテンツとして使用することもできますが、`title`、`numbers`、`level`といったフィールドも持っているため、そこから独自の書式を構成することも可能です。 ここではセンター揃えにし、見出しはデフォルトで太字なのでフォントのウェイトを `{"regular"}` に設定し、[`smallcaps`] 関数を使って見出しのタイトルを小さな大文字でレンダリングしています。 残る唯一の問題は、すべての見出しが同じように見えることです。 MotivationとProblem Statementはサブセクションであり、イタリック体であるべきですが、今はセクションの見出しと見分けがつきません。 この問題は、setルールに`where`セレクターを使うことで解決できます。 これは、見出し(および他の要素)に対して呼び出せる[メソッド]($scripting/#methods)で、レベルごとにフィルタリングすることが可能です。 これによりセクションとサブセクションの見出しを区別できます。 ```example:50,250,265,245 >>> #let title = [ >>> A fluid dynamic model >>> for glacier flow >>> ] >>> >>> #set text(font: "Libertinus Serif", 11pt) >>> #set par(justify: true) >>> #set page( >>> "us-letter", >>> margin: auto, >>> header: align( >>> right + horizon, >>> title >>> ), >>> numbering: "1", >>> columns: 2, >>> ) >>> #show heading.where( level: 1 ): it => block(width: 100%)[ #set align(center) #set text(13pt, weight: "regular") #smallcaps(it.body) ] #show heading.where( level: 2 ): it => text( size: 11pt, weight: "regular", style: "italic", it.body + [.], ) >>> >>> #place( >>> top + center, >>> float: true, >>> scope: "parent", >>> clearance: 2em, >>> )[ >>> #text( >>> 17pt, >>> weight: "bold", >>> title, >>> ) >>> >>> #grid( >>> columns: (1fr, 1fr), >>> [ >>> <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ], >>> [ >>> Dr. <NAME> \ >>> Artos Institute \ >>> #link("mailto:<EMAIL>") >>> ] >>> ) >>> >>> #par(justify: false)[ >>> *Abstract* \ >>> #lorem(80) >>> ] >>> ] >>> >>> = Introduction >>> #lorem(35) >>> >>> == Motivation >>> #lorem(45) ``` これは素晴らしい! 第1レベルと第2レベルの見出しにそれぞれ選択的に適用される2つのshowルールを書きました。 `where`セレクタを使用して、見出しをレベルでフィルタリングしました。 そして、サブセクションの見出しを本文と改行せずにレンダリングしました。 また、サブセクションの見出しの最後にピリオドを自動的に追加してます。 ここで、学会のスタイルガイドを確認しましょう。 - フォントは11ptのセリフ体 ✓ - タイトルは17ptで太字 ✓ - アブストラクトは1段組みで本文は2段組み ✓ - アブストラクトは中央揃え ✓ - 本文は両端揃え ✓ - 第1レベルのセクションの見出しは13ptで中央に配置し、小さな大文字で表示 ✓ - 第2レベルの見出しは斜体で、本文と同じ大きさ ✓ - ページはUSレターサイズとし、下中央にページ番号を付け、各ページの右上に論文のタイトルを記載 ✓ これで、すべてのスタイルに準拠し、論文を学会に提出できます!完成した論文は次のようになっています。 <img src="3-advanced-paper.png" alt="The finished paper" style="box-shadow: 0 4px 12px rgb(89 85 101 / 20%); width: 500px; max-width: 100%; display: block; margin: 24px auto;" > ## まとめ このセクションでは、ヘッダーとフッターの作成方法、関数とスコープを使用してローカルにスタイルをオーバーライドする方法、[`grid`]関数を使用してより複雑なレイアウトを作成する方法、個々の関数と文書全体のshowルールを記述する方法を学びました。 また、[`where`セレクタ]($styling/#show-rules)を使用して、見出しをそのレベルによってフィルタリングする方法も学びました。 結果として論文は大成功でした! あなたはその学会にて同じ志を持つ研究者にたくさん出会い、来年同じ学会で発表したいプロジェクトを計画しています。 その際に、同じスタイルガイドを使って新しい論文を書く必要があるため、あなたやあなたのチームのために、時間を節約できるテンプレートを作りたいと思うのではないでしょうか? 次のセクションでは、複数の文書で再利用できるテンプレートの作成方法を学びます。 これはより高度なトピックですので、今すぐには手が出せないという方は、後ほどお気軽にお越しください。
https://github.com/Myriad-Dreamin/typst.ts
https://raw.githubusercontent.com/Myriad-Dreamin/typst.ts/main/projects/rehype-typst/README.md
markdown
Apache License 2.0
# rehype-typst **[rehype](https://github.com/rehypejs/rehype)** plugin to render elements with a `language-math` class with [Typst](https://github.com/typst/typst). ## Contents - [rehype-typst](#rehype-typst) - [Contents](#contents) - [What is this?](#what-is-this) - [When should I use this?](#when-should-i-use-this) - [Install](#install) - [Use](#use) - [API](#api) - [`unified().use(rehypeTypst[, options])`](#unifieduserehypetypst-options) - [Returns](#returns) - [Markdown](#markdown) - [HTML](#html) ## What is this? This package is a [unified](https://unifiedjs.com/explore/package/unified/) ([rehype](https://github.com/rehypejs/rehype)) plugin to render math. You can add classes to HTML elements, use fenced code in markdown, or combine with [remark-math](https://github.com/remarkjs/remark-math) for a `$C$` syntax extension. ## When should I use this? This project is useful as it renders math with Typst at compile time, which means that there is no client side JavaScript needed. ## Install This package is [ESM only](https://nodejs.org/api/esm.html#modules-ecmascript-modules). In Node.js (version 16+), install with [npm](https://nodejs.org/en/learn/getting-started/an-introduction-to-the-npm-package-manager): ```sh npm install @myriaddreamin/rehype-typst ``` ## Use Say our document `input.html` contains: ```html <p> Lift(<code class="language-math">L</code>) can be determined by Lift Coefficient (<code class="language-math">C_L</code>) like the following equation. </p> <pre><code class="language-math"> L = 1/2 rho v^2 S C_L </code></pre> ``` …and our module `example.js` contains: ```js import rehypeTypst from '@myriaddreamin/rehype-typst' import rehypeParse from 'rehype-parse' import rehypeStringify from 'rehype-stringify' import {read, write} from 'to-vfile' import {unified} from 'unified' const file = await unified() .use(rehypeParse, {fragment: true}) .use(rehypeTypst) .use(rehypeStringify) .process(await read('input.html')) file.basename = 'output.html' await write(file) ``` …then running `node example.js` creates an `output.html` and open `output.html` in a browser to see the rendered math. ## API This package exports no identifiers. The default export is `rehypeTypst`. ### `unified().use(rehypeTypst[, options])` Render elements with a `language-math` (or `math-display`, `math-inline`) class with [Typst](https://github.com/typst/typst). <!-- ###### Parameters * `options` ([`Options`][api-options]) — configuration --> ###### Returns Transform ([`Transformer`][unified-transformer]). <!-- ### `Options` Configuration (TypeScript type). --> <!-- ###### Type ```ts import {KatexOptions} from 'katex' type Options = Omit<KatexOptions, 'displayMode' | 'throwOnError'> ``` See [*Options* on `katex.org`][katex-options] for more info. --> ## Markdown This plugin supports the syntax extension enabled by [remark-math](https://github.com/remarkjs/remark-math). It also supports math generated by using fenced code: ````markdown ```math C_L ``` ```` ## HTML The content of any element with a `language-math`, `math-inline`, or `math-display` class is transformed. The elements are replaced by what Typst renders. Either a `math-display` class or using `<pre><code class="language-math">` will result in “display” math: math that is a centered block on its own line. <!-- Definitions --> [unified-transformer]: https://github.com/unifiedjs/unified#transformer
https://github.com/MatheSchool/typst-g-exam
https://raw.githubusercontent.com/MatheSchool/typst-g-exam/develop/src/global.typ
typst
MIT License
#import "@preview/oxifmt:0.2.1": strfmt #let __g-question-number = counter("g-question-number") #let __g-question-point = state("g-question-point", 0) #let __g-question-points-position-state = state("g-question-points-position", left) #let __g-question-text-parameters-state = state("question-text-parameters:", none) #let __g-localization = state("g-localization") #let __g-show-solution = state("g-show-solution", false) #let __g-decimal-separator = state("g-decimal-separator", ".") #let __g-default-localization = ( grade-table-queston: "Question", grade-table-total: "Total", grade-table-points: "Points", grade-table-grade: "Grade", point: "point", points: "points", page: "Page", page-counter-display: "1 of 1", family-name: "Surname", given-name: "Name", group: "Group", date: "Date", draft-label: "Draft", ) #let __g-question-numbering(..args) = { let nums = args.pos() if nums.len() == 1 { numbering("1. ", nums.last()) } else if nums.len() == 2 { numbering("(a) ", nums.last()) } else if nums.len() == 3 { numbering("(i) ", nums.last()) } } #let __g-paint-tab( points: none, decimal-separator: "." ) = { if points != none { let label-point = context __g-localization.final().points if points == 1 { label-point = context __g-localization.final().point } [(#emph[#strfmt("{0}", calc.round(points, digits: 2), fmt-decimal-separator: decimal-separator) #label-point])] } }
https://github.com/Ciolv/typst-template-t3000
https://raw.githubusercontent.com/Ciolv/typst-template-t3000/main/README.md
markdown
MIT License
# T3_3000 Typst Template - DHBW Mannheim This template is not affiliated with the DHBW Mannheim. It is merely based as closely as possible on the Word template for T3_3000 provided via Moodle (as of May 2023). I do not guarantee that a submission based on this template will be accepted. The template is based on the IEEE template provided by [Typst](https://typst.app/).
https://github.com/hitszosa/universal-hit-thesis
https://raw.githubusercontent.com/hitszosa/universal-hit-thesis/main/common/components/figure.typ
typst
MIT License
#let algorithm-figure(content, caption: none, supplement: [算法], label-name: "", breakable: true) = { block(stroke: rgb("#0000"))[ #let new-label = label(label-name) #figure( [], kind: "algorithm", supplement: supplement, ) #new-label #v(-1.25em) #context { let heading-number = counter(heading).get().at(0) let _prefix = "i-figured-" let algo-kind = "algorithm" let prefix-alog-number = counter(figure.where(kind: _prefix + repr(algo-kind))).get().at(0) let numbers = (heading-number, prefix-alog-number) block( stroke: (y: 1.3pt), inset: 0pt, breakable: breakable, width: 100%, { set align(left) block( inset: (y: 5pt), width: 100%, stroke: (bottom: .8pt), { strong({ supplement numbering("1-1", ..numbers) if caption != none { [: ] } else { [.] } }) if caption != none { caption } }, ) v(-1em) block( breakable: breakable, content, ) }, ) } ] } #import "@preview/codelst:2.0.1": sourcecode, code-frame #import "../theme/type.typ": 字体, 字号 #let codelst-sourcecode = sourcecode #let hit-sourcecode = codelst-sourcecode.with(frame: code => { set text(font: 字体.代码, size: 字号.五号) code-frame(code) }) #let code-figure(content, caption: [], supplement: [代码], label-name: "") = { let fig = figure( hit-sourcecode(content), caption: caption, kind: raw, supplement: supplement, ) [ #if label-name == "" { [#fig] } else { let new-label = label(label-name) [#fig #new-label] } ] }
https://github.com/Mc-Zen/quill
https://raw.githubusercontent.com/Mc-Zen/quill/main/examples/qft.typ
typst
MIT License
#import "../src/quill.typ": * #quantum-circuit( scale: 85%, row-spacing: 5pt, column-spacing: 8pt, lstick($|j_1〉$), $H$, $R_2$, midstick($ dots $), $R_(n-1)$, $R_n$, 8, rstick($|0〉+e^(2pi i 0.j_1 dots j_n)|1〉$),[\ ], lstick($|j_2〉$), 1, ctrl(-1), midstick($ dots $), 2, $H$, midstick($ dots $), $R_(n-2)$, $R_(n-1)$, midstick($ dots $), 3, rstick($|0〉+e^(2pi i 0.j_2 dots j_n)|1〉$), [\ ], setwire(0), midstick($dots.v$), 1, midstick($dots.v$), [\ ], lstick($|j_(n-1)〉$), 3, ctrl(-3), 3, ctrl(-2), 1, midstick($ dots $), $H$, $R_2$, 1, rstick($|0〉+e^(2pi i 0.j_(n-1)j_n)|1〉$), [\ ], lstick($|j_n〉$), 4, ctrl(-4), 3, ctrl(-3), midstick($ dots $), 1, ctrl(-1), $H$, rstick($|0〉+e^(2pi i 0.j_n)|1〉$) )
https://github.com/ilsubyeega/circuits-dalaby
https://raw.githubusercontent.com/ilsubyeega/circuits-dalaby/master/Type%201/1/15.typ
typst
#set enum(numbering: "(a)") #import "@preview/cetz:0.2.2": * #import "../common.typ": answer 1.15 다음은 어떤 소자에 시간 $t$의 시점까지 들어간 전하의 축적량 $q(t)$를 나타낸 것이다. 다음 시점에서 전류를 구하라. + $t = 1s$ + $t = 3s$ + $t = 6s$ #answer[ + $= 2$A + $= 0$ + $= 1$A ]
https://github.com/EGmux/TheoryOfComputation
https://raw.githubusercontent.com/EGmux/TheoryOfComputation/master/assyntoticComplexity.typ
typst
#set heading(numbering: "1.") = (3.8) Give Implementation level detail descriptions of Turing machines that decide the followwing languages over the alphabet {0,1} == a. ${w| w "contains an equal number of 0's and 1's" } $ #math.equation(block:true,numbering:"1", $M=&"On input <p>, a binary string:" \ & " 0 . Move cursor to end of string,right until empty char, and place symbol ?z"\ & " 1 . goto step 2"\ & " 2 . Move cursor to beginning of string and goto step4"\ & " 3. Move cursor to the right"\ & " 4. When ?1 is read, mark it with ?c"\ & " Move cursor to the right"\ & " When ?w is read, change it to ?z"\ & " Move cursor to the left"\ & " When ?c is read, change it to ?x and goto step 5"\ & " When ?0 is read,mark it with ?c"\ & " Move cursor to the right"\ & " When ?w is read, change it to ?z"\ & " Move cursor to the left"\ & " When ?c is read, change it to ?x and goto step 6"\ & " When ?x is read goto step 3"\ & " When ?z is read, reject"\ & " When ?w is read, accept"\ & " 5 . Move the cursor to the right"\ & " if ?1 is read, change it to ?c"\ & " if ?z is read, change it to ?w "\ & " Move cursor to the left "\ & " When c is read, mark it with a ?x and goto 2 "\ & " 6. Move the cursor to the right"\ & " if ?0 is read, change it to ?c"\ & " if ?z is read, change it to ?w"\ & " Move cursor to the left"\ & " When ?c is read, mark it with a ?x and goto 2 "\" $ ) == b. ${w| w "contains twice as many 0s as 1s" } $ #math.equation(block:true,numbering:"1", $M=&"On input <p>, a binary string:" \ & " 0 . Move cursor to end of string,right until empty char, and place symbol ?z"\ & " 1 . goto step 2"\ & " 2 . Move cursor to beginning of string and goto step 4"\ & " 3. Move cursor to the right"\ & " 4. When ?1 is read, mark it with ?c"\ & " Move cursor to the right"\ & " If ?w is read, change it to ?z"\ & " Move cursor to the left"\ & " If ?c is read, change it to ?x and goto step 5"\ & " When ?0 is read,mark it with ?c"\ & " Move cursor to the right"\ & " If ?w is read, change it to ?z"\ & " Move cursor to the left"\ & " If ?c is read, change it to ?x and goto step 6"\ & " When ?x is read goto step 3"\ & " When ?z is read, reject"\ & " When ?w is read, accept"\ & " 5 . Move the cursor to the right"\ & " When ?0 is read, change it to ?x "\ & " Move the cursor to the right"\ & " When ?1 is read, change it to ?c"\ & " When ?z is read, change it to ?w"\ & " Move the cursor to the left"\ & " When ?c is read change it to ?x, goto step 2"\ & " 6. Move the cursor to the right"\ & " When ?0 is read, change it to ?c"\ & " Move the cursor to the right"\ & " When ?0 is read, change it to ?c"\ & " When ?z is read, change it to ?w"\ & " Move the cursor to the left"\ & " When ?c is read change it to ?x, goto step 2"\ $ ) == c. ${w| w "does not contain twice as many 0s as 1s" } $ #math.equation(block:true,numbering:"1", $M=&"On input <p>, a binary string:" \ & " 0 . Move cursor to end of string,right until empty char, and place symbol ?z"\ & " 1 . goto step 2"\ & " 2 . Move cursor to beginning of string and goto step 4"\ & " 3. Move cursor to the right"\ & " 4. When ?1 is read, mark it with ?c"\ & " Move cursor to the right"\ & " If ?z is read, goto 5"\ & " If ?w is read, change it to ?z"\ & " Move cursor to the left"\ & " If ?c is read, change it to ?x and goto step 6"\ & " When ?0 is read,mark it with ?c"\ & " Move cursor to the right"\ & " If ?z is read, goto 5"\ & " If ?w is read, change it to ?z"\ & " Move cursor to the left"\ & " If ?c is read, change it to ?x and goto step 7"\ & " When ?x is read goto step 3"\ & " 5 When ?z is read, accept"\ & " When ?w is read, reject"\ & " 6 . Move the cursor to the right"\ & " When ?0 is read, change it to ?x "\ & " Move the cursor to the right"\ & " When ?1 is read, change it to ?c"\ & " When ?z is read, change it to ?w"\ & " Move the cursor to the left"\ & " When ?c is read change it to ?x, goto step 2"\ & " 7. Move the cursor to the right"\ & " When ?0 is read, change it to ?c"\ & " Move the cursor to the right"\ & " When ?0 is read, change it to ?c"\ & " When ?z is read, change it to ?w"\ & " Move the cursor to the left"\ & " When ?c is read change it to ?x, goto step 2"\ $ )
https://github.com/soul667/typst
https://raw.githubusercontent.com/soul667/typst/main/PPT/typst-slides-fudan/themes/polylux/book/src/themes/gallery/university.md
markdown
# University theme ![university](university.png) This theme offers a simple yet versatile design, allowing for easy customization and flexibility. Additionally, it incorporates a progress bar at the top, which displays the current status of the presentation. `university` also makes working with mulit-column content very easy. Use it via ```typ #import "@preview/polylux:0.2.0": * #import themes.university: * #show: university-theme.with(...) ``` `university` uses polylux' section handling, the regular `#outline()` will not work properly, use `#polylux-outline` instead. Starting a new section is done by the corresponding keyword argument of `#slide`. Text is configured to have a base font size of 25 pt. ## Options for initialisation `university-theme` accepts the following optional keyword arguments: - `aspect-ratio`: the aspect ratio of the slides, either `"16-9"` or `"4-3"`, default is `"16-9"` - `short-title`: short title of the presentation to display on every slide, default: `none` - `short-author`: short author of the presentation to display on every slide, default: `none` - `short-date`: short date of presentation to display on every slide, default: `none` - `color-a`: main colour of decorations, default: `rgb("#0C6291")` - `color-b`: accent colour, default: `rgb("#A63446")` - `color-c`: second accent colour, default: `rgb("#FBFEF9")` - `progress-bar`: boolean value whether or not to display a progress bar on regular sides, default: `true` ## Slide functions `metropolis` provides the following custom slide functions: ```typ #title-slide(...) ``` Creates a title slide where title and subtitle are separated by additional information by a bright line. Accepts the following keyword arguments: - `title`: title of the presentation, default: `[]` - `subtitle`: subtitle of the presentation, default: `none` - `authors`: authors of presentation, can be an array of contents or a single content, will be displayed in a grid, default: `()` - `date`: date of the presentation, default: `none` - `institution-name`: name of the institution, default: `"University"` - `logo`: some content (most likely an image) used as a logo on the title slide, default: `none` Does not accept additional content. --- ```typ #slide(...)[ ... ][ ... ] ``` Decorates the provided content with a header containing a progress bar (optionally), the slide title, and the current section (if any); and a footer containing short forms of authors, title, and date, and the slide number. Header and footer can also be overwritten by respective keyword arguments. Accepts an arbitrary amount of content blocks, they are placed next to each other as columns. Configure using the `columns` and `gutter` keyword arguments. Pass the slide title as a keyword argument `title`. Accepts the following keyword arguments: - `title`: title of the slide, default: `none`, - `columns`: propagated to `grid` for placing the body columns, default: array filled with as many `1fr` as there are content blocks - `gutter`: propagated to `grid` for placing the body columns, default: `1em` - `header`: custom content to overwrite default header - `footer`: custom content to overwrite default footer - `new-section`: name of the new section that starts here if not `none`, default: `none` --- ```typ #focus-slide(background-img: ..., background-color: ...)[ ... ] ``` Draw attention with this variant where the content is displayed centered and text is enlarged and bright. You can either specify a background image or a background colour as keyword arguments. If you specify none of them, a background colour of `rgb("#0C6291")` is used as a default. Not suitable for content that exceeds one page. --- ```typ #matrix-slide(columns: ..., rows: ...)[ ... ][ ... ] ``` Create a slide where the provided content blocks are displayed in a grid and coloured in a checkerboard pattern without further decoration. You can configure the grid using the `rows` and `columns` keyword arguments (both default to `none`). It is determined in the following way: 1. If `colmuns` is an integer, create that many columns of width `1fr`. 2. If `columns` is `none`, create as many columns of width `1fr` as there are content blocks. 3. Otherwise assume that `columns` is an array of widths already, use that. 4. If `rows` is an integer, create that many rows of height `1fr`. 5. If `rows` is `none` create that many rows of height `1fr` as are needed given the number of content blocks and columns. 6. Otherwise assume that `rows` is an array of heights already, use that. 7. Check that there are enough rows and columns to fit in all the content blocks. That means that `#matrix-slide[...][...]` stacks horizontally and `#matrix-slide(columns: 1)[...][...]` stacks vertically. Not suitable for content that exceeds one page. ## Example code The image at the top is created by the following code: ```typ #import "@preview/polylux:0.2.0": * {{#include university.typ:3:}} ```
https://github.com/Zuttergutao/Typstdocs-Zh-CN-
https://raw.githubusercontent.com/Zuttergutao/Typstdocs-Zh-CN-/main/Classified/format.typ
typst
// 设置block格式 #let blockk(term)=block(width:100%,inset: 7pt,radius:5pt,stroke: gray+1pt)[ #set par(first-line-indent:0em) #text(weight:700,size:11pt,fill: rgb("#FF0000"),"#Demo") \ #term ]
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compiler/ops-14.typ
typst
Other
// Error: 10 expected keyword `in` #("a" not)
https://github.com/7sDream/fonts-and-layout-zhCN
https://raw.githubusercontent.com/7sDream/fonts-and-layout-zhCN/master/chapters/04-opentype/bezier.typ
typst
Other
#import "/template/consts.typ" #import "/lib/draw.typ": * #let width = 500 #let height = 800 #let axis-step = 100 #let axis-thickness = 2 #let curve-thickness = 5 #let point-radius = 10 #let point-thickness = 3 #let text-size = 30 #let the-canvas = body => canvas( (width, height), width: 100%, body, ) #let coordinate-mesh = with-unit((ux, uy) => mesh( (0, 0), (width, height), (axis-step, axis-step), stroke: axis-thickness * ux + theme.table-stroke )) #let draw-bezier = (..args, color: none) => with-unit((ux, uy) => { let ps = args.pos() bezier(..ps, stroke: curve-thickness * ux + color) for (i, p) in ps.enumerate() { if p == none { continue } point( p, radius: point-radius, color: color, thickness: point-thickness * ux, fill: i == 0 or i + 1 == ps.len(), need-txt: true, size: text-size * ux, anchor: "rc", dx: -text-size ) } }) #let g1 = the-canvas({ coordinate-mesh let s = (290, 627) let c1 = (312, 546) let c2 = (335, 470) let e = (360, 292) draw-bezier(s, c1, c2, e, color: blue) }) #let g2 = the-canvas({ coordinate-mesh let s = (290, 627) let c1 = (320, 518) let e = (360, 292) draw-bezier(s, c1, none, e, color: red) }) #grid( columns: 2, column-gutter: 2em, fill: none, stroke: none, inset: 0pt, g1, g2, )
https://github.com/jgm/typst-hs
https://raw.githubusercontent.com/jgm/typst-hs/main/test/typ/compute/calc-29.typ
typst
Other
// Error: 11-19 the result is too large #calc.perm(21, 21)
https://github.com/derekchai/k-mapper
https://raw.githubusercontent.com/derekchai/k-mapper/main/lib.typ
typst
MIT License
#import "utils.typ": * #let karnaugh( // 4, 8, 16 grid-size, // Label to go on the x-axis of the K-map. x-label: $$, // Label to go on the y-axis of the K-map. y-label: $$, // Gray code positions where there is a 0. Otherwise the K-map is filled with 1s. minterms: none, // Gray code positions where there is a 1. Otherwise the K-map is filled with 0s maxterms: none, // Terms in order of Gray code positions. manual-terms: none, // Rectangular implicants, where each element is an array of two values: two // corners of the implicant, in Gray code position. implicants: (), // Implicants where it wraps around the VERTICAL EDGES of the K-map. Each // element is an array of two values: two corners of the implicant, in Gray // code position. horizontal-implicants: (), // Implicants where it wraps around the HORIZONTAL EGES of the K-map. Each // element is an array of two values: two corners of the implicant, in Gray // code position. vertical-implicants: (), // A Boolean value indicating whether the K-map has corner implicants (those) // where there is an implicant at the four corners (i.e. they wrap around) // both horizontal and vertical edges. corner-implicants: false, // Size of each cell in the K-map. cell-size: 20pt, // Stroke size of the K-map. stroke-width: 0.5pt, // Array of colors to be used in the K-map. The first implicant uses the first // color, the second the second color, etc. If there are more implicants than // there are colors, they wrap around. colors: ( rgb(255, 0, 0, 100), rgb(0, 255, 0, 100), rgb(0, 0, 255, 100), rgb(0, 255, 255, 100), rgb(255, 0, 255, 100), rgb(255, 255, 0, 100), ), // Inset of each implicant within its cell. implicant-inset: 2pt, // How much wrapping implicants (i.e. horizontal, vertical, corner) overflow // from the table. edge-implicant-overflow: 5pt, // Corner radius of the implicants. implicant-radius: 5pt, // How much to transparentize the implicant strokes by. implicant-stroke-transparentize: -100%, // How much to darken the implicant strokes by. implicant-stroke-darken: 60%, // Stroke width of implicants. implicant-stroke-width: 0.5pt ) = { assert( minterms != none and maxterms == none and manual-terms == none or minterms == none and maxterms != none and manual-terms == none or minterms == none and maxterms == none and manual-terms != none, message: "minterms, maxterms, and manual-terms are mutually exclusive!" ) if manual-terms != none { assert(manual-terms.len() == grid-size, message: "Please provide exactly the correct number of terms for the" + "respective grid size!") } // Top-to-bottom, left-to-right terms. let cell-terms let cell-total-size = cell-size let implicant-count = 0 if manual-terms != none { cell-terms = manual-terms.enumerate().map(x => manual-terms.at(position-to-gray(x.at(0), grid-size))) } else if minterms != none { cell-terms = (1, ) * grid-size for minterm in minterms { cell-terms.at(position-to-gray(minterm, grid-size)) = 0 } } else { cell-terms = (0, ) * grid-size for maxterm in maxterms { cell-terms.at(position-to-gray(maxterm, grid-size)) = 1 } } let columns-dict = ( "4": (cell-size, cell-size), "8": (cell-size, cell-size), "16": (cell-size, cell-size, cell-size, cell-size), ) let base = table( columns: columns-dict.at(str(grid-size)), rows: cell-size, align: center + horizon, stroke: stroke-width, ..cell-terms.map(term => [#term]) ) let body = zstack( alignment: bottom + left, (base, 0pt, 0pt), // Implicants. ..for (index, implicant) in implicants.enumerate() { implicant-count += 1 let p1 = gray-to-coordinate(implicant.at(0), grid-size) let p2 = gray-to-coordinate(implicant.at(1), grid-size) let bottom-left-point let top-right-point bottom-left-point = (calc.min(p1.at(0), p2.at(0)), calc.min(p1.at(1), p2.at(1))) top-right-point = (calc.max(p1.at(0), p2.at(0)), calc.max(p1.at(1), p2.at(1))) let dx = bottom-left-point.at(0) * cell-total-size + implicant-inset let dy = bottom-left-point.at(1) * cell-total-size + implicant-inset let width = (top-right-point.at(0) - bottom-left-point.at(0) + 1) * cell-size - implicant-inset * 2 let height = (top-right-point.at(1) - bottom-left-point.at(1) + 1) * cell-size - implicant-inset * 2 // Loop back on the colors array if there are more implicants than there // are colors. let color = colors.at(calc.rem-euclid(implicant-count - 1, colors.len())) ( ( rect( stroke: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, fill: color, width: width, height: height, radius: implicant-radius ), dx, -dy ), ) }, // Implicants. // Horizontal implicants. ..for (index, implicant) in horizontal-implicants.enumerate() { implicant-count += 1 let p1 = gray-to-coordinate(implicant.at(0), grid-size) let p2 = gray-to-coordinate(implicant.at(1), grid-size) let bottom-left-point = (calc.min(p1.at(0), p2.at(0)), calc.min(p1.at(1), p2.at(1))) let bottom-right-point = (calc.max(p1.at(0), p2.at(0)), calc.min(p1.at(1), p2.at(1))) let top-right-point = (calc.max(p1.at(0), p2.at(0)), calc.max(p1.at(1), p2.at(1))) let dx1 = bottom-left-point.at(0) * cell-total-size - edge-implicant-overflow + implicant-inset let dx2 = bottom-right-point.at(0) * cell-total-size + implicant-inset let dy = bottom-left-point.at(1) * cell-total-size + implicant-inset // let dy2 = bottom-right-point.at(1) * cell-total-size let width = cell-size + edge-implicant-overflow - implicant-inset * 2 let height = (top-right-point.at(1) - bottom-left-point.at(1) + 1) * cell-size - implicant-inset * 2 // Loop back on the colors array if there are more implicants than there // are colors. let color = colors.at(calc.rem-euclid(implicant-count - 1, colors.len())) ( ( rect( stroke: ( top: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, right: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, bottom: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width ), fill: color, width: width , height: height, radius: (right: implicant-radius) ), dx1, -dy ), ( rect( stroke: ( top: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, left: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, bottom: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width ), fill: color, width: width, height: height, radius: (left: implicant-radius) ), dx2, -dy ) ) }, // Vertical implicants. ..for (index, implicant) in vertical-implicants.enumerate() { implicant-count += 1 let p1 = gray-to-coordinate(implicant.at(0), grid-size) let p2 = gray-to-coordinate(implicant.at(1), grid-size) let bottom-left-point = (calc.min(p1.at(0), p2.at(0)), calc.min(p1.at(1), p2.at(1))) let top-left-point = (calc.min(p1.at(0), p2.at(0)), calc.max(p1.at(1), p2.at(1))) let top-right-point = (calc.max(p1.at(0), p2.at(0)), calc.max(p1.at(1), p2.at(1))) let dx = bottom-left-point.at(0) * cell-total-size + implicant-inset let dy1 = bottom-left-point.at(1) * cell-total-size - edge-implicant-overflow + implicant-inset let dy2 = top-left-point.at(1) * cell-total-size + implicant-inset let width = (top-right-point.at(0) - bottom-left-point.at(0) + 1) * cell-size - implicant-inset * 2 let height = cell-size + edge-implicant-overflow - implicant-inset * 2 // Loop back on the colors array if there are more implicants than there // are colors. let color = colors.at(calc.rem-euclid(implicant-count - 1, colors.len())) ( ( rect( stroke: ( left: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, top: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, right: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width ), fill: color, width: width, height: height, radius: (top: implicant-radius) ), dx, -dy1 ), ( rect( stroke: ( left: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, bottom: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, right: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, ), fill: color, width: width, height: height, radius: (bottom: implicant-radius) ), dx, -dy2 ) ) }, // Vertical implicants. // Corner implicants. ..if corner-implicants { implicant-count += 1 // Index (below) of array is the Gray code position of that corner. // // 0 1 // // 2 3 // // For example, at index 3, in a 4x4 K-map, the Gray code at that corner // is 10. let grid-size-4-corners = (0, 1, 2, 3).map(x => gray-to-coordinate(x, 4)) let grid-size-8-corners = (0, 1, 4, 5).map(x => gray-to-coordinate(x, 8)) let grid-size-16-corners = (0, 2, 8, 10).map(x => gray-to-coordinate(x, 16)) let corners if grid-size == 4 { corners = grid-size-4-corners } else if grid-size == 8 { corners = grid-size-8-corners } else { corners = grid-size-16-corners } let dx-left = -edge-implicant-overflow + implicant-inset let dx-right = corners.at(1).at(0) * cell-total-size + implicant-inset let dy-top = corners.at(0).at(1) * cell-total-size + implicant-inset let dy-bottom = edge-implicant-overflow - implicant-inset let width = cell-size + edge-implicant-overflow - implicant-inset * 2 // Loop back on the colors array if there are more implicants than there // are colors. let color = colors.at(calc.rem-euclid(implicant-count - 1, colors.len())) ( ( rect( width: width, height: width, stroke: (right: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, bottom: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width), fill: color, radius: (bottom-right: implicant-radius) ), dx-left, -dy-top ), ( rect( width: width, height: width, stroke: (left: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, bottom: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width), fill: color, radius: (bottom-left: implicant-radius) ), dx-right, -dy-top ), ( rect( width: width, height: width, stroke: (top: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, right: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width), fill: color, radius: (top-right: implicant-radius) ), dx-left, dy-bottom ), ( rect( width: width, height: width, stroke: (top: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width, left: color.darken(implicant-stroke-darken).transparentize(implicant-stroke-transparentize) + implicant-stroke-width), fill: color, radius: (top-left: implicant-radius) ), dx-right, dy-bottom ) ) } // Corner implicants. ) // Labels. let x-gray if grid-size == 16 { x-gray = table( columns: (cell-size,) * 4, rows: cell-size, align: center + bottom, stroke: none, [00], [01], [11], [10] ) } else { x-gray = table( columns: (cell-size,) * 2, rows: cell-size, align: center + bottom, stroke: none, [0], [1] ) } let y-gray if grid-size == 4 { y-gray = table( columns: cell-size, rows: cell-size, align: right + horizon, stroke: none, [0], [1] ) } else { y-gray = table( columns: cell-size, rows: cell-size, align: right + horizon, stroke: none, [00], [01], [11], [10] ) } block( breakable: false, grid( columns: 3, align: center + horizon, [], [], x-label, [], [], x-gray, y-label, y-gray, body, ) ) }
https://github.com/ANU-RSES-Education/EMSC-4017
https://raw.githubusercontent.com/ANU-RSES-Education/EMSC-4017/main/DataManagement/DataManagement.typ
typst
Creative Commons Zero v1.0 Universal
#import "@preview/mitex:0.2.1": * #import "@preview/pubmatter:0.1.0" #import "@preview/wrap-it:0.1.0": wrap-content // Some definitions for acronyms etc #show "Underworld": name => box[ #emph[#smallcaps[ #name ]] ] #show "FAIR": name => box[ #smallcaps[ f.a.i.r. ] ] // A pretty template #import "Template/lapreprint.typ": template #show: template.with( title: "Scientific Data Management", subtitle: "Notes for the 21st Century Scientist", short-title: "Data Management", // This is relative to the template file // When importing normally, you should be able to use it relative to this file. logo: "../Figures/RDM.png", //doi: "10.1190/tle35080703.1", // You can make all dates optional, however, `date` is by default `datetime.today()` // date: ( // (title: "Published", date: datetime(year: 2023, month: 08, day: 21)), // (title: "Accepted", date: datetime(year: 2022, month: 12, day: 10)), // (title: "Submitted", date: datetime(year: 2022, month: 12, day: 10)), // ), theme: red.darken(60%), authors: ( ( name: "<NAME>", orcid: "0000-0003-3685-174X", email: "<EMAIL>", affiliations: "1" ), // ( // name: "<NAME>", // orcid: "0000-0002-1551-5926", // affiliations: "1", // ), ), kind: "Lecture Notes", affiliations: ( (id: "1", name: "Australian National University"), // (id: "2", name: "Curvenote Inc."), ), abstract: ( (title: "Abstract", content: [ We introduce the concept of FAIR data, and the idea that you have to consciously and deliberately make data available to others. To do this you need to have a data plan as part of your project planning. FAIR data underpins the idea of reproducible research and this applies to computation as well as to measurements. ]), (title: "Plain Language Summary", content: [ Data does not just share itself, to make science open and reproducible, the original data need to be shared and distributed. ]), ), keywords: ("Data Management", "Reproducible Research", "Reusable Research", "F.A.I.R. data", "Tutorial"), open-access: true, heading-numbering: none, margin: ( ( title: "Key Points", content: [ - Data management is a requirement of funding - Data need to be FAIR - Reproducible science builds on FAIR principles ], ), ( title: "Correspondence to", content: [ <NAME>\ #link("mailto:<EMAIL>")[<EMAIL>] ], ), ( title: "Data Availability", content: [ The original document is located on Github at on #link("https://github.com/ANU-RSES-Education/EMSC-4017")[GitHub] ], ), ( title: "Funding", content: [ N/A ], ), ( title: "Competing Interests", content: [ The authors declare no competing interests. ], ), ), ) #set par(justify: true) #let quote(quoted-content) = { block(inset: (left: 1cm, right:1cm))[#quoted-content] } The nature of science is to question everything and to look for the unusual and unexpected. When something unexpected is observed we always have to ask if our understanding of the phenomena need to change or if we just need to be more careful with our measurements ! #quote[ *Extraordinary claims require extraordinary evidence* (a.k.a., the Sagan standard) was a phrase made popular by <NAME>. Its roots are much older, however, with the French mathematician Pierre-Simon LaplaceWikipedia stating that: _"...the more extraordinary a fact, the more it needs to be supported by strong evidence"_ Also, <NAME> wrote in 1748: _"A wise man … proportions his belief to the evidence"_, and _"No testimony is sufficient to establish a miracle, unless the testimony be of such a kind, that its falsehood would be more miraculous than the fact which it endeavors to establish."_ and <NAME> says: _"An extraordinary claim requires extraordinary proof."_ #link("https://rationalwiki.org/wiki/Extraordinary_claims_require_extraordinary_evidence")[Rational Wiki: Extraordinary Claims ...] ] // end quote At the heart of this quote is the concept of *reproducibility*. That is, if I am sceptical of your claim, I should do the experiment again and see for myself. Peer review is supposed to be a certification that this reproducibility has been validated. There are a number of ways in which scientific research results can be positively repeated (reproduced, replicated) and the following definitions are widely understood, if not universal. For my work to be _*reproducible*_, it means that if you follow my detailed instructions, and use the same experimental setup as me, then you will obtain the same answer as me. This follows from the most elementary principle, that any scientific result that is published has already been repeated by the author sufficiently to expect it to be reproducible by anyone, and that the presence of experimental error has been considered and accounted for in the way that the results are presented. A more demanding form of positive repeatability is the replication of research results. To *_replicate_* my results, it should be possible to use any equivalent experimental setup, not specifically the one I used, and still obtain the same answer. Neither of these two forms of repeatable experiments demand that you and I agree on the interpretation of the experiments, only that they can be positively repeated by either one of us. You are also free to disagree with my assertion that the results are meaningful, useful, or interesting ! It is also worth remembering that repeating the work in this way does not automatically make it straightforward to expand upon the ideas in the research and be in a position to modify and build upon the experiment. This is the concept of *_re-use_* of research results and it requires more effort than reproducibility or replicability. = Data Management What to we need to do to make it possible for people to trust our scientific reasoning. They may not agree with our conclusions, what can we do to ensure that they cannot undermine our argument on mere technical grounds and are forced to address our reasoning instead ? We are going to take a discuss data management from the perspective of #emph[advancing the scientific enterprise] — a high level goal that we can all broadly subscribe to, but which is easy to ignore or forget when we are pressed for time. Data management starts with the idea of “information management” and we can think about what this means if our information is a computer program or a document. In reality, though, it is much more general and applies to measurements or observations of any kind that we use to justify our scientific arguments. The Australian Research Council (ARC - which funds much of the academic research in non-medical topics in Australia) introduced a requirement that all research projects need to include a _*data management plan*_. When this was introduced, it took most of us by surprise, and not many people had thought about what this means or how to devise a plan. = What is meant by FAIR data ? FAIR is an acronym (Findable, Accessible, Interoperable, Reusable) that tries to describe the data life-cycle in @data-lifecycle. At the same time it has an upbeat feel that suggests we can all trust data that is FAIR. #figure( image(width: 50%, "Figures/data_cycle.png"), caption: [ The _data lifecycle_ is the starting point for understanding a data management plan and to understand what FAIR data really means ], ) <data-lifecycle> For a dataset to be considered FAIR it needs to be - #strong(delta:1000)[F]indable: The data has sufficiently rich metadata and a unique and persistent identifier to be easily discovered by others. This includes assigning a persistent identifier (like a DOI or Handle), having rich metadata to describe the data and making sure it is findable through disciplinary local or international discovery portals. - #strong(delta:1000)[I]nteroperable: The associated data and metadata uses a ‘formal, accessible, shared, and broadly applicable language for knowledge representation’. This involves using community accepted languages, formats and vocabularies in the data and metadata. Metadata should reference and describe relationships to other data, metadata and information through identifiers. - #strong(delta:1000)[A]ccessible: The data is retrievable by humans and machines through a standardised communication protocol, with authentication and authorisation where necessary. The data does not necessarily have to be open. Data can be sensitive due to privacy concerns, national security or commercial interests. When it’s not able to be open, there should be clarity and transparency around the conditions governing access and reuse. - #strong(delta:1000)[R]eusable: The associated metadata provides rich and accurate information, and the data comes with a clear usage licence and detailed provenance information. Reusable data should maintain its initial richness. For example, it should not be diminished for the purpose of explaining the findings in one particular publication. It needs a clear machine readable licence and provenance information on how the data was formed. It should also use discipline-specific data and metadata standards to give it rich contextual information that will allow reuse. Read more about FAIR data at the #link("https://ardc.edu.au/resource/fair-data/")[Australian Research Data Commons FAIR data] page. You can see parallels between the ideas of FAIR data and the open-source software community. Both are built upon the premise that more gets done if everyone shares the load. Open source software is normally described as a community working together (a positive vibe) whereas sometimes (often) reproducible science starts from the idea that untrustworthy results are weeded out (a little bit more negative, in my mind). = Discussion The Australian Research Council (ARC - which funds much of the academic research in non-medical topics in Australia) introduced a requirement that all research projects need to include a _*data management plan*_. When this was introduced, it took most of us by surprise, and not many people had thought about what this means or how to devise a plan. We are going to take a discuss data management from the perspective of #emph[advancing the scientific enterprise] — a high level goal that we can all broadly subscribe to, but which is easy to ignore or forget when we are pressed for time. Data management starts with the idea of “information management” and we can think about what this means if our information is a computer program or a document. In reality, though, it is much more general and applies to measurements or observations of any kind that we use to justify our scientific arguments. What to we need to do to make it possible for people to trust our scientific reasoning. They may not agree with our conclusions, what can we do to ensure that they cannot undermine our argument on mere technical grounds and are forced to address our reasoning instead ? == Activity (1) VIDEO / Presentation (reproducible research) == Questions - Why should our data be freely available ? - Are there any reasons to keep thing secret ? - Why should our methods / software be open ? - Is there something like open source for research equipment ? == Activity (2) I would like you to understand a little about how we can share data, measurements and written information. We can start simply by considering how we share and collaborate on a document. We'll look at the source of this particular document and how we can share it on GitHub (www.github.com). The discussion that we have while we do this should allow you to appreciate the following: - Provenance: How can we track the data or the document back through time to see all the steps along the path to its present state. - Version control / Revision control: Formalising the way we track changes to our information (in documents or software we track versions and the changes between them). What does this mean for a dataset ? - Meta-data: The description of the dataset or the document is considered to be a form of data in its own right and is usually called "meta-data". A good example that you will be familiar with is to pull up the information on a photo from your phone. #figure( image(width: 75%, "Figures/PhotoMetadata.png"), caption: [ An example of meta-data that you will be familiar with already. ], ) - DOI: a "digital object identifier" is a persistent URL that directs you to a piece of information. This can be a dataset, a publication, a blog post, what is important is that it can be guaranteed to work in perpetuity (at least in theory). = Examples of open data statements == Australian Research Council #quote[ Effective data management is an important part of ensuring open access to publicly funded research data. Data management planning from the beginning of a research project helps to outline how data will be collected, formatted, described, stored and shared throughout, and beyond, the project lifecycle. Since February 2014, the ARC has required researchers to outline how they plan to manage research data arising from ARC-funded research. From 2020, this requirement forms part of the agreement for funding under the National Competitive Grants Program. The requirement is consistent with the responsibilities outlined in the Australian Code for the Responsible Conduct of Research 2018, which include the proper management of research data and primary materials by researchers, along with institutional policies addressing data ownership, storage, retention and “appropriate access…by the research community”. The OECD Principles and Guidelines for Access to Research Data from Public Funding (2007) also provide guidance on the management of data and primary materials. The ARC notes that Australia, as an OECD member, is expected (not legally bound) to implement these principles and guidelines. The ARC’s requirement is designed to encourage researchers to consider the ways in which they can best manage, store, disseminate and reuse data. Researchers, in consultation with institutions, have a responsibility to consider the management and future potential of their research data, taking into account the particular approaches, standards and uses for data that may exist in different institutions, disciplines and research projects. Some institutions may have infrastructure and/or processes in place for storing, managing and sharing data – these are valuable resources that should be utilised. The ARC does not require that full, detailed data management plans be submitted for assessment, but from 2020 will require that such plans are in place prior to the commencement of the project. Currently, the ARC does not mandate open access to data. ] == The Royal Society #quote[ The Royal Society supports science as an open enterprise and is committed to ensuring that data outputs from research supported by the Society are made publicly available in a managed and responsible manner, with as few restrictions as possible. Data outputs should be deposited in an appropriate, recognised, publicly available repository, so that others can verify and build upon the data, which is of public interest. To fully realise the benefits of publicly available data they should be made intelligently open by fulfilling the requirements of being discoverable, accessible, intelligible, assessable and reusable. The Royal Society does not dictate a set format for data management and sharing plans. Where they are required, applicants should structure their plan in a manner most appropriate to the proposed research. The information submitted in plans should focus specifically on how the data outputs will be managed and shared, detailing the repositories where data will be deposited. In considering your approach for data management and sharing, applicants should consider the following: - What data outputs will be generated by the research that are of value to the public? - Where and when will you make the data available? - How will others be able to access the data? - If the data is of high public interest, how will it be made accessible not only for those in the same or linked field, but also to a wider public audience? - Specify whether any limits will be placed on the data to be shared, for example, for the purposes of safeguarding commercial interests, personal information, safety or security of the data. - How will datasets be preserved to ensure they are of long-term benefit? ] == National Science Foundation === NSF's data sharing policy #quote[ NSF-funded investigators are expected to share with other researchers, at no more than incremental cost and within a reasonable time, the primary data, samples, physical collections and other supporting materials created or gathered in the course of work under NSF awards. See: #link("https://www.nsf.gov/bfa/dias/policy/dmp.jsp")[NSF: Dissemination and Sharing of Research Results] Plans for data management and sharing of the products of research. Proposals must include a supplementary document of no more than two pages labeled “Data Management Plan”. This supplement should describe how the proposal will conform to NSF policy on the dissemination and sharing of research results (see AAG Chapter VI.D.4), and may include: + the types of data, samples, physical collections, software, curriculum materials, and other materials to be produced in the course of the project; + the standards to be used for data and metadata format and content (where existing standards are absent or deemed inadequate, this should be documented along with any proposed solutions or remedies); + policies for access and sharing including provisions for appropriate protection of privacy, confidentiality, security, intellectual property, or other rights or requirements; + policies and provisions for re-use, re-distribution, and the production of derivatives; and + plans for archiving data, samples, and other research products, and for preservation of access to them. #text(fill: red.darken(20%))[A valid Data Management Plan may include only the statement that no detailed plan is needed, as long as the statement is accompanied by a clear justification.] ] = Resources - https://ardc.edu.au/resource/good-data-practices/ - GitHub (https://www.github.com) — a web-based repository for information, metadata and version control. GitHub is not intended for massive datasets, but it does offer long-lived archives and change tracking. - Zenodo (https://www.zenodo.org) - a data archive that guarantees permanence for your data and provides a DOI for anything you upload. It is possible to have versions of data but every version is treated as a unique artefact and is considered whole and complete. You can use Zenodo to create a snapshot of your GitHub repository (e.g. a release) and give it a DOI, a fact that might help you to understand the difference in these two approaches to data management (and when you would choose one over the other). ["https://zenodo.org/communities/auscope/records?q=&l=list&p=1&s=10&sort=newest"](Auscope's zenodo) page. It's a bit dry and library-like but that's intentional. - Figshare (https://www.figshare.org) - started out as a place to keep large posters and maps but is now #text(fill: red.darken(20%))["a home for papers, FAIR data and non-traditional research outputs that is easy to use and ready now"]. This is another way to apply for a DOI for your data. - ArXiv / EarthArXiv - "#link("https://arxiv.org")[arXiv] is a free distribution service and an open-access archive for nearly 2.4 million scholarly articles in the fields of physics, mathematics, computer science, quantitative biology, quantitative finance, statistics, electrical engineering and systems science, and economics." / "Active since 2017, #link("https://eartharxiv.org/")[EarthArXiv] is a preprint server devoted to open scholarly communication. EarthArXiv publishes articles from all subdomains of Earth Science and related domains of planetary science. The EarthArXiv platform assigns each submission a Digital Object Identifier (DOI), therefore assigning provenance and making it citable in other scholarly works." - https://www.geo-down-under.org.au - this is an Earth Science blog that you are welcome to write articles for if you want. It is a little bit unusual in that all blog posts are given a DOI. Do you think blog posts deserve a DOI ? What about tweets or text messages ? // $ 7.32 beta + // sum_(i=0)^nabla // (Q_i (a_i - epsilon)) / 2 $ // what does that do ? // #smallcaps("Underworld") // #mitex(` // \newcommand{\f}[2]{#1f(#2)} // \f\relax{x} = \int_{-\infty}^\infty // \f\hat\xi\,e^{2 \pi i \xi x} // \,d\xi // `) // What does this do: Underworld
https://github.com/Student-Smart-Printing-Service-HCMUT/ssps-docs
https://raw.githubusercontent.com/Student-Smart-Printing-Service-HCMUT/ssps-docs/main/contents/categories/task5/5.conclude.typ
typst
Apache License 2.0
#{include "./5.1.typ"} #{include "./5.2.typ"}
https://github.com/An-314/Notes-of-Nuclear_Radiation_Physics_and_Detection
https://raw.githubusercontent.com/An-314/Notes-of-Nuclear_Radiation_Physics_and_Detection/main/chap3.typ
typst
#import"@preview/physica:0.9.2":* #import "@local/mytemplate:1.0.0": * #let a = $alpha$ #let b = $beta$ #let g = $gamma$ = 原子核的衰变 原子核衰变主要的类型: $alpha, beta, gamma$。此外,还有中子发射、质子发射、裂变等。 各种辐射的穿透能力: #grid( columns: (1fr, 1fr), [#figure( image("pic/2024-03-21-10-44-35.png", width: 85%), caption: [ 辐射的穿透能力 ], )], [#figure( image("pic/pic/2024-02-29-10-53-41.png.png", width: 90%), caption: [ 辐射的穿透能力 ], )] ) == $alpha$衰变 *$alpha$衰变*:不稳定原子核*自发地*放出$alpha$粒子而蜕变的过程。 表达式: $ ""^A_Z X -> ""^(A-4)_(Z-2)Y + alpha $ 其中$alpha = ""^4_2"He"$。 $alpha$衰变中的守恒定律: #grid( columns: (1fr, 1fr, 1fr), gutter: 12pt, [质量数守恒], [电荷数守恒], [动量守恒], [能量守恒], [角动量守恒], [宇称守恒], ) #newpara() 基本特点: - $alpha$放射性核素一般为重核,质量数 $>140$; - $alpha$衰变放出的$alpha$粒子能量在$4~9$MeV,*分立能量,不连续* #figure( image("pic/2024-03-21-10-54-35.png", width: 80%), caption: [ $alpha$粒子分立能谱 ], ) - $alpha$衰变半衰期范围很宽,$10^(-7)s~10^15a$。 #figure( image("pic/2024-03-21-10-55-38.png", width: 80%), caption: [ $alpha$衰变的衰变纲图 ], ) === $alpha$衰变能及$alpha$衰变的发生条件 #figure( image("pic/2024-03-21-10-56-56.png", width: 80%), caption: [ $alpha$衰变能及$alpha$衰变的发生条件 ], ) 设衰变前,母核X静止,根据能量守恒定律:衰变前静止质量=衰变后静止质量+动能(*$alpha$衰变能*)。 $ m_X c^2 = m_Y c^2 + m_(alpha) c^2 + #text(fill: red)[$(T_Y + T_(alpha))$] $ ==== $alpha$衰变能 $alpha$衰变能:$alpha$衰变中子核Y和 #a 粒子的动能之和,用$E_0$或$Q$表示。等于*衰变前后体系的静止质量之差所对应的能量*。 $ E_0 &= T_Y + T_(alpha) = m_X c^2 - m_Y c^2 - m_(alpha) c^2\ &= Delta(Z,A) - (Delta(Z-2,A-4) + Delta(2,4)) $ 下面的以原子质量$M$代替核质量$m$,并忽略电子结合能差异得到。 ==== $alpha$衰变的发生条件 $alpha$衰变的必要条件:$alpha$衰变能$E_0$必须大于零,即 $ Delta(Z,A) > Delta(Z-2,A-4) + Delta(2,4) $ 衰变前母核原子质量必须大于衰变后子核原子质量和氦原子质量之和。 ==== 用质量亏损$Delta m$或结合能$B$表示$alpha$衰变能 由质量亏损的定义: $ cases( m_X = Z m_p + (A-Z) m_n - Delta m_X, m_Y = (Z-2) m_p + (A-4-Z+2) m_n - Delta m_Y, m_(alpha) = 2 m_p + 2 m_n - Delta m_(alpha) ) $ 则 $ E_0 &= (Delta m_Y + Delta m_(alpha) - Delta m_X)c^2\ &= B_Y + B_(alpha) - B_X $ 假设结合能随$(Z, A)$的变化是平滑的: $ E_0 approx Delta B + B_alpha = (diff B)/(diff Z)Delta Z + (diff B)/(diff A)Delta A + B_alpha $ 代入结合能半经验公式,可得到: a衰变能随$(Z, A)$的变化关系$E_0(Z, A)$ 。 === $alpha$衰变能与$alpha$粒子动能的关系 设衰变前,母核X静止,根据能量守恒定律: $ E_0 = T_Y + T_(alpha) = m_X c^2 - m_Y c^2 - m_(alpha) c^2 $ 设衰变前,母核X静止,根据动量守恒定律: $ m_Y v_Y = m_(alpha) v_(alpha) $ 则 $ T_Y = 1/2 m_Y v_Y^2 = 1/2 m_alpha v_alpha v_Y = 1/2 m_alpha v_alpha (m_alpha v_alpha)/(m_Y) = m_alpha/m_Y T_alpha $ *得到子核反冲能与 #a 粒子动能的关系:* $ #text(fill: red)[$T_Y = m_alpha/m_Y T_alpha$] $ 且有: $ E_0 = T_alpha + T_Y = (1 + m_alpha/m_Y) T_alpha approx A/(A-4) T_alpha $ *得到$alpha$衰变能与$alpha$粒子动能的关系:* $ #text(fill: red)[$E_0 approx A/(A-4) T_alpha$] $ 通过*测量 #a 粒子的能量可得到 #a 衰变能*。 === $alpha$衰变能与核能级的关系 #figure( image("pic/2024-03-21-11-14-25.png", width: 80%), caption: [ $alpha$衰变能与核能级的关系 ], ) *常见情况*:母核从基态衰变到子核的不同能级,得到不同的 #a 衰变能, #a 衰变能之差等于子核的能级能量之差。 #figure( image("pic/2024-03-26-13-41-53.png", width: 80%), caption: [ 母核从基态衰变到子核的不同能级 ], ) 如果子核处于激发态,则: $ E_0^* = (m_X - m_Y^* - m_(alpha))c^2 $ 激发态子核的质量: $ m_Y^* = m_Y + E_Y^* /c^2 $ 得到子*核激发能和 #a 衰变能*之间的关系: $ E_0^* = E_0 + E_Y^* $ 可以通过测量 #a 粒子的能量和子核的能级能量来确定子核的能级能量。 #figure( image("pic/2024-03-21-11-21-30.png", width: 90%), caption: [ 通过测量 #a 粒子的能量和子核的能级能量来确定子核的能级能量并绘制衰变纲图 ], ) *罕见情况*:母核从不同能级直接衰变到子核基态,得到不同的 #a 衰变能, #a 衰变能之差等于母核的能级能量之差。 #figure( image("pic/2024-03-26-13-42-19.png", width: 80%), caption: [ 母核从不同能级直接衰变到子核基态 ], ) 由 #a 衰变能的定义: $ E_0 = (m_X - m_Y - m_(alpha))c^2 $ 如果母核处于激发态,则: $ E_O^* = (m_X^* - m_Y - m_(alpha))c^2 $ 激发态母核的质量: $ m_X^* = m_X + E_X^* /c^2 $ 得到母核激发能和 #a 衰变能之间的关系: $ E_0^* = E_0 + E_X^* $ === #a 衰变能与衰变常数的关系 实验发现,#a 粒子能量与衰变常数之间有如下经验关系: $ lambda &= a T_alpha^86.25\ lg lambda &= A + 86.25 lg T_alpha $ 系数$a$或$A$对同一个天然放射系是常数。可以看出:衰变常数$lambda$随 #a 粒子能量剧烈变化。 #figure( image("pic/2024-03-26-13-49-22.png", width: 80%), caption: [ #a 粒子能量与衰变常数之间的关系 ], ) 量子力学:*势垒穿透理论*可以解释 #a 粒子能量与衰变常数之间的关系。 #figure( image("pic/2024-03-26-13-50-32.png", width: 80%), caption: [ 势垒穿透理论 ], ) 按量子力学势垒穿透理论, #a 粒子一次撞击势垒而穿透势垒的概率为: $ P = e^(-G) $ 其中 $ G = (2 sqrt(2 mu))/hbar integral_R^b sqrt(V(r) - E) dd(r) $ 其中$mu$为折合质量。衰变常数$lambda = n P$是单位时间内发生 #a 衰变的概率,应等于单位时间内 #a 粒子撞击势垒的次数$n$与一次撞击穿透势垒的概率$P$的乘积($P$很小,$n$很大, $n P$很小)。 1. A、B对同一元素为常数,近似仅与$Z$有关。 2. 由 #a 衰变理论得到的该公式和对偶偶核得出的实验规律符合得很好。 3. $E_0$变化一点,$tau$变化很大。即:#a 衰变的衰变常数随发射的 #a 粒子的能量而剧烈变化, #a 粒子能量越高衰变常数越大。与实验结论一致。 === #a 衰变中的角动量守恒和宇称守恒 $ ""^A_Z X &->& ""^(A-4)_(Z-2)Y &+ alpha\ I_X pi_x &&J_Y pi_Y &J_(alpha) pi_(alpha) $ 由*角动量守恒*: $ J_alpha = |J_Y - J_X|, |J_Y - J_X| + 1, |J_Y - J_X| + 2, ... , J_Y + J_X $ 由*宇称守恒*: $ pi_alpha = pi_Y / pi_X $ #newpara() 由于α粒子的自旋和内秉宇称为: $ l_alpha = 0, pi_alpha = (-1)^(l_alpha) = 1 $ #a 粒子轨道角动量等于总角动量: $ l_alpha = J_alpha $ #a 的轨道宇称等于总宇称: $ (-1)^(l_alpha) = (-1)^(J_alpha) = pi_alpha $ 母核和子核有确定的宇称,只能相同或相反,则$J_α$只能取其中的偶数或奇数。 #a 衰变应满足的*角动量和宇称守恒选择条件*: - 当$pi_X = pi_Y$时,$J_alpha$为偶数; - 当$pi_X = -pi_Y$时,$J_alpha$为奇数。 且:对同一α衰变,$l_alpha$取最小值的概率最大。#footnote[#a 粒子与核的作用等于库仑势能加上离心势能,离心势能与$l_alpha(l_alpha+1)$成正比。 $l_alpha$ 越大,势垒越高,衰变概率越小。] === 其他发射重粒子的衰变 由衰变能与母核、子核之间的关系: $ E_0 = (m_X - (m_Y + m_h))c^2 $ 从能量守恒看,只要$E_0>0$,就有可能发生发射该粒子的情况。 ==== 质子发射:原子核自发发射质子的现象 - #b 稳定线附近的核素,其最后一个质子的结合能$S_p > 0$,因而不能自发地发射质子。 - 远离#b 稳定线的缺中子核素,其$N/Z$很小,可出现$S_p< 0$, 满足自发发射质子的必要条件。 - 质子发射的竞争过程是$beta^+$衰变和轨道电子俘获,质子发射的概率小得多, 一般观察不到。 - 质子发射是研究远离#b 稳定线核素的重要领域。 $ p + ""^54_26 "Fe" -> ""^"53m"_27 "Co" + 2n $ ==== 重粒子发射 #figure( table( columns: (auto, auto), inset: 10pt, align: horizon, [$""^14"C "$发射],[$""^223_88"Ra" -> ""^209_82"Pb" + ""^14_6"C "$], [$""^24"Ne"$发射],[$""^232_92"U " -> ""^208_82"Pb" + ""^24_10"Ne"$], [$""^38"Si"$发射],[$""^241_95"Am" -> ""^213_81"Tl" + ""^38_14"Si"$], ) ) 重离子放射性的研究可以提供重离子发射机制和核结构的信息。 == $beta$衰变 *$beta$衰变*:*核电荷数改变*而*核子数不变*的*自发*核衰变过程。 #b 衰变基本特点: - #b 衰变包括: - $beta^-$衰变 - $beta^+$衰变 - 轨道电子俘获(EC) - $beta$放射性核素遍及整个元素周期表 - #b 衰变发射粒子最大能量在几十keV~几 MeV - #b 衰变半衰期范围为:$10^(-3)s~10^(24)a$ === #b 衰变与中微子理论 1900年,贝克勒尔证明铀盐放射出的β-射线就是电子,该结论1903年被卢瑟福证实。 #figure( image("pic/2024-03-26-14-20-46.png", width: 80%), caption: [ #b 射线谱 ], ) + _连续能谱与量子体系及能量守恒定律的矛盾?_ + 子核有很多能级,以至于母核到子核衰变的能谱连续? 要求相应有连续的 #g 能谱,与实验矛盾。 + 发射单能 b 粒子,随后与轨道电子作用损失能量? 要求相应所有电子总能量等于最大能量,与实验矛盾。 - <NAME>暗示“也许在亚原子尺度,能量不守恒”。 - Pauli不接受能量不守恒 提出了新的解决难题的假设——认为在#b 衰变过程中原子核还放出了一个新的,还没有被探测到的粒子。 - 1930年Pauli在信中暗示#b 能谱的连续性可通过在衰变中除了#b 粒子,还发射出一个中性粒子来解释。该粒子自旋为$1/2$, 质量很小,与其他物质作用截面很小。Pauli称这种粒子为neutron。该假设挽救了能量、动量和角动量守恒定律。 - 1933年, Pauli才正式宣布他的假说, 这时Chadwick发现neutron已经一年了, 这个 neutron 和 Pauli 当时预言的有很大不同。1934年, Fermi用Pauli的假说建立了#b 衰变的量子理论, 并给该粒子命名为 neutrino——*中微子*。 - 几年后证明,Fermi的#b 衰变理论非常成功的解释了#b 衰变实验。 + _新问题:Pauli预言的粒子真的存在吗?_ *中微子不带电,只参与弱相互作用和引力相互作用。* - 弱相互作用距离非常短; ($10^(-18)"m "$) - 引力相互作用在亚原子尺度下十分微弱; *中微子在穿过一般物质时难以作用,也就难以探测。* - 作用截面很小$sigma ~ 10^(-43)"cm"^2$;地球上固体的原子密度$N ~ 10^22"cm"^(-3)$,中微子与物质作用的平均自由程$l = 1/(N sigma) ~ 10^16"km"$,大于地球半径。 *测量:*$tilde(nu) + p -> n + e^+$,中微子与质子作用,产生中子和正电子,正电子与电子湮灭产生两个光子,可以测量。 ==== 中微子 *中微子*的基本性质: + 电荷为零; + 自旋为$1/2$, 遵从费米统计; + 质量$~ 0$, 质量上限不超过2eV; + 磁矩非常小,上限不超过$10^(-6)mu_N$ ; + 与物质的相互作用非常弱,属弱相互作用,作用截面$sigma ~ 10^(-43)"cm"^2$,平均自由程$l ~ 10^16"km"$。 *中微子和反中微子*:互为反粒子 + 相同:质量、电荷、自旋、磁矩 + 不同: + 自旋方向不同; 中微子自旋方向与运动方向相反,左旋粒子; 反中微子自旋方向与运动方向相同,右旋粒子。 + 相互作用性质不同。 #figure( image("pic/2024-03-26-15-01-34.png", width: 80%), caption: [ 中微子和反中微子的自旋 ], ) ==== $beta$衰变理论 2. _#b 衰变放出的电子(或正电子)是如何产生的?_——Fermi的 #b 衰变理论 中子和质子是核子的两个不同状态,它们之间的转变相当于两个量子态之间的跃迁,在跃迁过程中放出电子和中微子,它们事先并不存在于核内。 - $beta^-$衰变的本质是核内一个*中子变为质子*; - $beta^+$和EC的本质是核内一个*质子变为中子*; - 导致产生电子和中微子的是*弱相互作用*。 遵循:*电荷数守恒、质量数守恒、轻子数守恒*。 #figure( table( columns: (auto, auto), inset: 10pt, align: horizon, [$beta^-$衰变],[$n -> p + e^- + tilde(nu)_e$], [$beta^+$衰变],[$p -> n + e^+ + nu_e$], [轨道电子俘获],[$e^-_k + p -> n + nu_e$], ) ) === $beta^-$衰变($beta^-$decay) *$beta^-$衰变:*母核X衰变为子核Y、放出*一个电子和一个反中微子*,核中一个中子变为质子的自发核衰变过程。 $ ""^A_Z X -> ""^A_(Z+1)Y + e^- + tilde(nu)_e $ *电荷数守恒、质量数守恒、轻子数守恒*。 *$beta^-$衰变质能关系:* $ m_X c^2 = m_Y c^2 + m_0 c^2 + #text(fill: red)[$T_(beta^-) + T_(tilde(nu)_e) + T_Y$] $ 衰变前静止质量 = 衰变后静止质量 + (电子动能 + 反中微子动能 + 子核动能)$beta^-$衰变能——衰变后动能 *$beta^-$衰变能:*$E_0$(或$Q$) 为反中微子和$beta^-$粒子的动能之和,也就是衰变前后体系*静止质量之差*所对应的能量。 $ E_0(beta^-) = T_(beta^-) + T_(tilde(nu)_e) = m_X c^2 - m_Y c^2 - m_0 c^2 $ 以原子质量$M$代替核质量$m$,并忽略电子结合能差异: $ E_0(beta^-) = (M_X - M_Y)c^2 = Delta(Z, A) - Delta(Z+1, A) $ #newpara() *$beta^-$衰变的发生条件:* $ Delta(Z, A) > Delta(Z+1, A) $ 衰变前母核*原子质量*必须大于衰变后子核*原子质量*。 #figure( image("pic/2024-03-26-15-05-18.png", width: 80%), caption: [ $beta^-$衰变的衰变纲图 ], ) === $beta^+$衰变($beta^+$decay) *$beta^+$衰变:*母核X衰变为子核Y、放出*一个正电子和一个中微子*,核中一个质子变为中子的自发核衰变过程。 $ ""^A_Z X -> ""^A_(Z-1)Y + e^+ + nu_e $ *电荷数守恒、质量数守恒、轻子数守恒*。 *$beta^+$衰变质能关系:* $ m_X c^2 = m_Y c^2 + m_0 c^2 + #text(fill: red)[$(T_(beta^+) + T_(nu_e) + T_Y)$] $ 衰变前静止质量 = 衰变后静止质量 + (正电子动能 + 中微子动能 + 子核动能)$beta^+$衰变能——到子核基态的 *$beta^+$衰变能:*$E_0$(或$Q$) 为中微子和$beta^+$粒子的动能之和,也就是衰变前后体系静止质量之差所对应的能量。 $ E_0(beta^+) = T_(beta^+) + T_(nu_e) = m_X c^2 - m_Y c^2 - m_0 c^2 $ 以原子质量$M$代替核质量$m$,并忽略电子结合能差异 $ E_0(beta^+) = (M_X - M_Y - 2m_0)c^2 = Delta(Z, A) - Delta(Z-1, A) - #text(fill: red)[$2m_0 c^2$] $ #newpara() *$beta^+$衰变的发生条件:* $ Delta(Z, A) > Delta(Z-1, A) + 2m_0 c^2 (1.022M e V) $ 衰变前母核*原子质量*必须大于衰变后子核*原子质量*和两个电子的质量之和。 #figure( image("pic/2024-03-28-10-07-38.png", width: 80%), caption: [ $beta^+$衰变的衰变纲图 ], ) === *$beta^+$衰变的后续过程——正电子的湮没* 正电子在径迹的末端(近似认为动能为零)与*电子发生湮没,放出两个 #g 光子*(湮没辐射)。 $ e^+ + e^- -> 2gamma $ 由能量守恒定律:湮没时,正、负电子的动能为零(近似),则*两个湮没光子的总能量应等于正、负电子的静止质量之和*。 由动量守恒定律:湮没前正、负电子的总动量为零(近似),则湮没后*两个湮没光子的总动量也应为零*。 $ h nu = m_e c^2 = 511"keV" $ $beta^+$衰变的后续过程是正电子湮没,一个正电子湮没产生*两个能量为$511$keV的湮没光子*( #g 射线)。两湮没光子的*方向相反*,且发射是*各向同性*的。 === 轨道电子俘获(EC) *轨道电子俘获:*母核俘获核外*轨道上*的一个电子,使核中的一个质子转变为中子, 同时*放出一个中微子*的自发核衰变过程。 $ e^-_i + p -> n + nu_e $ $i$表示电子的轨道,取$K、 L、 M$等,$K$层电子俘获最容易发生。 - 电荷数守恒 - 质量数守恒 - 轻子数守恒 *$E C$衰变质能关系:* $ m_X c^2 + m_0 c^2 - epsilon_i = m_Y c^2 + T_(nu_e) + T_Y $ 衰变前静止质量 - 轨道电子结合能 = 衰变后静止质量 + (中微子动能 + 子核动能)$E C$衰变能 *$E C$衰变能:*$E_0$(或$Q$) 为*中微子的动能和子核的动能之和*,也就是衰变前后体系静止质量之差所对应的能量再减去轨道电子的结合能。 $ E_0(E C) = m_X c^2 + m_0 c^2 - epsilon_i - m_Y c^2 $ 以原子质量$M$代替核质量$m$,并忽略电子结合能差异 $ E_0(E C) = (M_X - M_Y)c^2 - epsilon_i = Delta(Z, A) - Delta(Z-1, A) - epsilon_i $ #newpara() *$E C$衰变的发生条件:* $ Delta(Z, A) > Delta(Z-1, A) + epsilon_i $ 衰变前母核*原子质量*必须大于衰变后子核*原子质量*和*轨道电子的结合能之和*。 由于$2m_0 c^2 >> epsilon_i$,所以能发生 $beta^+$ 衰变的原子核总可以发生轨道电子俘获,反过来不成立。 对满足发生$beta^+$衰变条件的核素,发生$beta^+$和EC是相互竞争的,一般来说: - 轻核/高衰变能倾向于发生$beta^+$衰变; - 重核/低衰变能倾向于发生EC; - 中等质量的核两种衰变各有一定比例。 #figure( image("pic/2024-03-28-10-41-44.png", width: 40%), caption: [ $beta^+$和EC相互竞争 ], ) #figure( image("pic/2024-03-28-10-42-21.png", width: 80%), caption: [ EC衰变的衰变纲图 ], ) *EC衰变的后续过程* #figure( image("pic/2024-03-28-10-51-29.png", width: 80%), caption: [ EC衰变的后续过程 ], ) - 对于原子序数低的核素,主要发生俄歇电子发射; - 对于原子序数高的核素,主要发生X射线发射。 #figure( image("pic/2024-03-28-11-15-02.png", width: 80%), caption: [ 三种 #b 衰变放出的射线及能量特征 ], ) === #b 衰变的费米理论与 #b 衰变的选择定则 ==== #b 衰变的费米理论 - 中子和质子是核子的两个不同状态,它们之间的转变相当于两个量子态之间的跃迁。 - 核子在两个量子*态跃迁过程中放出电子和中微子*,电子和中微子事先并不存在于核内。 - 导致产生电子和中微子的是*弱相互作用*。 ==== 费米理论之 #b 衰变概率公式 由量子力学,在 #b 衰变中, 单位时间内原子核发射一个动量在 $p_beta tilde p_beta + dd(p_beta)$ 之间的 #b 粒子的概率为: $ I(p_beta) dd(p_beta) = (g^2 |M_(i f)|^2)/(1 pi^2 hbar^7 c^3) (E_0 - T_beta)^2 p_beta^2 dd(p_beta) $ 其中: $ M_(i f) = integral psi_f^*_(N_f) psi_i_(N_i) e^(- i/hbar (arrow(p)_beta + arrow(p)_v) dot arrow(r)) dd(tau) $ 为跃迁矩阵元。 将轻子的平面波按轻子轨道角动量$l$展开为球面波: $ e^(- i/hbar (arrow(p)_beta + arrow(p)_v) dot arrow(r)) = sum_(l = 0)^oo ((2l+1)(-i)^l)/(2l+1)!! ((arrow(k)_beta + arrow(k)_v) dot arrow(r))^l P_l (cos theta) $ $l$越大,相应项的值越小。主要贡献项是$l$取最小值的项。 由 *角动量守恒* 和 *宇称选择条件* 共同确定 $l$ 可取的最小值,决定了 #b 跃迁的*级次*。 ===== #b 衰变的跃迁级次(概率从大到小) - *允许跃迁*: $l = 0$ 的项有贡献; ( $l$ 最小值可取 $0$ ) - *禁戒跃迁*: $l = 0$ 的项无贡献: - *一级禁戒跃迁*: $l = 1$ 的项有贡献; ( $l$ 最小值可取 $1$ ) - *二级禁戒跃迁*: $l = 2$ 的项有贡献; ( $l$ 最小值可取 $2$ ) - ... - *$n$级禁戒跃迁*: $l = n$ 的项有贡献; ( $l$ 最小值可取 $n$ ) $l$ 不方便直接应用,方便的(更关心的)是母核和子核的$I$ 和 $π$, 需要建立 $l$ 最小可取值 与 $Delta I$ 和 $Delta π$ 的关系,即 $β$ 衰变的选择定则。 #b 衰变中,*角动量守恒*: $ arrow(I)_i = arrow(I)_f + arrow(s) + arrow(l), arrow(s) = arrow(s)_e + arrow(s)_v $ 母子核的角动量差别由两个轻子的自旋和轨道角动量决定。两个轻子均为费米子,自旋角动量量子数均为$1/2$。——*两个轻子的总自旋角动量量子数 $s$ 取 $0$ 或 $1$*。 - $s = 0$ 称为自旋单态,电子和中微子自旋反平行; - $s =1$ 称为自旋三重态,电子和中微子自旋平行。 #b 衰变中,*宇称不守恒*: 因此,不能根据宇称守恒得到宇称选择定则,但在非相对论处理中, #b 衰变原子核宇称的变化可以认为*等于轻子“带走”的轨道宇称*: $ pi_i = pi_f (-1)^l $ 得到 #b 衰变的*宇称选择定则*: $ Delta pi = pi_i pi_f = (-1)^l $ ===== 允许跃迁 $l = 0$ $ arrow(I)_i = arrow(I)_f + arrow(s) $ - $s = 0$,费米(F)选择定则, F跃迁, F相互作用 $ I_i = I_f ; Delta I = 0 $ - $s = 1$,伽莫夫-泰勒(G-T)选择,G-T跃迁,G-T相互作用 $ I_i = I_f plus.minus 1, I_f ; Delta I = 0, plus.minus 1 $ 从而得到 $l = 0$ 的允许跃迁的选择定则: #figure( three-line-table[ | 跃迁 |自旋选择定则 | 宇称选择定则 | | --- | --- | --- | | F跃迁 | $Delta I = 0$ | $Delta pi = +1$ | | G-T跃迁 | $Delta I = 0, plus.minus 1$ | $Delta pi = +1$ | ], caption: [ $l = 0$ 的允许跃迁的选择定则 ], kind: table, ) ===== 禁戒跃迁 $l = 1$ $ arrow(I)_i = arrow(I)_f + arrow(s) + arrow(l) $ - $s = 0$,F跃迁 $ |arrow(l) + arrow(s)| = 1 $ - $s = 1$,G-T跃迁 $ |arrow(l) - arrow(s)| = 0,1,2 $ 并且: - $|arrow(l) + arrow(s)| = 0$时有$Delta I = 0$; - $|arrow(l) + arrow(s)| = 1$时有$Delta I = 0, plus.minus 1$; - $|arrow(l) + arrow(s)| = 2$时有$Delta I = 0, plus.minus 1, plus.minus 2$。 从而得到 $l = 1$ 的禁戒跃迁的选择定则: #figure( three-line-table[ |自旋选择定则 | 宇称选择定则 | | --- | --- | | $Delta I = 0, plus.minus 1, plus.minus 2$ | $Delta pi = -1$ | ], caption: [ $l = 1$ 的禁戒跃迁的选择定则 ], kind: table, ) ===== 禁戒跃迁 $l = 2$ $ arrow(I)_i = arrow(I)_f + arrow(s) + arrow(l) $ - $s = 0$,F跃迁 $ |arrow(l) + arrow(s)| = 2 $ - $s = 1$,G-T跃迁 $ |arrow(l) - arrow(s)| = 1,2,3 $ 并且: - $|arrow(l) + arrow(s)| = 1$时有$Delta I = 0, plus.minus 1$; - $|arrow(l) + arrow(s)| = 2$时有$Delta I = 0, plus.minus 1, plus.minus 2$。 - $|arrow(l) + arrow(s)| = 3$时有$Delta I = 0, plus.minus 1, plus.minus 2, plus.minus 3$。 但缺省了$l!=0$这个条件,所以排除掉了$l=0$的情况:$Delta I = 0 plus.minus 1$,剩下的就是$Delta I = plus.minus 2, plus.minus 3$。 #figure( three-line-table[ |自旋选择定则 | 宇称选择定则 | | --- | --- | | $Delta I = plus.minus 2, plus.minus 3$ | $Delta pi = +1$ | ], caption: [ $l = 2$ 的禁戒跃迁的选择定则 ], kind: table, ) ==== #b 衰变的选择定则 #figure( three-line-table[ |跃迁 |自旋选择定则 | 宇称选择定则 | | --- | --- | --- | | $l = 0$ | $Delta I = 0$ | $Delta pi = +1$ | | $l = 1$ | $Delta I = 0, plus.minus 1, plus.minus 2$ | $Delta pi = -1$ | | $l = 2$ | $Delta I = plus.minus 2, plus.minus 3$ | $Delta pi = +1$ | | ... | ... | ... | | $l = n$ | $Delta I = plus.minus n, plus.minus (n+1)$ | $Delta pi = (-1)^n$ | ], caption: [ #b 衰变的选择定则 ], kind: table, ) *跃迁概率*与*跃迁级次*有关,$l$越大,跃迁概率越小。 === #b 谱的形状和居里描绘(Kurie Plot) 单位时间内原子核发射一个动量在$p_beta$和$p_beta + dd(p_beta)$之间的 #b 粒子的概率为: $ I(p_beta) dd(p_beta) = (g^2 |M_(i f)|^2)/(2 pi^3 hbar^7 c^3) (E_0 - T_beta)^2 p_beta^2 dd(p_beta) $ 对允许跃迁,跃迁矩阵元近似等于原子核矩阵元,与轻子能量无关,对一定的跃迁可看成常数。 $ K = sqrt((g^2 |M_(i f)|^2)/(2 pi^3 hbar^7 c^3))\ $ $β$ 粒子的动量分布: $ I(p_beta) dd(p_beta) = K^2 (E_0 - T_beta)^2 p_beta^2 dd(p_beta) $ #figure( image("pic/2024-04-02-14-02-39.png", width: 80%), caption: [ $beta$ 粒子的动量分布 ], ) $β$ 粒子的能量分布: $ I(T_beta) = K^2/c^3 (T_beta^2 + 2T_beta m_0 c^2)^(1/2) (E_0 - T_beta)^2 (T_beta + m_0 c^2) dd(T_beta) $ #figure( image("pic/2024-04-02-14-05-29.png", width: 80%), caption: [ $beta$ 粒子的能量分布 ], ) *库伦改正因子*:核库伦场对发射电子的影响,使得实际的能谱与理论的能谱有所不同。 #figure( image("pic/2024-04-02-14-06-32.png", width: 80%), caption: [ 库伦改正因子 ], ) #figure( image("pic/2024-04-02-14-07-05.png", width: 80%), ) #figure( image("pic/2024-04-02-14-07-25.png", width: 70%), ) === 衰变常数和比较半衰期 单位时间内发射动量为 $p_beta$ 到 $p_beta + dd(p_beta)$ 之间的 $beta$ 粒子的概率为: $ I(p_beta) dd(p_beta) = K^2 F(Z,T_beta) (E_0 - T_beta)^2 p_beta^2 dd(p_beta) $ 对上式积分,就可以得到单位时间内发射所有 #b 粒子(对应衰变能$E_0$的分支衰变)的总概率。即 $β$ 衰变的分支衰变常数 $λ_i$ $<=>$ 该分支 $β$ 衰变的跃迁级次。 $ lambda_i = (ln 2) / T_"1/2"^i = integral_0^(p_beta_max) I(p_beta) dd(p_beta) = K^2 integral_0^(p_beta_max) F(Z,T_beta)(E_0 - T_beta)^2 p_beta^2 dd(p_beta) $ 引入*Fermi积分*: $ f(Z, E_0) = integral_0^(p_beta_max) F(Z,T_beta)((E_0 - T_beta)/(m_0 c^2))^2 (p_beta/(m_0 c))^2 dd(p_beta/(m_0 c)) $ 若已知库仑改正因子和 #b 粒子最大能量$E_0$,可数值积分求得*费米积分*。 $ lambda_i = (ln 2)/(T_"1/2"^i) = (g^2 |M_(i f)|^2 m_0^5 c^4)/(2 pi^3 hbar^7 c^3) f(Z, E_0) $ 当: $E_0 >> m_0 c^2$, 并取 $F ( Z, T_beta ) approx 1$ 时: $ f(Z, E_0) approx C E_0^5 $ 其中 $C$ 为常数。从而有*萨金特(Sargent)公式*: $ lambda_i = (ln 2)/(T_"1/2"^i) prop E_0^5 $ 说明:*#b 衰变的半衰期与 #b 粒子的最大能量之间存在较强的依赖关系*。同一级次的跃迁,由于衰变能的不同,$T_"1/2"$可以差别很大。仅由半衰期的大小,不能唯一确定跃迁级次。 引入*比较半衰期*: $ f T_"1/2" = f(Z, E_0) T_"1/2" = (2 pi^3 hbar^7 c^3)/(g^2 |M_(i f)|^2 m_0^5 c^4) approx 5000/(|M_(i f)|^2) $ 比较半衰期值和跃迁级次的关系如下表: #figure( three-line-table[ |Logft比较半衰期值$lg(f T_"1/2")$ | 跃迁级次 | | --- | --- | | 2.9 - 3.7| 超允许跃迁 | | 4/4 - 6.0| 允许跃迁 | | 6.0 - 10| 一级禁戒跃迁 | | 10 - 13| 二级禁戒跃迁 | | 15 - 18| 三级禁戒跃迁 | ], caption: [ 比较半衰期 ], kind: table, ) === #b 衰变有关的其他衰变方式(或反应) ==== 中微子吸收 是反应过程而不是衰变,可用于直接测量中微子。 ==== 双 #b 衰变 原子核自发地放出两个电子或两个正电子、或放出一个正电子又俘获一个轨道电子、 或俘获两个轨道电子的现象,称为双 #b 衰变。 两个偶偶核可能发生。双 #b 衰变的半衰期很长,难以观测。 ==== #b 延迟中子发射 $ ""^87_35 "Br" -> ""^(87*)_36 "Kr" + e^- + tilde(nu)_e\ ""^(87*)_36 "Kr" -> ""^86_36 "Kr" + n\ $ 典型的二次连续衰变,达到暂时平衡, 中子发射按照母核半衰期进行。 == #g 跃迁 #g 衰变:原子核从激发态通过发射* #g 光子或内转换电子*跃迁到较低能态的过程。该过程核电荷数不变、核子数、中子数都不变。 #g 跃迁的基本特点: - #g 跃迁包括:* #g 光子或内转换电子*两种方式; - #g 跃迁的能量范围:*几keV到十几MeV*; - #g 跃迁的半衰期:$10^(-6) - 10^(-4)"s"$; === #g 跃迁(发射 #g 光子) #g 跃迁:原子核通过发射 #g 光子从高能级到低能级的跃迁。(狭义的指发射 #g 光子的衰变过程) 衰变能: $ E_0 = E_i - E_f = E_R + h nu = h nu $ #figure( three-line-table[ | 静止质量 | 能量 | 动量 | 波长 | 自旋 | 内禀宇称 | 电荷 | | --- | --- | --- | --- | --- | --- | --- | | $0$ | $E_gamma = h nu$ | $p_gamma = (h nu)/c = h / lambda$ | $lambda = (h c) / (h v)$ | $S=1$玻色子 | $pi = -1$ | $0$ | ], caption: [ #g 光子的性质 ], ) === 内转换(Internal Conversion, IC) 内转换:原子核从激发态向较低能级跃迁时不放出 #g 光子,而是通过原子核的电磁场与壳层电子相互作用将核的激发能之差直接传递给某个壳层电子,使电子发射出来的现象。 - 内转换是核能级从高→低的跃迁过程。(不是原子的) - 内转换过程不产生 #g 光子,内转换过程不是发射光子的后续过程,而是竞争过程。 ==== 内转换电子的能量(动能) 内转换电子(Conversion Electron) 的动能为(IC过程的衰变能): $ T_e = E_i - E_f - epsilon_i approx E_gamma - epsilon_i $ 其中 $E_i$ 为原子核激发态能量,$E_f$ 为原子核基态能量,$epsilon_i$ 为电子的结合能。*内转换电子是分立能量*。 ==== 内转换的后续过程 内转换电子主要来自原子的*内电子层*。 - 当$E_0 > epsilon_K$时, 内转换主要发生在K壳层上; - 当$epsilon_K > E_0 > epsilon_L$时, 内转换主要发生在L壳层上… 内转换之后,原子内电子壳层出现空位,因此内转换总伴随着特征*X射线和俄歇电子发射*。 ==== 内转换系数(Internal Conversion coefficient) ——某γ跃迁的内转换与发射γ射线的几率比 内转换系数:内转换效应与发射光子是相互竞争的原子核退激过程,对应某 #g 跃迁,发生内转换的跃迁几率 $lambda_e$ 与发射 #g 光子的跃迁几率 #g 之比,称为内转换系数,用 #a 表示。 内转换系数 $alpha$ 定义为: $ alpha = lambda_e / lambda_gamma = N_e / N_gamma $ *重要物理量:可实验测量;也可理论计算。*便于实验和理论比较,从中获得有关原子核能级特性的重要知识。 该 #g 跃迁的总跃迁几率为: $ lambda = lambda_e + lambda_gamma = lambda_gamma(1 + alpha) $ #newpara() 可以按内转换电子原来所在的电子壳层定义相应的内转换系数: $ alpha_K = N_K_e / N_gamma\ alpha_L = N_L_e / N_gamma\ alpha_M = N_M_e / N_gamma\ ... $ 有: $ alpha = alpha_K + alpha_L + alpha_M + ... $ ==== 由衰变纲图得到内转换系数(Internal Conversion Coefficient) 但容易得到: $ alpha = lambda_e / lambda_gamma = N_e / N_gamma = (e %)/(gamma %) $ === #g 辐射的多极性及 #g 跃迁选择定则 ==== 经典电磁辐射的多极性 经典力学:带电体系作周期运动会产生电磁辐射。 - 电偶极子振动 → 电偶极辐射(Dipoles) - 电四极子振动 → 电四极辐射(Quadrupoles) - 电八极子振动 → 电八极辐射(Octupoles) 电多极辐射:电荷运动产生的辐射——奇宇称 - 磁偶极子振动 → 磁偶极辐射 - 磁四极子振动 → 磁四极辐射 - 磁八极子振动 → 磁八极辐射 磁多极辐射:电流变化产生的辐射——偶宇称 经典电磁辐射是指宏观的电荷电流体系所产生的电磁辐射,可用经典力学规则描述。多极辐射的能量和角动量都是振动频率的函数,对于宏观体系,频率可以取任意值,能量和角动量也可以取任意值。 ==== 原子核的多极辐射 原子核是一个电荷、电流的分布系统,处于激发态的核发射 #g 射线退激,类似于经典电荷电流分布变化而发射电磁波,由此产生的辐射也具有多极辐射的性质。 但原子核是一个微观体系,其运动规律与宏观体系的运动规律有质的不同。微观体系的特点之一是量子化,其能量和角动量只能取某些分立的值。另外,原子核的能态还有确定的宇称。 - *电多极辐射是由原子核内电荷密度变化引起的;* - *磁多极辐射则由电流密度和内在磁矩的变化所引起。* #g 辐射的多极性是指辐射的*电磁性质和极次*。 ==== #g 跃迁的选择定则 #g 跃迁是*电磁相互作用*, *角动量和宇称*均守恒。 光子带走的角动量量子数$L$的可取值为: $ |I_i - I_f|, |I_i - I_f| + 1, ..., I_i + I_f $ 根据跃迁理论及实验,$L$越大跃迁几率越小, 所以一般$L$取最小值(当$|I_i - I_f|= 0$时, 取1),即: $ L = |I_i - I_f| >= 1 $ 光子的自旋为1,跃迁中被光子带走的角动量不可能为零,至少为1。 #figure( three-line-table[ |光子带走的角动量$L$| #g 辐射的极次| | --- | --- | | 1 | 偶极辐射 | | 2 | 四极辐射 | | 3 | 八极辐射 | | ... | ... | |$L$ | $2^L$极辐射 | ], caption: [ 光子带走的角动量决定 #g 辐射的极次。 ], kind: table, ) 光子带走的宇称: $ pi_gamma = pi_i/pi_f $ 跃迁前后原子核宇称不变则为偶宇称;宇称不变则为奇宇称。 根据光子带走宇称和角动量的奇偶性,* #g 辐射分两类*: 1. *电多极辐射*——宇称的奇偶性和角动量的奇偶性相同 $ pi_gamma = (-1)^L $ 用EL表示,如偶极辐射(E1)、四极辐射(E2)等。 2. *磁多极辐射*——宇称的奇偶性和角动量的奇偶性不同 $ pi_gamma = (-1)^(L+1) $ 用ML表示,如偶极辐射(M1)、四极辐射(M2)等。 #figure( image("pic/2024-04-09-14-00-49.png", width: 80%), ) #figure( image("pic/2024-04-09-14-01-14.png", width: 80%), ) 根据量子力学的推导#g 跃迁概率公式,可以得到辐射的几率: $ lambda_M (L) tilde lambda_E (L+1) $ - 同一类型跃迁,高一极次概率比低一极次概率小约三个数量级 $ (lambda_M (L)) / (lambda_M (L+1)) tilde 10^3 ; (lambda_E (L)) / (lambda_E (L+1)) tilde 10^3 $ - 同一极次, 电多极辐射概率比磁多极辐射概率大2~ 3个数量级; $ (lambda_E (L)) / (lambda_M (L)) tilde 10^2 $ - 类型、极次相同,相邻能级能量差越小,跃迁概率越小。 可以得到选择定则: #figure( three-line-table[ |$Delta pi \\ Delta I $ | 0或1奇 | 2偶 | 3奇 | 4偶 | 5奇 | | ---- | ---- | ---- | ---- | ---- | ---- | | + 偶 | M1(E2) | E2 | M3(E4) | E4 | M5(E6) | | - 奇 | E1 | M2(E3) | E3 | M4(E5) | E5 | ], caption: [ #g 跃迁的选择定则 ], kind: table, ) ==== 内转换系数的应用 多极辐射的内转换系数公式: #figure( image("pic/2024-04-18-16-46-43.png", width: 80%), ) 内转换系数与$"E/M"、 Z、 E_gamma、 L$有关 - 内转换系数随$Z$增加而增加。 - 内转换系数随衰变能($E_gamma$)的增加而迅速降低。 - 内转换系数随跃迁极次($L$)的升高而迅速增大。 - 内转换系数随$n$(电子壳层)的增加而下降。规律为$1/n^3(n>1)$。 1. 比较内转换系数的实验值与理论值,可确定$γ$跃迁的多极性,得到跃迁前后核能级的自旋和宇称变化,判断核能级的自旋和宇称。 2. 用内转换系数对$γ$跃迁概率进行修正,实现$γ$跃迁概率的实验值与理论值的比较。 #figure( image("pic/2024-04-18-16-48-45.png", width: 80%), ) === 同质异能跃迁 同质异能素:寿命长于0.1s的激发态核素。 同质异能跃迁:同质异能素发生的 #g 跃迁(或内转换)。 同质异能态的角动量与基态或相邻较低激发态的角动量之差$Delta I$ 较大,能量之差一般比较小,因而 #g 跃迁概率比较小。 - 同质异能素的寿命较长; - 同质异能素的内转换系数较大。 === 穆斯堡尔效应Mössbauer Effect 穆斯堡尔效应的特点:能量分辨本领非常高$Gamma/E_0$。 = 原子核反应 *原子核反应(Nuclear Reaction):*原子核与原子核、或者原子核与其它粒子之间的相互作用所引起的各种变化。 *原子核衰变(Nuclear Decay):*不稳定核素在没有外界影响的情况下自发地发生核蜕变的过程。 == 核反应概述 核反应的一般表达式: $ a + A -> B + b_1 + b_2 + ... $ 或者用 $ A(a,b_1 b_2 ...)B $ 其中: - 反应前体系: - $A$ —— 靶核 (Target nucleus) - $a$ —— 入射粒子 (Incident particle) - 反应后体系: - $B$ —— 剩余核 (Residual nucleus) - $b_1$,$b_2$… —— 出射粒子 (Emitted particles) 二体反应和三体反应: - 二体反应:$a + A -> B + b$或$A(a,b)B$ 能量守恒和动量守恒决定了某方向出射粒子为分立能量。(当入射粒子取分立能量时) - 三体反应:$a + A -> B + b_1 + b_2$ 三体反应中,出射粒子的能量是连续的。 === 核反应分类 1. 按出射粒子分类:散射和反应 1. *散射(Scattering)*:出射粒子与入射粒子相同,即: $a = b$。这时,剩余核与靶核构成相同。 - 弹性散射(Elastic Scattering):散射前后系统总动能相等 $ a + A -> A + a , A(a,a)A $ - 非弹性散射(Inelastic Scattering):散射前后系统总动能不相等 $ a + A -> A + a' , A(a,a')A $ $a'$和$a$通常并无不同,用$a'$表示非弹性散射,有时不写靶核和剩余核,表示一类核反应,如$(n,n')$。 2. *反应(Reaction)*:出射粒子与入射粒子不同,即: $a != b$。这时,剩余核与靶核构成不同。 $b$为$γ$射线时,称为辐射俘获反应(Radiative capture reactions)。 2. 按入射粒子分类 + 中子反应——由中子入射引起的核反应 中子反应的特点:中子不带电,与核作用时,不存在库仑势垒,*能量很低的中子*就能引起核反应。 根据出射粒子的不同,中子反应有:$(n,n)$、$(n,n')$、$(n,gamma)$、$(n,p)$、$(n,alpha)$、$(n,2n)$等。 + 荷电粒子核反应——由带电粒子入射引起的核反应。 包括: - 质子引起的核反应: $(p,n),(p,γ),(p,α),(p,d),(p,p n),(p,2n)... $ - 氘核引起的核反应: $(d,n),(d, α),(d,p),(d,2n),(d,α n)... $ - $α$粒子引起的核反应: $( α,n),(α ,p),( α,d),(α,p n),(α,2n)... $ - 重离子引起的核反应 + 光核反应 (Nuclear photoeffect)——由$γ$光子入射引起的核反应。 3. 按入射粒子能量分类 + 低能核反应 低于140 MeV。 + 中高能核反应 在140 MeV~ 1 GeV之间。 + 高能核反应 高于1 GeV。 4. 靶核的质量数A分类 + 轻核反应 A < 30 + 中量核反应 30 < A < 90 + 重核反应 A > 90 === 反应道 反应道(反应的通道):对一定的入射粒子和靶核,能发生的核反应过程往往不止一种, 把每一种可能的反应过程称为一个反应道。 $ a + A &-> B + b_1 + b_2 + ...\ "入射道" &-> "出射道" $ 各反应道的产生几率不同: - 随入射粒子能量变化 - 与核反应机制、核结构有关 - 受守恒条件约束 === 核反应中的守恒定律 实验表明,核反应过程主要遵守以下几个守恒定律: + *电荷守恒* 反应前后的总电荷数不变。 $ Z_a + Z_A = Z_B + Z_b $ + *质量数守恒* 反应前后的总质量数不变。 $ A_a + A_A = A_B + A_b $ + *能量守恒* 反应前后体系的总能量(静止质量对应的能量和动能之和)不变。 $ (m_a + m_A)c^2 + T_a + T_A = (m_B + m_b)c^2 + T_B + T_b $ + *动量守恒* 反应前后体系的总动量不变。 $ arrow(p)_a + arrow(p)_A = arrow(p)_B + arrow(p)_b $ + *角动量守恒* 反应前后体系的总角动量不变。 $ arrow(J)_i = arrow(J)_f\ arrow(J)_i = arrow(L)_i + arrow(S)_a + arrow(S)_A\ arrow(J)_f = arrow(L)_f + arrow(S)_B + arrow(S)_b $ + *宇称守恒* 反应前后体系的宇称不变 $ pi_i = pi_f\ pi_i = pi_a pi_A (-1)^l_i\ pi_f = pi_B pi_b (-1)^l_f $ 一般来说,入射粒子的波为平面波,可分解为具有给定轨道角动量和轨道宇称的分波,角动量守恒和宇称守恒是对分波而言的。 == 核反应能和Q方程 === 核反应能Q 对核反应: $ a + A -> B + b $ 核反应能$Q$定义为:反应后的动能减去反应前的动能。 $ Q &= (T_b + T_B) - (T_a + T_A)\ &= (m_a + m_A - m_B - m_b)c^2\ &= (M_a + M_A)c^2 - (M_B + M_b)c^2\ &= (Delta_a + Delta_A) - (Delta_B + Delta_b)\ &= (B_b + B_B) - (B_a + B_A) $ - $Q>0$放能反应(Exoergic reactions) - $Q<0$吸能反应(Endoergic reactions) - $Q=0$弹性散射(Elastic Scattering) === Q方程 Q方程:核反应能$Q$与反应中有关粒子(入射、出射粒子)动能以及出射粒子角度之间关系的方程式。 可以根据实验测量的入射和出射粒子的动能以及出射粒子的角度,由Q方程求得核反应能$Q$。 - 实验测量核反应能 Q; - 实验测量剩余核的激发能; - 实验测量激发态剩余核的质量; - 计算不同出射角的出射粒子能量。 Q方程的推导: 动量守恒 + Q的定义 设靶核静止,根据动量守恒定律 $ P_B ^2 = P_a ^2 + P_b ^2 - 2 P_a P_b cos theta $ 在非相对论情况下: $ P^2 = 2m T $ 得到Q方程: $ 2 m_B T_B = 2 m_a T_a + 2 m_b T_b - 2 sqrt(4 m_a m_b T_a T_b) cos theta $ 化简得到 $ Q &= (1 + m_b/m_B) T_b - (1 + m_a/m_B) T_a - 2 sqrt(4 m_a m_b T_a T_b)/m_B cos theta\ &approx (1 + A_b/A_B) T_b- (1 + A_a/A_B) T_a - 2 sqrt(4 A_a A_b T_a T_b)/A_B cos theta $ 由Q方程:*在入射粒子动能$T_a$已知的情况下,只要测量$θ$角方向的出射粒子的动能$T_b$,就可以求得核反应能$Q$。* 如果$theta = 90degree$,则 $Q = (1 + A_b/A_B) T_b - (1 + A_a/A_B) T_a$ Q方程的本质反映了核反应能Q与出射粒子方向和出射粒子能量以及入射粒子能量之间的关系。可用于求出核反应能Q。 而核反应能Q等于反应前后系统的静止质量之差所对应的能量。 因此,Q方程可以用于求与静止质量有关的量、求不同角度出射粒子能量等。 + 可用于求核素的质量 已知$T_a$,测出$θ$方向的$T_b$,就可以求出$Q$。 $ Q = Delta m c^2 = (m_a + m_A - m_B - m_b) c^2\ m_B = m_a + m_A - m_b - Q/c^2 $ + 求剩余核的激发能 $ m_B^* = m_B + (E^*)/c^2 $ 可以得到 $ E^* = Q - Q' $ + 已知 Q 计算$θ$方向出射粒子能量 #figure( image("pic/2024-04-11-10-34-36.png", width: 80%), ) === 核反应阈能 对吸能核反应,$Q < 0$,此时,必须提供能量,核反应才能进行。入射粒子的动能$T_a$就是提供的能量。 核反应阈能:使*吸能核反应发生的最小入射粒子动能$T_a$*,以$T_"th"$表示。 + 选择合适的坐标系 实验室坐标系( L系 ) 和 质心坐标系( C系 ) #grid( columns: (1fr, 1fr), [ 在L和C中不同的量 - 位置 - 速度 - 动量 - 动能 - 角度 - 微分截面 ], [ 在L和C中相同的量 - 质量 - 时间 - 核反应能 - 数量 - 产额 - 截面 ] ) #figure( image("pic/2024-04-11-10-50-07.png", width: 80%), caption: [ 实验室坐标系( L系 ) 和 质心坐标系( C系 ) ], ) 据动量守恒定律,如果选择C系,则反应前后系统的动量均为零,则反应后系统的动能最小可以取零。 2. 计算核反应阈能 在质心坐标系(C系)中: $ Q = (T_b ' + T_B ' ) - T' < 0 => |Q| = T' - (T_b ' + T_B ' ) $ C系中,反应前后系统动量均为零,则反应产物在C系中不一定要有动能,最小可以取零: $ T_B ' + T_b ' = T' - |Q| >= 0 $ 在质心系,吸能核反应发生的(能量)必要条件是: $ T' >= |Q| $ 回到实验室坐标系(L系): $ T_"th" = (m_a + m_A)/m_A |Q| approx (A_a + A_A)/A_A |Q| (Q<0) $ === 出射角在 L 系 和 C 系 的转换 #figure( image("pic/2024-04-11-11-03-26.png", width: 80%), caption: [ 出射角在 L 系 和 C 系 的转换 ], ) 出射粒子在L系和C系中速度的关系: $ arrow(v)_b = arrow(v)_b ' + arrow(v)_C $ 得到 $ theta_C = theta_L + arcsin(gamma sin theta_L), gamma = v_C / (v_b ') $ 并且有 $ cos theta_L = (gamma + cos theta_C) / sqrt(1 + gamma^2 + 2 gamma cos theta_C) $ #newpara() 考虑 $ v_C = m_a / (m_a + m_A) v_a\ T' = 1/2 (m_a + m_A)/(m_a m_A) v_a^2\ => v_c^2 = (2 m_A )/(m_A (m_a+m_A)) T' $ 以及 $ Q = 1/2 m_b v'_b^2 + 1/2 m_B v'_B^2 - T'\ m_b v'_b = m_B v'_B\ => v'_b^2 = (2 m_B)/(m_b (m_b + m_B)) (T'+Q) $ 最终得到 $ gamma = v_c/v'_b = sqrt( (m_a m_b)/(m_A m_B) ((m_a + m_A)/(m_b + m_B) )T'/(T'+Q)) approx sqrt( (A_a A_b)/(A_A A_B) T'/(T'+Q)) $ #newpara() 在一般情况L系与C系的转换关系 1. $gamma < 1$,$v_c < v'_b$ - $theta_L = theta_C = 0$时,$v_b$最大 - $theta_L = theta_C = pi$时,$v_b$最小 - $v_b$随着$theta_L$增大而减小 - $γ$越小,出射粒子能量分布越平坦;$gamma→0$时,$v_b$几乎不随$θ_L$变化;$γ→1$时,出射粒子能量随角度下降最快;$theta_L$大角度时,$v_b$趋于零 #figure( image("pic/2024-04-11-11-23-15.png", width: 30%), ) 2. $gamma > 1$,$v_c > v'_b$ - 出现能量双值:一个$θ_L$对应两个$θ_C$值,两个$v_b$值; #figure( image("pic/2024-04-11-11-24-24.png", width: 40%), ) 圆锥效应:$theta_L <= theta_(L"max")$通过圆锥效应可以获得定向粒子束。 出现圆锥效应的条件:$γ > 1$ - 对放能反应 Q > 0:只有$A_a A_b>A_A A_B$时,才可能 γ > 1; - 对吸能反应 Q < 0当入射粒子能量刚刚超过阈能时,容易出现圆锥效应,但发生核反应的概率一般较小。 == 核反应截面和产额 当一定能量的粒子$a$入射到靶核$A$上,在满足各种守恒定律的条件下,有可能按一定的概率发生各种核反应。 用*核反应截面 (Nuclear reaction cross section)*来描述核反应发生的*概率*。 === 核反应截面 设:讨论对象为薄靶,即靶厚$x$足够小(粒子垂直入射通过靶时能量不变) - 单位体积靶核数为$N$, - 单位面积靶核数为$N_S$,$N_S = N x$ - 单位时间内入射粒子数为$I$(即入射粒子强度) 则:*单位时间内入射粒子与单位面积内的靶核发生的核反应数(即反应率)* $N'$ : $ N' prop I N_S = I N x $ 引入比例系数$σ$: $ N' = I N x σ $ 定义*核反应截面*: $ σ = (N') / (I N_S) = "单位时间发生的核反应数"/("单位时间入射粒子数"times"单位面积靶核数") $ 单位:$"cm"^2$,$"barn" = 10^(-24) "cm"^2$ 核反应截面的物理意义:一个入射粒子入射到单位面积内只含有一个靶核的靶上所发生核反应的概率。相当于一个靶核*在单位面积内占有的有效面积*,大小与入射粒子种类、能量和靶核种类等相关。 === 核反应截面相关的几个概念 + 分截面 (Partial cross section) 对应于每个反应道的截面为分截面$σ_i$,表示产生某种反应道的概率。 + 总截面 (Total cross section) 各分截面$σ_i$之和,为总截面$σ_t$,表示产生各种反应的总概率。 + 激发曲线 (Excitation curve) 截面随入射粒子能量的变化曲线。 #figure( image("pic/2024-04-16-13-50-23.png", width: 30%), caption: [ 激发曲线 ], ) === 微分截面(Differential cross section)和角分布(Angular distribution) 核反应的出射粒子可以向各个方向发射,实验发现各方向的出射粒子数不一定相同,表明*出射粒子飞向不同方向的核反应概率不一定相等*。 设:单位时间,$theta -> theta + dd(theta)$和$phi -> phi + dd(phi)$方向内的出射粒子数为$N(theta, phi) dd(Omega)$,则出射粒子数$dd(N')$ $ dd(N') = N' dd(Omega) = I N_S σ(theta, phi) dd(Omega) $ 定义*微分截面*: $ σ(theta, phi) = dd(N') / (I N_S dd(Omega)) = "单位立体角内发生的核反应数"/("单位时间入射粒子数"times"单位面积靶核数") $ 单位:$"b/sr"$,也记为$dd(sigma)/dd(Omega)$。 微分截面的物理意义:*一个入射粒子入射到单位面积内只含有一个靶核的靶上发生反应并出射粒子在$(θ,φ)$方向单位立体角内的概率*。 *分截面和微分截面的关系*: $sigma(theta, phi)$对$phi$各向同性,仅仅是对$theta$的函数,即$sigma(theta, phi) = sigma(theta)$。对某一反应道,其分截面$sigma_i$和微分截面$sigma(theta)$之间的关系: $ sigma_i = 2 pi integral_(0)^pi sigma(theta) sin theta dd(theta) $ #newpara() *角分布*:微分截面$σ (theta ) $随$θ$的变化曲线称为角分布,角分布可以实验测定。 #figure( image("pic/2024-04-19-01-13-28.png", width: 80%), caption: [ 角分布 ], ) === L 系 与 C 系 中微分截面的转换 #figure( image("pic/2024-04-16-14-03-08.png", width: 80%), ) $ sigma_L (theta_L) dd(Omega_L) = sigma_C (theta_C) dd(Omega_C) $ #figure( image("pic/2024-04-16-14-04-10.png", width: 80%), ) 得到公式 $ sigma_L (theta_L) = sigma_C (theta_C) (1 + gamma^2 + 2 gamma cos theta_C)^(3/2) / (1 + gamma cos theta_C) $ - 在$gamma < 1$时,一个$θ_L$对应一个$θ_C$,一个系数,一个$sigma_C$ - 在$gamma > 1$时,一个$θ_L$对应两个$θ_C$,两个系数,两个$sigma_C$ === 反应产额 (Yield of reaction) *核反应产额$Y$*: 入射粒子在靶中引起的核反应数与入射粒子数之比。 $ Y = N' / I_0 = "入射粒子在靶体上引起的核反应数"/"入射粒子数" $ 与: - 核反应截面$σ$有关 - 靶的厚度$x$有关 - 靶的组成有关 ==== 中子反应的产额 以单能窄束中子为例,设: - $sigma$为中子与靶核反应截面 - $N$为靶核数密度 - $I_0$为入射中子强度 - $D$为靶厚 则:在$x tilde x + dd(x)$内,单位时间内中子数的变化为: $ dd(I) = - sigma N I dd(x) $ 等于在该薄层靶内,单位时间发生的核反应数。解得: $ I = I_0 e^(- sigma N x)\ Sigma = sigma N $ $Σ$称为*宏观截面*或*线性衰减系数*,量纲为$[L]^(-1)$。 单能窄束中子通过厚度为$D$的靶时的强度为: $ I_D = I_0 e^(- Sigma D) $ 中子在厚度为$D$的靶内单位时间产生的反应数$N'$等于中子通过靶时的强度减少量,即: $ N' = I_0 - I_D = I_0 (1 - e^(- Sigma D)) $ 中子在厚度为$D$的靶内单位时间产生的反应数$N'$与入射中子数$I_0$之比即为*反应产额$Y$*: $ Y = N' / I_0 = 1 - e^(- Sigma D) $ - 薄靶:$Sigma D << 1$,$Y = sigma N D = sigma N_S$。产额与靶厚、 反应截面成正比。 - 厚靶:$Sigma D >> 1$,$Y = 1$。产额最大, 每个中子均发生反应。 - *透射率$T$*: 通过靶的中子束强度与入射中子束强度之比。 $ T = I_D / I_0 = e^(- Sigma D) $ 透射率在实验中可以直接测量,从而按上式可以求得反应截面$σ$。 这种方法测得的截面是中子总截面,是各种反应道(包括弹性散射)的分截面之和。 === 带电粒子反应的产额 带电粒子通过靶时,会与*靶核的核外电子发生作用(不是核反应)*,引起靶物质*原子电离或激发或产生辐射能量损失*而损失能量。带电粒子与介质相互作用而损失能量的主要方式。 一定初始能量的入射带电粒子通过靶的不同厚度时,其能量损失不同,即在不同靶深处的入射粒子的能量不同。 由于反应截面$σ(E)$是能量的函数,因而带电粒子在不同靶深处的反应截面是不同的。 令: - $I_0$为射到靶上的带电粒子强度; - $I$为靶深$x$处的带电粒子强度; - $N$为靶的单位体积的原子核数; 则在$x tilde x + dd(x)$内,单位时间的反应数为: $ dd(N') = - sigma(E) N I dd(x) $ 在厚度为$D$的靶内,单位时间内反应总数$N'$为: $ N' = integral_(0)^D sigma(E) N I dd(x) $ 则*反应产额*为: $ Y = N' / I_0 = 1 / I_0 integral_(0)^D sigma(E) N I dd(x) $ ==== 带电粒子核反应的薄靶产额 薄靶:带电粒子在靶中的能量损失远小于初始能量$E_0$。 - 薄靶中,$σ(E)$可视为常量,即$σ(E)=σ(E_0)$; - 发生核反应的带电粒子数远小于入射带电粒子数,即$I approx I_0$; - 发生核反应的靶核数远小于靶核总数,$N$为常数。 *薄靶的产额为:* $ Y = 1 / I_0 integral_(0)^D sigma(E) N I dd(x) = sigma(E_0) N D = sigma(E_0) N_S $ ==== 带电粒子核反应的厚靶产额 厚靶:靶厚大于带电粒子在靶中的射程$R(E_0)$。 - 发生核反应的带电粒子数远小于入射带电粒子数,即$I approx I_0$。厚靶中依然成立。 - 发生核反应的靶核数远小于靶核总数,$N$为常数。 *厚靶的产额为:* $ Y = N integral_(0)^D sigma(E) dd(x) = N D integral_(0)^(R(E_0)) sigma(E) dd(x) = N integral_(E_0)^0 sigma(E) dd(x)/dd(E) dd(E) $ == 核反应机制及核反应模型 核反应机制的问题属于核反应动力学问题。 === 核反应的三阶段描述及光学模型 ==== 核反应的三阶段描述 1957年,韦斯科夫提出了对核反应过程的三阶段描述,概括而形象的描述了核反应过程。 根据反应的时间顺序,将反应分为三个阶段: + 独立粒子阶段 (Independent-Particle Stage) + 复合系统阶段 (Compound-System Stage) + 最后阶段 (Final Stage) #figure( image("pic/2024-04-19-01-36-23.png", width: 80%), caption: [ 核反应的三阶段描述 ], ) ==== 各种反应截面之间的关系 + 第一阶段(独立粒子阶段): $ sigma_t = sigma_"pot" + sigma_a $ 总截面 = 形状弹性散射截面 + 吸收截面 #figure( image("pic/2024-04-19-01-38-32.png", width: 30%), ) + 第二阶段(复合系统阶段): $ sigma_a = sigma_D + sigma_"CN" $ 吸收截面 = 直接作用截面 + 复合核截面 #figure( image("pic/2024-04-19-01-39-00.png", width: 30%), ) $ sigma_"SC" = sigma_"pot" + sigma_"res" $ 弹性散射截面 = 形状弹性散射截面 + 复合弹性散射截面 #figure( image("pic/2024-04-19-01-40-36.png", width: 30%), ) 综合考虑三阶段,可将:*总反应截面$sigma_t$分为弹性散射截面$sigma_"SC"$和去弹性散射截面$sigma_r$两部分*。 $ sigma_t = sigma_"SC" + sigma_r\ sigma_"SC" = sigma_"pot" + sigma_"res"\ sigma_t = sigma_"pot" + sigma_"res" + sigma_r = sigma_"pot" + sigma_a $ 用图像表示: #figure( image("pic/2024-04-19-01-44-17.png", width: 80%), caption: [ 各种反应截面之间的关系 ], ) ==== 核反应的光学模型 光学模型:把粒子投射到靶核上类比为光线射在半透明的玻璃球上,一部分被*吸收*,相当于粒子进入靶核,发生核反应;另一部分被折射或反射,相当于粒子*被靶核弹性散射*。 光学模型成功的描述了核反应的第一阶段。 光学模型在解释*中子反应总截面随靶核质量数$A$和入射中子能量的变化趋势*上获得成功。后来又成功解释了中子与质子在一些核上弹性散射的*角分布*,理论计算与实验结果符合的相当好。 === 复合核模型(玻尔,1936) ==== 复合核模型的基本假设 *复合核模型*:在核反应中,入射粒子被靶核吸收,形成中间状态原子核——*复合核(Compound Nucleus)*,然后复合核衰变,发射出射粒子,形成剩余核。 复合核模型将核反应过程分为相互独立的两个阶段: + *复合核形成*,即入射粒子被靶核吸收,形成一个处于激发态的复合核$C^*$ + *复合核衰变*,即复合核发射出射粒子,形成剩余核 用核反应式可表示为: $ a + A -> C^* -> B + b $ 其中: $ a + A -> C^* $ 是形成过程,复合核形成截面为$sigma_"CN" (T_a)$ $ C^* -> B + b $ 是衰变过程,发射b衰变的分支比为$W_b (E^*)$。 两个过程互相独立,即: $ sigma_(a b) = sigma_"CN" (T_a) W_b (E^*) $ 其中$sigma_(a b)$为$a + A -> B + b$的反应截面。 合核模型的基本思路与液滴模型相同,把原子核比作液滴。 + 复合核的形成:液滴加热 入射粒子进入靶核后,与周围核子强烈作用,经多次碰撞,能量在核子间传递,最后达到动态平衡,完成复合核的形成。 + 复合核的衰变:液滴蒸发 复合核形成后,并不会立刻衰变。使一个核子(或核子团)具有足够的能量脱离复合核而衰变,需要经过$10^(-14) - 10^(-18)s$。 通过发射粒子而退激的过程叫粒子蒸发。蒸发粒子后的剩余核激发能降低,可类比为液滴蒸发出液体分子后温度降低。 ==== 复合核的形成及复合核的激发能 形成的复合核处于激发态: $ a + A -> C^* $ 由C系能量守恒定律: $ T' + (m_a + m_A) c^2 = (m_C^*) c^2 = (m_C + (E^*)/c^2) c^2 $ 得到: $ E^* &= T' + (m_a + m_A - m_C) c^2\ &= T' + B_(a A) $ 其中: $ T' = A_A/(A_a + A_A) T_a\ B_(a A) = (m_a + m_A - m_C) c^2 = Delta_a + Delta_A - Delta_C $ 复合核$C^*$的*激发能为入射粒子的相对运动动能(即质心系中的总动能)和入射粒子与靶核的结合能$B_(a A)$之和*。 ==== 复合核的衰变 合核的衰变方式一般不止一种,通常可以蒸发中子,质子、 $α$粒子或发射$γ$光子等。各种衰变方式各具有一定的概率,而概率与复合核形成方式无关,仅仅取*决于复合核本身的性质(能量状态)*。 *这就是所谓的“记忆消失”。* 对于形成同样复合核(构成和能量状态一致)的不同入射道。反应的出射道都可以有多个,而且对不同入射道,各出射道(入射道必然是出射道之一)的情况(出射道的种类和各自的概率)是一样的。 ==== 复合核形成与衰变相互独立的证明 根据复合核模型得到的$(a,b)$反应的截面公式: $ sigma_(a b) = sigma_"CN" (T_a) W_b (E^*) $ 入射道为$a+A$的几个反应道的截面为: $ sigma_(a b) = sigma_"CN" (T_a) W_b (E^*)\ sigma_(a b') = sigma_"CN" (T_a) W_b' (E^*)\ sigma_(a b'') = sigma_"CN" (T_a) W_b'' (E^*)\ $ 有 $ sigma_(a b) : sigma_(a b') : sigma_(a b'') = W_b : W_b' : W_b'' $ 对于$a'+A'$入射道,同理可得: $ sigma_(a' b) : sigma_(a' b') : sigma_(a' b'') = W_b : W_b' : W_b'' $ 基于复合核形成及衰变两阶段独立性的假设,当不同入射道形成相同的复合核时(构成和能量状态相同) ,有: $ sigma_(a b) : sigma_(a b') : sigma_(a b'') = sigma_(a' b) : sigma_(a' b') : sigma_(a' b'') $ 实验验证上式成立, 则可以证明复合核形成及衰变两阶段独立性假设是正确的。果歇(Ghoshal)通过实验验证了假设。 ==== 复合核激发能级的能级宽度 设:复合核单位时间内以过程$i$衰变的概率为 $ W_i (E^*) = lambda_i $ 则,复合核单位时间内的总衰变概率为: $ W (E^*) = sum_(i) lambda_i = lambda $ 复合核的寿命为: $ tau = 1 / lambda = 1 / (W (E^*)) $ 复合核的激发能级都有一定的宽度 $Γ$,由不确定关系: $ Gamma tau = hbar $ 得到: $ Gamma = hbar / tau = hbar W (E^*) = hbar sum_(i) lambda_i = sum_i Gamma_i $ *复合核某一激发态能级的总宽度是该能级各分宽度之和。* ==== 共振现象和单能级共振公式 测量激发曲线$σ(E)$时发现,当入射粒子能量为某些特定值时,核反应截面突然变大,即发生共振。相应的入射粒子能量称为*共振能量*。 合核激发能等于入射粒子的相对运动动能与它与靶核之间的结合能之和。实验测得共振能量,即可求得相应的复合核激发能$E^*$。 *布莱特和维格纳公式(B-W公式):*考虑复合核的形成和衰变几率,理论推导出的表示单个共振能级附近的核反应截面与入射粒子能量的关系式,可定量描述共振现象。 $ sigma_(a b) = lambda^2/(4 pi) (Gamma_a Gamma_b) / ((T' - E_0)^2 + (Gamma/2)^2) $ 其中$E_0$是共振能量。 + 当$T' = E_0$时,发生*共振吸收*,核反应截面最大: $ sigma_(a b) = lambda^2/( pi) (Gamma_a Gamma_b) / (Gamma^2) $ 通常 $Γ$ 不是很大,则在 $Γ$ 能量范围内,$λ, Γ_a ,Γ_b$ 近似不变。 当$T' = E_0 plus.minus Gamma/2$时,核反应截面减小到原来的一半。 $ sigma_(a b) = sigma_0 /2 $ 所以:共振曲线的半高宽就等于能级宽度 $Γ$。测量共振能量附近的激发曲线,可得共振能量及激发曲线的半高宽。 #figure( image("pic/2024-04-19-02-09-06.png", width: 80%), ) + *$(n, γ)$反应的$1/ v$规律* - 对于$(n, γ)$反应,理论上可以证明:复合核*发射中子的概率*即相应的*能级分宽度$Γ_n$*正比于入射中子的*速度$v$*。 $ Gamma_n prop v $ - 当中子能量较低时,其波长$λ$反比于中子的速度$v$。 $ lambda = h / p = h / (m_n v) prop 1 / v $ - $(n, γ)$反应主要发生在慢中子区$(T_n ≤ 1"keV")$,中子的能量比它和靶核的结合能小得多。 $ T_n << B_(n A) $ 根据:$E^* = T'_n + B_(n A)$,有$T'_n$变化不会引起$E^*(Gamma_gamma)$和能级宽度$Γ$的显著变化。 由B-W公式,当 $T_n << E_0$ 时: $ sigma_(n gamma) = lambda^2/(4 pi) (Gamma_n Gamma_gamma) / ((T_n - E_0)^2 + (Gamma/2)^2) prop lambda^2 Gamma_n prop 1 / v $ *当入射中子为慢中子时,$(n, γ)$反应的截面$sigma_(n gamma)$与中子的速度$v$成反比。* $ sigma_(n gamma) prop 1 / v $ 已知某速度(或能量)下的截面,求其他截面: $ sigma = sigma_0 v_0/v = sigma_0 sqrt(T_0/T) $ === 连续区理论和直接反应 ==== 连续区理论 *共振区*:当入射粒子能量不太高,激发曲线出现共振峰,共振出现的能量范围为共振区。 *连续区*: 当入射粒子能量比较高$(1~30"MeV")$时,复合核处于较高的激发态,能级宽度加大,能级间距缩小,导致能级重叠,形成连续区。连续区激发曲线平滑变化。用黑核模型描述。认为在这个能区内,不管入射粒子具有什么样的能量,都能被靶核强烈吸收,类似于光学中的黑体,故称为黑核模型。 ==== 直接反应 核反应通过入射粒子与靶核中少数核子直接相互作用而完成,入射粒子与靶核中一个或几个核子相碰撞,交换能量,不形成复合核而立刻发射一个或几个核子,这种过程称为直接反应。 直接反应可分两类: + 削裂反应[如$(d,n)$]和拾取反应[如$(n,d)$] + 撞击反应 #pagebreak() = 射线与物质的相互作用 == 概论 === 射线 射线:指的是如$X\/γ$射线、$α$射线、$β$射线、中子等,本质都是辐射粒子。 射线与物质相互作用是辐射探测的物理基础,也是人类认识微观世界的基本手段。 本课程讨论对象为致*电离辐射(Ionizing Radiation)*,辐射能量大于10eV量级(中子除外,因为中子核反应产生的次级带电粒子的能量可以达到几个MeV),即可使探测介质的原子发生电离的最低能量。 === 射线与物质相互作用的分类 #figure( three-line-table[ | 带电粒子辐射 Charged Particulate Radiations | 非带电辐射 Uncharged Radiation| | --- | --- | | 重带电粒子 Heavy charged particles $alpha, p, d, T ,f$ | 中子 Neutron | | 快电子 Fast electrons $e^plus.minus, beta^plus.minus$| $X\/γ$射线 $X\/γ$-rays | | 射程 $10^(-5)m , 10^(-3)m$ | 射程 $10^(-1)m , 10^(-1)m$ | |直接致电离辐射 | 间接致电离辐射 | ], caption: [ 射线与物质相互作用的分类 ], kind: table, ) 与探测器输出信号相关的是带电粒子与物质的相互作用,即带电粒子辐射。 带电粒子分为:重带电粒子和快电子。 === 弹性碰撞与非弹性碰撞 $ 1/2 m_1 v_1^2 + 1/2 m_2 v_2^2 = 1/2 m_1 v_1'^2 + 1/2 m_2 v_2'^2 + Delta E $ 其中$Delta E$为内能项。 - 弹性碰撞(即动能守恒):$Delta E = 0$ - 非弹性碰撞:$Delta E != 0$ - 第一类非弹性碰撞:如入射粒子与基态原子碰撞,使其激发或电离$Delta E > 0$ - 第二类非弹性碰撞:如入射粒子与激发态原子碰撞,使其退激$Delta E > 0$ === 带电粒子在靶物质中的慢化 慢化:带电粒子通过所带电荷与原子中轨道电子、原子核发生库仑相互作用(碰撞),在相互作用过程中逐渐*损失能量而减慢速度*。 碰撞特点:多次、随机、不断发生,每次带电粒子只损失很小比例的能量。 带电粒子在物质中的四种慢化过程: + *电离损失*-带电粒子与靶物质原子中*轨道电子的非弹性碰撞*。【主要】 带电粒子与靶原子的轨道电子通过*库仑作用*,使电子获得能量而*引起原子的电离或激发*。 #figure( image("pic/2024-04-18-11-10-11.png", width: 80%), caption: [ 电离或者激发 ], ) #figure( image("pic/2024-04-18-11-11-07.png", width: 80%), caption: [ 电离损失 ], ) 带电粒子穿过一定厚度介质时,通过电离能量损失会产生多次电离与激发,产生很多个*电子-离子/电子-空穴对或退激光子*。 - 多个电子-离子/电子-空穴对的定向漂移会形成可测信号$->$气体探测器、半导体探测器 - 多个退激光子转换为电子后,在电场中漂移也可形成信号$->$闪烁体探测器 + *辐射损失*-带电粒子与*靶原子核的非弹性碰撞*。【主要】 *轫致辐射*:带电粒子与靶原子核的非弹性碰撞,使*原子核激发*,激发态原子核退激时发射$γ$射线,带走能量。 带电粒子与原子核之间的库仑力作用,使入射带电粒子的速度和方向发生变化,伴随着发射电磁辐射——轫致辐射(Bremsstrahlung)。 辐射损失:入射带电粒子与原子核发生非弹性碰撞,以*辐射光子*的形式损失其能量的过程。 $β$粒子与物质相互作用时,辐射损失是其重要的一种能量损失方式。 + *核碰撞损失*-带电粒子与*靶原子核的弹性碰撞*。【次要】 核碰撞损失:带电粒子与靶原子核发生*弹性碰撞*而引起的能量损失过程。 核阻止:原子核通过弹性碰撞对入射粒子的阻止作用。 带电粒子与靶原子核的库仑场作用而发生弹性碰撞。碰撞过程中,总动能不变,既不辐射光子,也不激发原子核。为满足能量和动量守恒,入射粒子损失很少一部分能量使核反冲。碰撞后,绝*大部分能量仍由入射粒子带走*,但运动*方向被偏转*。 核碰撞能量损失只是在*入射带电粒子能量很低或低速重离子入射*时,对粒子能量损失的贡献才是重要的。但对电子却是引起反散射的主要过程。 + 带电粒子与轨道电子的弹性碰撞。【次要】 受轨道电子的库仑力作用,入射粒子改变运动方向。为满足能量和动量守恒,入射粒子要损失一点能量,但这种能量的转移*很小*,比原子中电子的最低激发能还小,原子的能量状态没有变化。实际上,这是入射粒子与整个靶原子的相互作用。 这种相互作用方式只在极低能量(100eV)的$β$粒子时方需考虑,其它情况下*完全可以忽略*掉。 == 重带电粒子与物质的相互作用 Interaction of Heavy Charged Particles === 重带电粒子与物质相互作用的特点 (Rate of Energy Loss) - 重带电粒子均为带*正电荷*的离子; - 重带电粒子主要通过*电离损失*而损失能量,同时使介质原子*电离或激发*; - 重带电粒子在介质中的*运动径迹近似为直线*。 === 重带电粒子在物质中的能量损失规律 *能量损失率*:带电粒子在物质中*单位路径*上的*能量损失*。又称*比能损失(Specific Energy Loss)*或*阻止本领(Linear Stopping Power)*。 $ S = - dd(E) / dd(x) $ 量纲: [能量/长度] 如: MeV/cm、 eV/cm 按能量损失方式的不同,能量损失率主要分为“*电离能量损失率*”和“*辐射能量损失率*”。 $ S = S_"ion" + S_"rad" = (- dd(E) / dd(x))_"ion" + (- dd(E) / dd(x))_"rad" $ 对重带电粒子(百MeV以下) : $ S_"ion" >> S_"rad" $ 因此:*重带电粒子的能量损失率就约等于其电离能量损失率*。 $ S approx A_"ion" = (- dd(E) / dd(x))_"ion" $ ==== Bethe 公式(Bethe formula) Bethe公式:描写*电离能量损失率*$S_"ion"$与*带电粒子速度*$v$、*电荷*$z$以及*作用物质属性*$(N ,Z,I )$等关系的经典公式。其中$N$为原子数密度,$Z$为原子序数,$I$为平均激发能。 Bethe公式的简化推导:简化为*重带电粒子和电子的库仑相互作用*。电子*自由、静止*,带电粒子*运动状态和电荷状态不变*;详细地: + 物质原子的电子可看成是自由的。(入射带电粒子传给电子的动能大于电子的结合能) + 物质原子的电子可看成是静止的。(入射带电粒子的速度远大于轨道电子的运动速度) + 碰撞后入射带电粒子运动方向和速度不变。(碰撞中入射带电粒子传给电子的能量比其自身能量小得多,入射带电粒子运动方向和速度几乎不变) + 入射带电粒子的电荷状态是确定的。 *重带电粒子与单个电子的碰撞情况* #figure( image("pic/2024-04-23-13-48-54.png", width: 80%), numbering: none ) #figure( image("pic/2024-04-23-13-51-07.png", width: 80%), numbering: none ) #figure( image("pic/2024-04-23-13-51-42.png", width: 80%), numbering: none ) 最终得到,碰撞参量为$b$时,碰撞中单个电子所得动量为: $ P = 1/(4 pi epsilon) (2 e^2 z)/(b v) $ 碰撞中单个电子所得能量为: $ Delta E_b = P^2 /(2 m_0) = (1/(4 pi epsilon))^2 (2 e^2 z)^2 / (m_0 b^2 v^2) $ #newpara() *$dd(x)$距离内,碰撞参量为$b$的电子获得的总能量* 设:作用物质单位体积的原子数为$N$, 原子序数为$Z$,则作用物质单位体积的电子数为$N Z$。 #figure( image("pic/2024-05-11-22-10-41.png", width: 80%), numbering: none ) *在$dd(x)$距离内,作用物质中所有电子得到的总能量(即:入射粒子在$dd(x)$距离内损失的能量)* #figure( image("pic/2024-05-11-22-15-34.png", width: 80%), numbering: none ) 1. $b_min$对应电子获得*最大能量*,按经典碰撞理论,*对心碰*撞时,电子获得最大动能,约为$2m_0 v^2$。 ($m_0$为电子的静止质量,$v$为入射带电粒子的速度。) #figure( image("pic/2024-05-11-22-18-35.png", width: 80%), numbering: none ) 2. $b_max$对应电子获得最小能量,可由电子在原子中的*结合能*来考虑。对电离能量损失,电子只能从入射粒子处接受*大于原子平均激发能$I$的能量*(否则就不是电离能量损失)。 #figure( image("pic/2024-05-11-22-20-23.png", width: 80%), numbering: none ) #figure( image("pic/2024-05-11-22-20-58.png", width: 80%), numbering: none ) #figure( image("pic/2024-05-11-22-21-48.png", width: 80%), numbering: none ) 电离能量损失率与*入射粒子性质*及*靶物质属性*有关: - 入射粒子 - 电荷数$z$ - 速度$v$ - 靶物质 - 原子序数$Z$ - 单位体积内原子数$N$ - 平均激发和电离能$I$ ==== 关于Bethe公式的讨论 1. $S_"ion"$与入射*带电粒子*的*质量*$m$*无显性的关系*,只出现带电粒子的*速度*$v$和*电荷数*$z$。 $ S_"ion" prop z^2 / v^2 prop (z^2 m)/E $ - 与带电粒子的电荷数$z$的平方成正比 - 与带电粒子的速度$v$的平方成反比 - 与带电粒子的质量$m$近似成正比 - 与带电粒子的动能$E$近似成反比 2. $S_"ion" prop N Z$*靶物质*的密度越大,原子序数越高,阻止本领越大。 $ S_"ion" prop z^2 / v^2 N Z prop (z^2 m)/E N Z $ 3. $S_"ion"$与$v^2$(动能)的关系 #figure( image("pic/2024-05-12-00-52-37.png", width: 80%), caption: [ 电离能量损失率与入射粒子动能的关系 ], ) 一些粒子在物质中的比能损失与其能量的关系。 比能损失除以密度:单位质量厚度的能量损失 $ (-dd(E) / dd(x))_"ion" 1/ rho $ #figure( image("pic/2024-05-12-00-59-47.png", width: 80%), caption: [ 比能损失与密度的关系 ], ) ==== Bragg曲线与能量歧离 Bragg曲线:带电粒子的能量损失率沿其径迹的变化曲线。 #figure( image("pic/2024-05-12-00-54-31.png", width: 80%), caption: [ Bragg曲线 ], ) 能量歧离(Energy Straggling):单能粒子束穿过一定厚度的物质后,不再是单能的, 而是发生了能量的离散。 能量歧离是由微观上能量损失是一个随机过程所决定的。 #figure( image("pic/2024-05-12-00-55-11.png", width: 80%), caption: [ 能量歧离 ], ) === 重带电粒子在物质中的射程 ==== 重带电粒子径迹的特征 - 基本是直线 - 质子、$α$径迹粗细不同(前者更细) - 有分叉 - 能量高,径迹细 *比电离(specific Ionization)*: 带电粒子穿透单位厚度介质产生的平均离子对数。 *$δ$射线*:电离产生的高能电子。 (带电粒子穿透介质时,若电离产生的电子具有足够的能量可引起介质进一步电离,则称电子为$δ$射线。) ==== 射程(Range) *射程*:带电粒子*沿入射方向*在物质中*行径的最大距离*,称为带电粒子在该物质中的射程$R$。 *路程*:带电粒子在物质中行径的实际轨迹的长度称作路程(Path)。 路程是要大于射程的,因为带电粒子在物质中的运动是曲线的,而射程是带电粒子在物质中的直线距离。 重带电粒子的质量大,与物质原子相互作用时,其运动方向几乎不变。因此,*重带电粒子的射程与路程相近*。 *若已知能量损失率,从原理上可以求出射程:* #figure( image("pic/2024-05-12-16-06-33.png", width: 80%), numbering: none ) #figure( image("pic/2024-05-12-16-12-02.png", width: 80%), numbering: none ) #figure( image("pic/2024-05-12-16-27-38.png", width: 80%), numbering: none ) #figure( image("pic/2024-05-12-16-28-38.png", width: 80%), numbering: none ) 几点讨论: 1. 同种粒子以*相同速度*,入射到*不同物质中*,如果物质的$Z$比较接近: $ R prop A/(rho Z) , R rho prop A/Z tilde "相近" $ 2. 不同粒子以*相同速度*,入射到*同一物质中*: $ R prop m / z^2 $ *射程的实验测量和强度衰减曲线:* #figure( image("pic/2024-05-12-16-47-03.png", width: 80%), caption: [ 射程的实验测量和强度衰减曲线 ], ) 入射粒子能量越高,其射程越长。在某种物质中,重带电粒子的射程与粒子能量之间存在着确定的关系,常以曲线的形式给出。重带电粒子的平均射程和外推射程的差别不大。 空气中, α粒子的射程能量关系曲线 $ R_a = 0.318 E_alpha^(3/2) $\ 其中$E_α$为$α$粒子能量,单位为MeV。公式适用范围:$3 ~8$MeV。由$alpha$粒子的情况可以推出其他重带电粒子的射程能量关系。 ==== 射程歧离 微观上带电粒子与物质相互作用损失能量是一个随机过程 (引起电离或激发的次数以及每次损失的能量是随机的,但损失能量是必然的),因此单能粒子束中各粒子的射程是涨落的,称为*射程歧离*。 #figure( image("pic/2024-04-25-10-29-31.png", width: 80%), caption: [ 射程歧离 ], ) ==== 相同能量的同一种粒子在不同物质中的射程关系 *电离阻止截面*:带电粒子穿过单位面积只有一个原子(或分子)的物质时损失。 $ 1/N (- dd(E) / dd(x)) $ 其中 $ N dd(x) = N_S $ 是单位面积的原子数。单位是$e"V"·"cm"^2$。 根据*电离阻止截面*的定义: - 分子的电离阻止截面:带电粒子穿过单位面积只有一个分子的物质时损失的能量 $ 1/N_c (- dd(E) / dd(x))_c $ - 原子的电离阻止截面:带电粒子穿过单位面积只有一个原子的物质时损失的能量 $ 1/N_i (- dd(E) / dd(x))_i $ - 多个原子的电离阻止截面:带电粒子穿过单位面积有$n_i$个原子的物质时损失的能量 $ n_i 1/N_i (- dd(E) / dd(x))_i $ 假设: 1. 不同原子的电离阻止截面可相加。分子的电离阻止截面等于组成分子的各原子的电离阻止截面之和。 2. 在物质中,单位面积有一个分子与单位面积有组成该分子的各原子等价。 *Bragg-Kleeman Rule:* $ 1/N_c (- dd(E) / dd(x))_c = sum_i n_i 1/N_i (- dd(E) / dd(x))_i $ 其中$n_i$为分子中第$i$种原子的个数,$N_i$为原子数密度。 化合物和单质中的比能损失关系 $ (- 1/ rho dd(E) / dd(x))_c = sum_i omega_i (- 1/ rho_i dd(E) / dd(x))_i $ 其中$omega_i= (n_i A_i)/M$为分子中第$i$种原子的质量分数,$rho_i$为第$i$种原子的密度。 化合物和单质中的射程关系 $ R_c = M_c / (sum_i n_i A_i/R_i) $ 其中$R_c$是以质量厚度为单位的射程,$M_c$为化合物的摩尔质量,$R_i$为第$i$种原子的射程。 *半经验公式:同一种粒子在不同吸收物质中的射程关系。定比定律:* $ (R_i rho_i)/(R_0 rho_0) = sqrt(A_i / A_0) $ 对于化合物或混合物的等效原子量$A_"eff"$: $ sqrt(A_"eff") = sum_i W_i sqrt(A_i) $ 其中$W_i$为第$i$元素的原子百分数。利用该等效质量,也可以计算在混合物中各元素的射程。 *总结* - 同种粒子在$Z$相近的物质中的射程关系: $ R rho = A /Z tilde "相近" $ - 同种粒子在$Z$不相近的物质中的射程关系: $ (R rho )/sqrt(A) tilde "相近" $ ==== 同一吸收物质中,初速度相同的不同重带电粒子的射程关系 $ R(v) = m/z^2 F(v) $ 其中$m,z$是入射粒子的质量和电荷数,$v$是入射粒子的速度,$F(v)$是与速度有关的函数,对于不同的粒子,$F(v)$相同。 $ R_a (v) = (m_a z^2_b)/(m_b z^2_a) R_b (v) $ ==== 阻止时间 *阻止时间*:将带电粒子阻止在吸收体内所需的时间。(速度减慢为零所需要的时间) $ t = R / macron(v) = R / (k v) = R / (k c) sqrt((m c^2)/(2E)) $ 如果$k = 0.6$则有: $ t = 1.2 times 10^(-7) R sqrt(m/E) $ 其中单位取$m,u$和$M e V$。 === 重带电粒子在薄吸收体中的能量损失 带电粒子在薄吸收体中的能量损失可计算为: $ Delta E = (- dd(E) / dd(x))_"avg" d $ === 裂变碎片的能量损失 *裂变碎片*是核裂变产生的,具有很大质量、很多电荷及相当高能量的重带电粒子。 #figure( image("pic/2024-05-12-17-47-17.png", width: 80%), numbering: none ) == 快电子与物质的相互作用 Interaction of Fast Electrons === 快电子与物质相互作用的特点 - 快电子的速度大; 重带电粒子相对速度小; - 快电子除电离损失外, 辐射损失不可忽略; 重带电粒子主要通过电离损失而损失能量; - 快电子散射严重,径迹曲折。 重带电粒子在介质中的运动径迹近似为直线。 #figure( image("pic/2024-05-13-00-04-34.png", width: 80%), numbering: none ) === 快电子的能量损失率 *快电子*(特点是快—MeV速度接近光速),必须考虑相对论效应的电离能量损失和辐射能量损失。 *电离能量*损失率: #figure( image("pic/2024-05-12-17-51-02.png", width: 80%), numbering: none ) #figure( image("pic/2024-05-12-17-52-00.png", width: 80%), caption: [ 重带电粒子与电子的电离能量损失率比较 ], ) #figure( image("pic/2024-05-12-17-56-19.png", width: 80%), caption: [ MIP ], ) $ S_"ion" = (- dd(E) / dd(x))_"ion" prop z^2 / v^2 N Z prop (z^2 m)/E N Z $ *辐射能量*损失率:单位路径上,由于轫致辐射而损失的能量。 量子电动力学计算表明,辐射能量损失率服从: $ S_"rad" = (- dd(E) / dd(x))_"rad" prop (z^2 E)/ m^2 N Z^2 $ 其中参量是吸收物质的原子序数$Z$和单位体积的原子数$N$、入射电子的电荷数$z$和能量$E$、电子的静止质量$m$。 当要探测、吸收、屏蔽电子时,不宜选用重材料。当要获得强的X射线时,则应选用重材料作靶。 #figure( three-line-table[ | 辐射能量损失$S_"rad" prop (z^2 E)/ m^2 N Z^2$ | 电离能量损失$S_"ion" prop (z^2 m)/E N Z prop z^2 / v^2 N Z$ | | --- | --- | | $prop z^2$ | $prop z^2$ | | $prop 1/m^2$ | $prop m$ | | $prop E$ | $prop 1/E$ | | $prop N^2$ | $prop N$ | ], caption: [ 快电子的辐射能量损失和电离能量损失 ], kind: table ) #figure( image("pic/2024-05-12-18-04-36.png", width: 80%), numbering: none ) 探测学中所涉及快电子的能量$E$一般不超过十几个MeV,所以,*辐射能量损失只在高原子序数(大 Z)*的吸收材料中才可能*大于电离能量损失*,但电子的测量和屏蔽均要考虑到辐射能量损失的存在,实际应用中应尽量*减少辐射能量损失*。 === 快电子的吸收与射程 快电子的运动径迹是*曲折*的。 #figure( image("pic/2024-05-12-21-35-29.png", width: 80%), caption: [ 快电子的径迹 ], ) 通常,*快电子的射程比路程小得多*。 ==== 单能电子束与β粒子束在介质中的强度衰减曲线及其差别 由于单能电子和β粒子易受散射,其强度衰减规律不同于$α$粒子。但均存在最大射程$R_max$。 #figure( image("pic/2024-05-12-22-53-13.png", width: 80%), numbering: none ) 对β粒子,当吸收介质的厚度远小于$R_(beta max)$时,β粒子的强度衰减近似服从指数规律: $ I(x) = I_0 e^(- mu x) $ 其中$µ$为吸收体的线性吸收系数,$x$为吸收体的厚度。 记 $ mu_m = mu / ρ \ x_m = x ρ $ 则 $ I(x) = I_0 e^(- µ_m x_m) $ 其中$µ_m$为吸收体的质量吸收系数,$x_m$为吸收体的质量厚度。 在同一种吸收材料中,吸收系数与$β$粒子的最大能量密切相关,*能量越大吸收系数越小*,可以通过测量吸收系数间接测量$β$粒子最大能量。 $ mu_m = 17 / E_m^1.54 (0.1 M e V < E_m < 4 M e V) $ 实验发现,*初始能量相等*的电子在*各种材料*中的*最大射程*与*吸收体密度*的乘积(即质量厚度表示的最大射程)近似相等: $ R_max ρ = R_m (E) $ 质量厚度表示的射程,单位为:$g / "cm"^2$ *电子射程的经验公式* $ R_m (E) = 0.412 E ^ (1.265 - 0.0954 ln E) , 0.01 M e V < E < 2.5 M e V\ R_m (E) = 0.530 E - 0.106 , 2.5 M e V < E $ #figure( image("pic/2024-05-13-00-13-13.png", width: 80%), numbering: none ) ==== 电子的散射与反散射 电子与靶物质原子核库仑场作用时,只改变运动方向,而不辐射能量的过程称为弹性碰撞。与核外电子的弹性碰撞只在能量很小(100eV)时才需要考虑。 由于电子质量小,因而散射的角度可以很大,而且会发生*多次散射*。电子沿其入射方向发生大角度偏转,称为*反散射*。 定义反散射系数: $ eta = (I - I_0)/I_0 $ #figure( image("pic/2024-05-13-00-23-14.png", width: 80%), numbering: none ) *反散射的利用与避免* #figure( image("pic/2024-05-13-00-26-50.png", width: 80%), numbering: none ) ==== 正电子的湮没 *正电子*有两种来源:*$β^+$衰变*和*电子对效应*。 正电子在介质中的能量损失机制与电子的相同。(电离能量损失和辐射能量损失) 正电子的特点:*最终要湮没,产生湮没辐射。* 正电子进入物质后迅速慢化(损失能量),在径迹末端(可近似认为动能为零)与介质中的电子发生湮没(或者,在径迹末端先与一个电子结合成正电子素, 即电子——正电子对的束缚态,然后再湮没),放出γ光子——湮没光子(*湮没辐射*)。 正电子湮没一般放出两光子, 放出三光子的概率仅为放出两光子的0.73%,放出一个光子的概率更低。 两湮没光子的能量相同,等于*0.511MeV*。两个湮没光子的发射方向相反,且发射是各向同性的。 *正电子在材料中单位时间发生湮没的概率和寿命* #figure( image("pic/2024-05-13-00-35-32.png", width: 80%), numbering: none ) == X/γ射线与物质的相互作用 === 能谱的概念 “谱”代表一种*分布*,是统计多个目标的同一特征得到的直方图——横坐标是特征的值(范围), 纵坐标是该特征值(范围)对应的数量。 *能谱*:就是$dd(N) / dd(E) ~ E$的直方图。 实验直接测得的是脉冲幅度谱,即$dd(N) / dd(h) ~ h$的直方图。 - $dd(N) / dd(h)$表示脉冲幅度为$h$到$h+dd(h)$的脉冲数。 - $h$称为阈值,$dd(h)$称为道宽。 - 脉冲幅度谱通过能量刻度可以转化为能谱。 - 能谱或脉冲幅度谱是测量大量入射粒子,按信号幅度统计信号数形成的。 由于统计涨落,即使对同一能量的带电粒子,也会产生不同幅度的脉冲,形成脉冲幅度分布。脉冲幅度分布的中心值对应某一入射粒子的能量。 采用多道脉冲幅度分析器(脉冲幅度数字化),给出: $ y_(x_i)("计数/计数率") tilde x_i ("道址") $ #figure( image("pic/2024-05-13-00-44-38.png", width: 80%), numbering: none ) === γ射线与物质相互作用的特点 探测学中X/γ射线含义——较高能量电磁辐射 - $gamma$ - 特征$gamma$射线:核能级跃迁 【分立能量】 - 湮没辐射:正负电子湮没 $E_gamma = 0.511"Mev"$【分立能量】 - $X$ - 特征$X$射线:原子能级跃迁 【分立能量】 - 轫致辐射:带电粒子减速变向 【连续能量】 *γ射线没有能量损失率和射程的概念* - γ光子是通过*作用效应*(“单次性”的随机事件)与物质的原子或轨道电子作用,一旦作用,光子或者消失或者受到散射而损失能量并改变方向,同时产生次电子; - 作用效应主要有三种,即*光电效应、康普顿效应和电子对效应*。 γ射线与物质发生相互作用是一种概率事件,用截面表示作用概率的大小。总截面等于各作用截面之和, 即: $ sigma = sigma_"ph" + sigma_"C" + sigma_"p" $ === 光电效应(Photoelectric Effect) γ射线(光子)与物质原子中束缚电子作用, 把全部能量转移给某个束缚电子, 使之发射出去(称为光电子photoelectron),而光子本身消失的过程,称为光电效应。 光电效应是光子与原子整体相互作用,而不是与自由电子相互作用。因此,当入射光子能量足够高时,光电效应主要发生在原子中结合的最紧的 K 层电子上。 光电效应的后续过程:光电效应后,介质原子内层电子轨道出现空位,后续将发生发出特征X射线或俄歇电子的过程。 ==== 光电子的能量 光电效应是光子与原子整体的相互作用,而不是与自由电子的相互作用,否则不能同时满足能量和动量守恒定律,但光子能量主要被光电子带走了。 光电子的能量为: $ E_e = h nu - epsilon_i $ ==== 光电截面 光电截面:光子与物质原子发生光电效应的截面称为光电截面。 $ sigma_"ph" = sigma_"ph"^K + sigma_"ph"^L + sigma_"ph"^M + ... $ 光子与*内层电子*发生光电效应的几率较大。 $ sigma_"ph" = 5/4 sigma_"ph"^K $ 其中$sigma_K$为K层光电截面。 对:$h mu << m_0 c^2 $,即非相对论情况 $ sigma_K = (32)^1/2 alpha^4 Z^5 ((m_0 c^2)/(h mu))^7/2 sigma_"Th" prop Z^5 (1/(h mu))^7/2 $ 其中$alpha$为精细结构常数,$sigma_"Th"$为Thomson散射截面。 对:$h mu >> m_0 c^2 $,即相对论情况 $ sigma_K = 1.5 alpha^4 (m_0 c^2)/(h mu) Z^5 sigma_"Th" prop Z^5 (1/(h mu)) $ 与$Z^5$成正比,与射线能量的某次方成反比。 #newpara() 对:$h ν < 100 "keV"$ ,与吸收限有关,在吸收限$epsilon_K , epsilon_L , epsilon_M$处出现阶跃而成锯齿状。 光电效应截面小结: - $sigma_"ph"$与原子序数$Z$的5次方成正比; 对于探测γ射线:用高原子序数材料探测器,可得到高的探测效率。 对于防护、屏蔽γ射线:采用高原子序数材料可以有效阻挡γ射线。 - $h nu$越大、$sigma_"ph"$越小; γ光子能量越高, 光电效应截面越小。 $ sigma_"ph" prop Z^5 (1/(h nu))^(3.5 tilde 1) $ ==== 光电子的角分布 电子的角分布代表进入平均角度为 θ 方向的单位立体角内的光电子数的比例。 光电子的角分布用光电效应的微分截面$sigma(theta)$描述。其特点是: 1. 在 θ = 0° 和 θ = 180° 方向没有光电子飞出; 2. 光电子在哪一角度出现的概率最大与光子能量有关; - 当光子能量较低时, 光电子趋于垂直方向发射, - 当光子能量较高时, 光电子趋于向前发射。 #figure( image("pic/2024-05-13-00-51-48.png", width: 80%), caption: [ 光电子的角分布 ], ) #figure( image("pic/2024-05-13-01-28-27.png", width: 80%), caption: [ 在γ能谱上的体现 ], ) === 康普顿效应(Compton Effect) 康普顿效应(康普顿散射)是 γ射线与轨道电子的非弹性碰撞过程。作用中,光子将部分能量转移给电子,使其脱离原子成为反冲电子,而光子受到散射,其运动方向和能量都发生变化,称为散射光子。 康普顿效应主要发生在原子中结合的最松的外层电子上。 康普顿散射可近似为光子与自由电子发生相互作用(弹性碰撞)。 - “自由”电子: 结合能(电离能)很小。 - “静止”电子: 轨道电子速度远小于光速。 ==== 反冲电子与散射光子的能量与散射角以及入射光子能量之间的关系 #figure( image("pic/2024-05-09-10-57-30.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-09-10-59-24.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-09-10-57-30.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-00-55-44.png", width: 80%), numbering: none, ) 推导得到: 散射光子能量为: $ h nu' = (h nu) / (1 + (h nu)/(m_0 c^2) (1 - cos theta)) $ 反冲电子能量为: $ E_e = ((h nu)^2 (1 - cos theta)) / (m_0 c^2 (1 + (h nu)/(m_0 c^2) (1 - cos theta))) $ 反冲角: $ ctg phi = (1 + (h nu)/(m_0 c^2) ) tan (theta / 2) $ 以及 $ Delta lambda = h / (m_0 c) (1 - cos theta) $ #newpara() 小结: 1. 散射光子和反冲电子的*能量是连续的*。 $θ$大,$E_e$大,$h ν ′$小 2. 几种特殊情况: - 散射角$θ = 0°$时,$h nu' = h nu$,表明:入射光子从电子旁边掠过,未受到散射。 - 散射角$θ = 180°$时,散射光子能量最小,而反冲电子能量最大。 - $θ >150°$以后,$h ν' ≈ 200$keV,伽马能谱上形成*反散射峰*(外)和*康普顿沿*(内) 。 3. 散射角$θ$在$0°~ 180°$之间连续变化;反冲角$ϕ$在$90°~ 0°$相应变化。 4. 当$h ν <<m_0c^2$时,$h ν' ~ h ν $,汤姆逊散射;当$h ν >>m_0c^2$时,$E_e_max ~ h ν$ 。 ==== 康普顿效应截面 *入射光子与单个电子发生康普顿效应的截面$sigma_(c,e)$。* $h nu << m_0 c^2$: $ sigma_(c,e) ->^(h nu ->0) sigma_"Th" = 8/3 pi r_0^2, r_0 = (e^2)/(4 pi epsilon_0 m_0 c^2) $ 近似与入射光子能量无关,为常数。 $h nu >> m_0 c^2$: $ sigma_(c,e) = pi r^2 (m_0 c^2)/(h nu) (ln (2 h nu) / (m_0 c^2) + 1/2) $ 近似与入射光子能量成反比。 *入射光子与整个原子发生康普顿效应的截面$sigma_c$。* 在入射光子能量较高时: $ sigma_c = Z sigma_(c,e) prop Z ln(2 h nu) / (h nu) $ $Z$大,康普顿效应截面大;$h ν$大,康普顿效应截面小。康普顿效应截面随入射光子能量及作用介质原子序数的变化比光电效应的要缓和。 当入射光子能量较低时(如低于几十keV, $h ν(1 - cos theta) << m_0 c^2$)*轨道电子不能再看成是自由电子*,此时原子的康普顿效应截面表示为: $ sigma_c = S(x, Z) sigma_(c,e) $ 非相干散射函数(Incoherent scattering function)。 *康普顿效应的微分截面$dd(sigma_(c,e) (theta)) / dd(omega)$。* 表示散射光子落在某$θ$方向单位立体角内的概率。 #figure( image("pic/2024-05-13-01-18-49.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-01-19-19.png", width: 80%), numbering: none, ) ==== 反冲电子的角分布和能量分布 #figure( image("pic/2024-05-13-01-21-06.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-01-21-51.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-01-22-16.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-01-22-50.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-01-23-31.png", width: 80%), numbering: none, ) 1. 任何一种单能$γ$射线产生的反冲电子的动能都是*连续分布*的。且存在最大反冲电子动能,比入射光子能量$h ν$小$~ 200$keV。 2. 在*最大反冲电子动能处*,反冲电子数目最多,形成*康普顿边缘*(或称为*康普顿沿*),在能量较小处,存在一个*康普顿坪*(或称为*康普顿平台*)。 #figure( image("pic/2024-05-13-01-26-48.png", width: 80%), caption: [ 在γ能谱中的直接体现 ], ) === 电子对效应(Pair Production) *电子对效应*:当能量较高($>2m_0c^2$)的$γ$射线(光子)从原子核旁经过时,在核库仑场的作用下,*$γ$射线*转化为*一个正电子和一个电子*的过程。 电子对效应除涉及入射光子与电子对以外,必须有第三者——*原子核的参与*, 否则不能同时满足能量和动量守恒。电子对效应要求*入射光子的能量必须大于1.022MeV*。 *三粒子生成效应*(电子库仑场中的电子对效应) :当能量$>4m_0c^2$的$γ$射线从轨道电子旁经过时,在电子库仑场的作用下,$γ$射线*转化为一个正电子和一个电子并发射该轨道电子的过程*。 三粒子生成效应除涉及光子与电子对以外,必须有*轨道电子*的参与,否则不能同时满足能量和动量守恒。三粒子生成效应要求光子的能量必须*大于2.044MeV*。 #figure( image("pic/2024-05-13-10-50-56.png", width: 80%), numbering: none, ) *正负电子*不是从原子核中释放的;也不是来自原子中的轨道电子;*是γ射线转化而来*,是物质不同形态的转化。 1. 正负电子的能量(动能) 由能量守恒定律: $ h nu = E_(e^+) + E_(e^-) + 2 m_0 c^2 $ 正负电子的总动能为: $ E_e = E_(e^+) + E_(e^-) = h nu - 2 m_0 c^2 $ 总动能在电子和正电子之间随机分配,取值范围:$0 ~ (h nu - 2 m_0 c^2)$。 2. 正负电子的运动方向 由动量守恒,电子和正电子沿入射光子方向的前向角度发射。 入射光子的能量越高, 正负电子的发射方向越是前倾。 3. 电子对效应的截面 当$h ν$稍大于$2 m_0 c^2$时: $ sigma_p prop Z^2 E_gamma $ 其中$E_gamma$为入射光子的能量。 当$h ν >> 2 m_0 c^2$时: $ sigma_p prop Z^2 ln E_gamma $ 电子对效应截面 - 随$Z$的增加而增加, - 随$E_γ$的增加而增加。 4. 电子对效应的后续过程——正电子的湮没 #figure( image("pic/2024-05-13-11-23-56.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-11-24-46.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-11-25-33.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-11-25-47.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-11-27-38.png", width: 80%), caption: [ 在$γ$能谱上的体现 ], ) #figure( image("pic/2024-05-13-11-29-43.png", width: 80%), caption: [ 各类峰的能量 ], ) #figure( image("pic/2024-05-13-11-30-28.png", width: 80%), caption: [ 作用截面 ], ) #figure( image("pic/2024-05-13-11-31-08.png", width: 80%), caption: [ 三种效应的相对重要性 ], ) #figure( image("pic/2024-05-13-11-32-08.png", width: 80%), caption: [ 三种效应的截面(衰减系数) ], ) === 物质对 γ 射线的衰减 ==== 窄束γ射线强度的衰减规律 - $σ_γ$为光子与吸收物质作用的截面; - $N$为吸收物质单位体积的原子数; - $I_0$为γ射线入射强度; - $D$为吸收物质厚度。 #figure( image("pic/2024-05-13-11-36-19.png", width: 30%), numbering: none, ) 在$x~ x+dd(x)$层内单位时间光子数的变化等于在该层物质内单位时间发生的作用次数: $ dd(I) = - σ_γ N I dd(x) $ 解得窄束γ射线强度的衰减规律: $ I(x) = I_0 e^(- σ_γ N x) $ ==== 衰减系数 *线性衰减系数*(Linear attenuation coefficient)$mu$又称为宏观截面$Σ$: $ mu = σ_γ N $ 单位是:$"cm"^(-1)$ $ mu = (sigma_"ph" + sigma_"c" + sigma_"p") N = mu_"ph" + mu_"c" + mu_"p" $ $ mu = Sigma = sigma_gamma (N_A rho)/A $ #newpara() *质量衰减系数*(Mass attenuation coefficient): $ mu_m = mu / rho = (sigma_gamma N)/rho = sigma_gamma N_A / A $ 单位是:$"cm"^2 / "g"$。质量衰减系数与物质状态无关。 *质量厚度*(Mass thickness): $ x_m = x rho $ 单位是:$"g" / "cm"^2$。 通过物质时的光子束强度: $ I(x) = I_0 e^(- mu x) = I_0 e^(- mu_m x_m) $ ==== 半衰减厚度(Half-attenuation thickness or Half-Value Thickness) 和平均自由程(Mean free path) 与带电粒子不同, γ射线没有射程的概念。窄束γ射线强度服从指数衰减规律,有衰减系数及相应的半衰减厚度和平均自由程的概念。 *半衰减厚度*:射线在物质中强度减弱一半时对应的物质厚度。 $ D_"1/2" = (ln 2)/mu $ #newpara() *平均自由程*:发生相互作用前,射线在物质中行进的平均距离。 $ lambda = (integral_0^oo x mu e^(- mu x) dd(x)) / (integral_0^oo mu e^(- mu x) dd(x)) = 1/mu $ ==== 化合物或混合物的质量衰减系数 $ (mu_m)_c = sum_i omega_i (mu_m)_i, omega_i = (n_i A_i) / M $ ==== 非窄束γ射线强度的衰减规律 #figure( image("pic/2024-05-13-13-17-43.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-13-13-12-32.png", width: 80%), numbering: none, ) = 辐射探测中的统计学 辐射探测中统计学的意义:统计性是微观世界的属性之一 学习辐射探测中的概率统计问题,有两方面的意义: 1. 理解测量量服从的统计分布规律,计算其数字表征,检验一台辐射测量装置的功能和状态是否正常; 2. 在处理只有一次或极为有限的测量中,可用统计学来预测其固有的统计不确定性,从而估计该单次测量应有的精密度。 == 核衰变和放射性计数的统计分布 === 核衰变的统计分布 ==== 二项分布 概率$p$的事件在$n$次试验中发生$k$次的概率: $ P(k) = C_n^k p^k (1-p)^(n-k) $ 数学期望: $ E(k) = n p $ 方差: $ D(k) = n p (1-p) $ ==== 泊松分布 当$n$很大,$p$很小时,二项分布近似为泊松分布: $ P(k) = (lambda^k e^(-lambda)) / k! $ 数学期望: $ E(k) = lambda $ 方差: $ D(k) = lambda $ ==== Gaussian分布 高斯分布: $ P(x) = (1 / (2 pi sigma^2))^1/2 e^(-(x - mu)^2 / (2 sigma^2)) $ 数学期望: $ E(x) = mu $ 方差: $ D(x) = sigma^2 $ === 随机变量组合的分布 复杂随机变量往往由简单随机变量运算、组合而成。由简单随机变量的分布函数与数字表征可求复杂随机变量的分布函数和数字表征。 ==== 随机变量的函数 已知随机变量 $X$,其可取值为 $x$,概率密度函数为 $f(x)$。而 $Y=Φ(X)$ ,求随机变量$Y$的可取值$y$和概率密度函数$g(y)$。 $ Y = Φ(X) , X = Ψ(Y) $ 由于$X$取各可取值的概率就是$Y$取相应可取值的概率,所以: $ f(x) dd(x) = g(y) dd(y) $ $ g(y) = abs(dd(x) / dd(y)) f(x) = f(Ψ(y)) dd(Ψ(y)) / dd(y) $ 若干重要且常用的关系: 1. $Y = C X$ $ E(Y) = C E(X)\ D(Y) = C^2 D(X)\ nu(Y) = sigma_Y / E(Y) = sigma_X / E(X) = nu(X) $ 相对标准偏差不变。 2. *相互独立*的随机变量的 “和”、“差”与“积”的数学期望,是各随机变量数学期望的“和”、“差”与“积” $ E(X_1 + E_2) = E(X_1) + E(X_2)\ E(X_1 - E_2) = E(X_1) - E(X_2)\ E(X_1 X_2) = E(X_1) E(X_2) $ 3. *相互独立*的随机变量的“和”的方差,是各随机变量方差的“和” $ D(X_1 plus.minus X_2) = D(X_1) + D(X_2) $ 4. *相互独立*的*泊松分布随机变量*之“和”仍服从泊松分布 。 注意:相互独立的泊松分布随机变量之“差”,不服从泊松分布。 === 串级随机变量 辐射测量中经常会遇到*级联、倍增*等过程的涨落问题,可用*串级型随机变量*的概念及运算规则来处理。 串级随机变量的定义: 设:对应于某试验条件组$A$定义 一个随机变量$ξ_1$(非负整数),对应另一试验条件组$B$定义另一随机变量$ξ_2$,且二者相互独立。按以下规则定义新的随机变量$ξ$,形成*串级随机变量* 。 1. 先按条件组$A$作一次试验,实现随机变量$ξ_1$的一个可取值$ξ_(1 i)$;($ξ_1$必须是非负整数,是数量,无量纲) 2. 再按条件组$B$作$ξ_(1 i)$次试验,实现随机变量$ξ_2$的$ξ_(1 i)$个可取值 3. 将这些可取值加起来得到一个值$ξ_i$ ,并将此值定义为一个新的随机变量$ξ$的一个可取值 $ ξ_i = sum_(j = 0)^(ξ_(1 i)) ξ_(2 j) $ 随机变量$ξ$即为$ξ_1$与$ξ_2$的“串级”随机变量。$ξ_1$为此串级随机变量的第一级;$ξ_2$为此串级随机变量的第二级。 串级随机变量的特性 - 期望值: $ E(ξ) = E(ξ_1) E(ξ_2) $ - 方差: $ D(ξ) = E^2(ξ_2) D(ξ_1) + E(ξ_1) D(ξ_2) $ - 相对方差: $ nu^2(ξ) = D(ξ) / (E^2(ξ)) = nu^2(ξ_1) +( nu^2(ξ_2)) /( E(ξ_1)) $ 假如*第一级随机变量的数学期望很大*,那么就可以忽略第二级随机变量的相对方差对串级随机变量的相对方差的贡献。此时,串级随机变量的相对方差主要由第一级随机变量的相对方差决定。 - 两个伯努利型随机变量$ξ_1$和$ξ_2$串级而成的随机变量$ξ$仍是伯努利型随机变量,只有两个可取值$(0, 1)$ - 泊松分布的随机变量$ξ_1$与伯努利型随机变量$ξ_2$串级而成的随机变量$ξ$遵守泊松分布。 对$N$个*相互独立*的随机变量串级而成的$N$级串级随机变量$ξ$,有: - 期望值: $ E(ξ) = E(ξ_1) E(ξ_2) ... E(ξ_N) $ - 相对方差: $ nu^2(ξ) = nu^2(ξ_1) + (nu^2(ξ_2))/(E(ξ_1)) + (nu^2(ξ_N))/(E(ξ_1) E(ξ_2)) + ... + (nu^2(ξ_N))/(E(ξ_1) E(ξ_2) ... E(ξ_(N-1))) $ 在第一级随机变量的均值较大时,串级随机变量的相对方差主要决定于第一级随机变量的相对方差。 === 放射性测量计数的统计分布 ==== 核衰变数的涨落 对于具有$N_0$个放射性核的放射源,在$t$时间内的核衰变数$N$,服从*二项式分布*。 - 概率函数: $ P_(N_0) (N) = (N_0 !)/(N! (N_0 - N)!) (1 - e^(-lambda t))^N (e^(-lambda t))^((N_0 - N)) $ - 数学期望: $ E(N) = N_0 (1 - e^(-lambda t)) $ - 方差: $ D(N) = N_0 e^(-lambda t) (1 - e^(-lambda t)) $ 对于半衰期较长的放射源:衰变常数很小、原子核数目很大。在有限的时间$t$(如几天)内,满足二项式分布→泊松分布的两个条件。所以,在$t$时间内发生的核衰变数$N$服从*泊松分布*。 长寿命核素$t$时间内的 - 衰变概率$p = 1 - e^(-lambda t) approx lambda t$很小; - 核衰变数$N = N_0 p = N_0 lambda t = A_0 t$为有限量。 $N$服从泊松分布: - 概率函数: $ P_(A_0) (N) = (A_0 t)^N e^(-A_0 t) / N! $ - 数学期望: $ E(N) = A_0 t = N_0 lambda t = m $ - 方差: $ D(N) = A_0 t = N_0 lambda t = m $ 在长寿命核衰变中,核衰变数$N$的方差与均值相等。 当$m$较大时,泊松分布 → *高斯分布*。 $ P(N) = 1/sqrt(2 pi m) e^(-(N - m)^2 / (2 m)) $ 仅有统计涨落则$sigma = sqrt(m)$。 ==== 放射性测量计数的统计分布 *计数*:用探测器测量放射源或样品,在某段时间$t$内测量到的脉冲信号的个数$N$。 *计数率*:计数除以测量时间(单位时间的计数),$n = N / t$。 计数是探测器系统记下的脉冲信号的个数,反映了$t$时间内射入探测器的粒子数,与放射源在$t$时间内发射出的粒子数成正比。 *计数率与射线强度成正比,也与源的活度成正比。* 脉冲探测器的测量可概括为三个基本过程,其计数值为一个*四级串级型随机变量*。 1. 源发射粒子数$N_1$ $N_1$为$t$时间内放射源发射的粒子数,是源衰变数乘以绝对强度$%$。 *绝对强度*$%$是*伯努利型随机变量*正结果发生的*概率*。 $V_1$是*泊松分布随机变量与伯努利型随机变量串级*而成的二级串级随机变量,*服从泊松分布*。 $ macron(N_1) = % N_0 lambda t = % A_0 t\ sigma^2(N_1) = % N_0 lambda t = % A_0 t $ 2. 射入探测器粒子数$N_2$ $N_2$为进入探测器,即进入$Ω$的粒子数(能否进入$Ω$是伯努利事件)。 $Ω/(4π)$是*伯努利型随机变量*正结果发生的*概率*。 $N_2$为*泊松分布随机变量与两个伯努利型随机变量串级*而成的三级串级随机变量,服从*泊松分布*。 $ macron(N_2) = Ω/(4π) macron(N_1) = Ω/(4π) % N_0 lambda t = Ω/(4π) % A_0 t\ sigma^2(N_2) = Ω/(4π) % A_0 t $ 1. 探测器输出脉冲计数$N_3$ $N_3$为探测器输出脉冲数(粒子能否被探测是伯努利事件)。 $ε$是*伯努利型随机变量*正结果发生的*概率*。 $N_3$为*泊松分布随机变量与三个伯努利型随机变量串级*而成的四级串级随机变量,服从*泊松分布*。 $ macron(N_3) = ε macron(N_2) = ε Ω/(4π) % N_0 lambda t = ε Ω/(4π) % A_0 t\ sigma^2(N_3) = macron(N_3) = ε Ω/(4π) % N_0 lambda t = ε Ω/(4π) % A_0 t $ #figure( image("pic/2024-05-20-01-32-19.png", width: 80%), numbering: none, ) == 放射性测量的统计误差 === 辐射探测数据的统计误差 粒子计数——探测器输出脉冲数服从一定的统计分布规律,当计数的数学期望值: - $m$较小时,服从泊松分布; - $m$较大时,可近似为高斯分布, 而且,$σ^2 = m$。 $m$较大时,$m$与有限次测量的平均值或任一测量值$N$相对相差不大 $ sigma = sqrt(m) = sqrt(macron(N)) = sqrt(N) $ $N$为单次测量值。 表明:*放射性计数的标准偏差只需用一次计数$N$或有限次计数的平均值$N$开方即可得到*。注意:这里的标准偏差仅适用于误差仅仅由*统计涨落*引起的情况(即不包含其他误差因素)。 实验数据分析中,可由实验数据直接得到样本方差,它是总体方差的无偏估计,可以由样本方差估计有限次测量的方差,称为*标准偏差*$σ_s$: $ sigma_s = sqrt(1/(n-1) sum_(i = 1)^n (N_i - macron(N))^2) $ 不仅包括统计误差,还反映了*其他偶然误差*的贡献,可用于数据的检验。 $ sigma_S >= sigma = sqrt(N) $ #newpara() 计数测量结果的表示(服从泊松分布时) : $ N plus.minus sigma_N = N plus.minus sqrt(N) $ 表示:任意一次测量值$N_i$或真平均值落在区间内的概率为68.3%(置信度)。 - *标准偏差*$sigma_N = sqrt(N)$随计数$N$的*增大而增大* - *相对标准偏差*$ν_N = 1 / sqrt(N)$随计数$N$的*增大而减小* 直观上,计数值越大(相同条件下测量时间越长),*离散程度*应该越小,因此一般用*相对标准偏差*表示测量值的离散程度。在辐射探测实验中,要求测量的统计误差小于%,指的就是*相对标准偏差*要小于该值。 $ 1/sqrt(N) < nu => N > 1/nu^2 $ 为了提高探测器计数的测量精度: $ nu^2(N_3) = (sigma^2(N_3) )/ (macron(N_3)^2) =1 / macron(N_3) = (4 pi)/(ε Ω A_0 t) $ - 增大立体角 - 增大探测器的本征探测效率 - 增大源强 - 延长测量时间 === 计数统计误差的传递 核测量中,常涉及函数的误差的计算,也就是误差传递(Error Propagation)。 设:$x_1,x_2,...,x_n$是相互独立的随机变量,$sigma_(x_1),sigma_(x_2),...,sigma_(x_n)$是它们的*标准偏差*,$y = f(x_1,x_2,...,x_n)$是它们的函数。$y$的标准偏差$sigma_y$与$x_1,x_2,...,x_n$的标准偏差$sigma_(x_1),sigma_(x_2),...,sigma_(x_n)$之间的关系。 $ sigma^2_y = sum_(i = 1)^n ((partial f) / (partial x_i))^2 sigma^2_(x_i) $ ==== 两独立随机变量的和或差构成的随机变量 $ y = x_1 plus.minus x_2 $ $ E(y) = E(x_1) plus.minus E(x_2)\ sigma^2(y) = sigma^2(x_1) + sigma^2(x_2)\ nu(y) = sqrt(sigma^2(x_1) + sigma^2(x_2)) / (E(x_1) plus.minus E(x_2)) $ #figure( image("pic/2024-05-20-02-02-34.png", width: 80%), numbering: none, ) 净计数及其相对标准偏差: $ N_0 = N_s - N_b\ nu(N_0) = sqrt(N_s + N_b) / (N_s - N_b) $ ==== 机变量乘以(除以)常数构成的随机变量 $ y = A x , y = x / B $ $ E(y) = A E(x) , E(y) = E(x) / B\ sigma^2(y) = A^2 sigma^2(x) , sigma^2(y) = sigma^2(x) / B^2\ nu(y) = nu(x) $ 机变量乘以(除以)常数构成的随机变量,不改变原随机变量的相对标准偏差。 #figure( image("pic/2024-05-20-02-10-01.png", width: 80%), numbering: none, ) 计数率及其相对标准偏差: $ n = N / t\ sigma^(n) = N/ t^2 != n\ nu(n) = sigma^(n) / n = sqrt(N) / N = 1 / sqrt(N) = nu(N) $ ==== 两独立随机变量的乘积或商构成的随机变量 $ y = x_1 x_2 , y = x_1 / x_2 $ $ E(y) = E(x_1) E(x_2) , E(y) = E(x_1) / E(x_2)\ nu^2(y) = nu^2(x_1) + nu^2(x_2)\ ((sigma(y)) / (E(y)))^2 = ((sigma(x_1)) / (E(x_1)))^2 + ((sigma(x_2)) / (E(x_2)))^2\ sigma(y) = E(y) sqrt(((sigma(x_1)) / (E(x_1)))^2 + ((sigma(x_2)) / (E(x_2)))^2) $ ==== 存在本底时净计数率及其统计误差 设:时间$t_b$内测得本底的计数为$N_b$,时间$t_s$内测得样品和本底的总计数为$N_s$ - 净计数率的期望值: $ n_0 = N_s / t_s - N_b / t_b = n_s - n_b $ - $n_0$仅取决于样品,不能直接测到 - $n_b$减小时$n_S$也减小,$n_0$不变 - $n_s$既随本底$n_b$变,又随样品变 - 标准偏差: $ sigma(n_0) = sqrt(sigma^2(n_s) + sigma^2(n_b)) = sqrt( N_s / t_s^2 + N_b / t_b^2 ) = sqrt( n_s/t_s + n_b/t_b ) $ - 相对标准偏差: $ nu(n_0) = sigma(n_0) / n_0 = 1/ (n_s - n_b)sqrt( n_s/t_s + n_b/t_b ) $ 减小本底有利于提高测量精度$n_b$减小的同时$n_S$也减小了,增加时间有利于提高测量精度 ==== 平均计数及其统计误差 对样品重复测量$k$次,每次测量时间$t$相同(等精度测量),得到$k$个计数$N_1,N_2,N_3...N_k$,则在时间$t$内的平均计数值为: $ macron(N) = 1/k sum_(i = 1)^k N_i $ 由误差传递公式,平均计数值的方差为: $ sigma^2(N) = 1/k^2 sum_(i = 1)^k sigma^2(N_i) = 1/k^2 sum_(i = 1)^k N_i = macron(N)/k $ 平均计数是随机变量,但期望值不等于方差,*不服从泊松分布*。 多次重复测量平均计数的表达: $ macron(N) plus.minus sigma(N) = macron(N) plus.minus sqrt(macron(N)/k) $ 平均计数的相对标准偏差=总计数的相对标准偏差 $ nu(macron(N)) = sigma(macron(N)) / macron(N) = 1 / sqrt(k macron(N)) = 1 / sqrt(sum_i N_i) $ ==== 不等精度独立测量值的组合 *不等精度测量*:对同一量进行了$k$次独立测量,各次测量时间为$t_i$,计数为$N_i$。 对不等精度测量,简单的求平均不是求“最佳值”的适宜方法,需要进行加权平均,在求均值时,应该:*精度高贡献大,精度低贡献小*。 各次测量的计数率的期望值及方差: $ n_i = N_i / t_i\ sigma^2(n_i) = N_i / t_i^2 = n_i / t_i $ 设各次测量的权重$W_i$与方差成反比: $ W_i = lambda^2 / (sigma^2(n_i) )=^(lambda^2 = macron(n) approx n_i) n_i / (n_i / t_i ) = t_i $ 计数率的*加权平均值*,加权平均值的期望值: $ macron(n) = (sum_(i = 1)^k W_i n_i) /( sum_(i = 1)^k W_i) = (sum_(i = 1)^k t_i n_i) /( sum_(i = 1)^k t_i) = (sum_(i = 1)^k N_i) /( sum_(i = 1)^k t_i) $ 加权平均值的标准偏差: $ sigma^2(macron(n)) = sqrt(1/(sum_(i = 1)^k t_i)^2 sum_(i=1)^k sigma^2(n_i) ) = sqrt(1/(sum_(i = 1)^k t_i)^2 sum_(i=1)^k N_i ) = sqrt( macron(n) / (sum_(i = 1)^k t_i )) $ *加权平均值的相对标准偏差 = 总计数的相对标准偏差*: $ nu(macron(n)) = sigma(macron(n)) / macron(n) = 1 / sqrt(sum_(i = 1)^k N_i) $ #newpara() 平均计数率的表示: $ macron(n) plus.minus sigma(n) = macron(n) plus.minus sqrt(macron(n) / (sum_(i = 1)^k t_i)) $ 对等精度测量(k次等时间测量) $ macron(n) plus.minus sigma(n) = macron(n) plus.minus sqrt(macron(n) / (k t )) $ #figure( image("pic/2024-05-20-11-40-20.png", width: 80%), numbering: none, ) ==== 测量时间和测量条件的选择 原则: - 在最短测量时间得到满足要求的测量精度 - 总时间一定,合理分配,使测量精度最高 1. 不考虑本底的影响(样品放射性强,本底可忽略) $ nu_n = 1 / sqrt(n t) <= nu_0 => t >= 1 / ((nu_0)^2 n) $ 2. 有本底存在时,需要合理分配测量时间:样品测量时间$t_s$和本底测量时间$t_b$。在总测量时间$T = t_s + t_b$不变的情况下,测量结果——*净计数率*的*标准偏差最小*(测量精度最高)。 $ sigma(n_0) = sqrt(n_s/t_s + n_b/t_b) $ 求导得到极小值条件: $ t_s/t_b = sqrt(n_s/n_b) $ 该条件下的相对方差为: $ nu^2(n_0) = (1 / (n_s - n_b) sqrt(n_s/t_s + n_b/t_b))^2 = 1 /(T (sqrt(n_s) - sqrt(n_b))^2) $ 给定相对标准偏差,所需最小总测量时间为: $ T >= 1 / ((nu_0)^2 (sqrt(n_s) - sqrt(n_b))^2) $ == 带电粒子在介质中电离过程的统计涨落 === 电离过程的涨落和法诺分布 *电离过程的涨落*:微观上,产生*电子-离子对*或*电子-空穴对*的碰撞都是随机的, 因而带电粒子在介质中损失一定能量形成的离子对数目是涨落的,是随机变量,服从一定的概率分布。 实验发现,带电粒子在气体介质中,每产生一个电子-离子对需消耗的能量基本上是一个常数: $ W ≈ 30e V $ 则,能量为$E_0$的带电粒子在气体中损耗全部能量,产生的电子-离子对数的平均值为: $ macron(n) = E_0 / W $ *带电粒子在气体中的电离能量损失过程分析* 能量为$E_0$的带电粒子在气体中总共经历了$N$(是一个非常大的数)次与气体原子的碰撞。每一次*碰撞*只可能有两种结果:产生或不产生电离(离子对)。 $N$次碰撞后产生$macron(n)$个离子对,因而每次碰撞产生离子对的概率是:$P = macron(n) / N$。碰撞是伯努利事件,$N$次碰撞中产生的离子对数$n$是一个*二项分布随机变量*。但实际上电离过程中各次碰撞*并不相互独立*,产生的离子对数不能简单的用泊松分布来描述,而要对泊松分布进行修正,引入*法诺因子*$F$: $ F = sigma^2/macron(n) = ("观测的"n"的方差")/"泊松统计预测的方差" $ 法诺分布随机变量的方差等于均值乘以法诺因子。$F$一般取0.05$tilde$0.2(气体)或 0.1$tilde$0.15(半导体),不同材料法诺因子不同,可由实验测定。 带电粒子在介质中损失能量$E_0$,共产生$n$个离子对,$n$为随机变量,服从*法诺分布*。 $ macron(n) = E_0 / W "对应探测器的信号幅度"\ sigma^2 = F macron(n) = F E_0 / W\ sigma = sqrt(F macron(n)) = sqrt((F E_0 )/ W) "对应探测器的能量分辨率"\ nu = sigma / macron(n) = sqrt((F W) / E_0) "对应探测器的能量分辨率" $ === 粒子束脉冲的总电离电荷量的涨落 ==== 探测器的工作方式 - *脉冲型工作方式:信号反映单个粒子的特性* 探测器逐个探测辐射粒子,信号与单个粒子的性质相对应(可计数或测能谱): - *计数*与*粒子数*对应; - *幅度*与*粒子能量*对应。 - *累计型工作方式:一定数量粒子的累计特性* - 粒子束脉冲 给出粒子束脉冲在探测器内产生的总电离效果,信号为大脉冲,*脉冲幅度与粒子束内粒子数量和能量有关*。 - 电流型 稳定粒子束流在探测器内产生的平均电离效应。输出直流电流/电压信号,*信号的大小正比于粒子束流的强度和能量*。 ==== 粒子束脉冲的总电离电荷量及其涨落 $n_1$为一个入射*粒子束脉冲*中包含的*粒子数*,假设其服从*泊松分布*。 $n_2$为每个入射*带电粒子*(或入射 γ / X 射线通过相互作用产生的次电子等)在探测器内电离产生的*离子对数* ,服从*法诺分布*。 #figure( image("pic/2024-05-20-14-55-45.png", width: 80%), numbering: none, ) 第$i$个脉冲产生的总离子对数为: $ N_i = sum_(j = 1)^(n_(1 i)) n_(2 j) $ - 均值 $ macron(N) = macron(n_1) macron(n_2) $ - 相对反差 $ nu^2_N = nu_(n_1)^2 + 1/macron(n_1) nu_(n_2)^2 = 1/macron(n_1) (1 + F/macron(n_2)) $ == 辐射粒子与信号的时间分布 === 相邻脉冲的时间间隔 已知核辐射事件及探测器计数服从*泊松分布*,设$m$为*单位时间内的平均脉冲数*(即:$m$为*计数率*),设$T$为*相邻两脉冲的时间间隔*,$T$是一连续型随机变量。 脉冲间的平均时间间隔: $ macron(T) = 1/m $ $t$时间内出现$n$个脉冲的概率为: $ P_(t) (n) = (m t)^n / n! e^(-m t) $ 两个相邻脉冲时间间隔为$t$的条件为: - 在第一个脉冲发生后的$t$内没有产生脉冲; - 在$t$后的$dd(t)$时间内产生了一个脉冲。 $ P(t <= T < t + dd(t)) = P_(t) (0) P_(dd(t)) (1) = e^(-m t) m dd(t) $ 得到随机变量$T$的概率密度函数为: $ f(t) = m e^(-m t) $ $T$服从由$m$决定的指数型分布。 #figure( image("pic/2024-05-20-15-18-48.png", width: 80%), caption: [ 指数型分布的概率密度函数$f(t)$ ], ) - 均值: $ macron(T) = integral_0^oo t f(t) dd(t) = 1/m $ - 方差: $ sigma^2(T) = integral_0^oo t^2 f(t) dd(t) - macron(T)^2 = 1/m^2 $ - 相对方差: $ nu^2(T) = (sigma^2(T)) / macron(T)^2 = 1 $ 时间间隔$t ≥ T_0$的概率: $ P(T ≥ T_0) = e^(-m T_0) $ #newpara() *分辨时间*:测量系统的*最小响应时间*,当脉冲时间间隔小于分辨时间时,后面的计数将丢弃。 #figure( image("pic/2024-05-20-15-23-13.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-20-15-23-34.png", width: 80%), numbering: none, ) === 相邻定标脉冲的时间间隔 进位系数为$S$,则*相邻进位脉冲*的时间间隔$T_S$为随机变量,其概率密度函数为: $ f_S (t) = (m t)^(S-1) / (S-1)! e^(-m t) $ 阶数为$S$的埃尔朗分布或伽玛分布。 - 均值: $ macron(T_S) = S / m $ - 方差: $ sigma^2(T_S) = S / m^2 $ - 相对方差: $ nu^2(T_S) = 1 / S $ 相邻定标脉冲的*最可几时间间隔*: $ (dd(f_S) / dd(t)) = 0 => t_"most probable" = (S - 1) / m $ #figure( image("pic/2024-05-20-15-27-57.png", width: 80%), numbering: none, ) = 气体探测器 == 辐射探测器 辐射是不能直接感知的,必须借助于器件(辐射探测器,类似一种传感器)来探测,给出辐射的*类型、强度(数量)、能量及时间*等特性,即对辐射进行测量。 辐射探测器:利用辐射在气体、液体或固体中引起的电离、激发效应或其它物理、化学变化进行辐射探测的器件称为辐射探测器,简称为探测器。(作用→信号,能量损失→信号幅度) 辐射探测的基本过程: - 辐射粒子进入探测器的灵敏体积; - 入射粒子通过电离、激发等效应在探测器中*沉积能量*; - 探测器通过各种工作机制将*沉积能量*转换成某种形式的*输出信号*。 辐射探测器按探测介质类型及作用机制主要分为: - 气体探测器 - 电离室 - 脉冲电离室 - 离子脉冲电离室 - 电子脉冲电离室(圆柱形/屏栅) - 累计电离室 - 正比计数器 - GM管 - 闪烁探测器 - 闪烁体(无机/有机) - 光电转换(PMT/PD/Si-PM) - 工作状态:电压脉冲和电流脉冲 - 半导体探测器 - PN结半导体探测器 - Li漂移半导体探测器 - 高纯锗半导体探测器 #figure( image("pic/2024-05-20-15-33-07.png", width: 80%), numbering: none, ) *气体探测器*主要有三种: - 电离室(Ionization Chambers) - 正比计数器(Proportional Counters) - G-M计数器(Geiger Müeller Counters) 三种气体探测器的*共同特征*: - 工作介质为气体,气体中电子/离子的行为 - 都需要建立电场,电场中电子/离子的行为 三种气体探测器的不同: - 电离室没有电子雪崩(没有放大)【可以测能量】 - 正比计数器有电子雪崩没放电传播(正比放大)【可以测能量】 - G-M计数器有电子雪崩有放电传播(饱和放大)【不能测能量】 #figure( image("pic/2024-05-20-15-34-40.png", width: 80%), caption: [ 气体探测器的工作区域 ], ) == 气体中离子与电子的运动规律 === 气体的电离与激发——带电粒子与气体的相互作用 *带电粒子的电离能量损失——气体探测器依赖的相互作用* 入射带电粒子与靶原子的轨道电子通过库仑作用,使电子获得能量而引起原子的*电离或激发*。(多个) *自由电子和正离子(气体探测器的载流子)* 在电场作用下,电离(相对快过程,可认为瞬时完成)产生的多个自由电子和正离子同时定向漂移(相对慢过程),形成电流信号。 - 原电离:入射带电粒子直接电离产生离子对。 - 次电离: 原电离产生的高速电子(δ射线)使气体产生的电离。 *总电离 = 原电离 + 次电离*。探测器*输出信号的大小(幅度)*与*总电离*成正比。 *比电离*:带电粒子在单位长度路径内产生的电子-离子对数。 ==== 电离产生的离子对数(Number of Ion Pairs Formed) 平均电离能$W$: 带电粒子在气体中电离产生一个电子-离子对所需的平均能量。 不同气体对同种带电粒子不同,同一气体对不同带电粒子不同,但差别不大,约30eV。 若入射带电粒子的能量为$E_0$,当其能量全部损失在气体介质中时,产生的平均离子对数为: $ macron(N) = E_0 / W $ 能量$prop$离子对数$prop$信号幅度。 ==== 法诺分布和法诺因子(The Fano Factor) 电离产生的离子对数 N 是随机变量,服从*法诺分布*。 法诺分布的方差等于均值乘以法诺因子: $ sigma^2 = F macron(N) = F E_0 / W $ ==== 被激发原子的退激 快过程: 10-9秒内完成。ns【和原信号无法区分】 1. *辐射光子。*发射波长接近紫外的光子,这些光子又可能在周围介质中打出光电子,或被某些气体分子吸收而使分子离解。 2. *发射俄歇电子。* 慢过程: 10-2 ~ 10-4秒。ms【和原信号可以区分】 3. *亚稳态原子的退激。*受激原子处于亚稳态,仅当它与其它粒子发生非弹性碰撞时才能退激。 ==== 光致电离(光电效应) 光致电离:介质原子通过光电效应,吸收一个光子,放出一个电子而电离。 紫外光子能量较低,光致电离产生的电子动能很低, 一般不能再引起新的电离或激发。 === 电子与离子在气体中的运动 电子和正离子在气体中运动,并和气体分子或原子不断地碰撞,处于平衡状态,会发生以下物理过程: - *复合*:载流子损失,信号减小,涨落增大 - *扩散*:位置分辨和时间特性变差,电荷损失 - *电子吸附*:增加复合概率,减小扩散 - *电荷转移*:离子漂移减慢,阻断离子反馈 - *定向漂移*:信号形成 ==== 复合(Recombination) *复合*:*正负电荷相遇*复合成中性的原子或分子的过程。 复合的结果:损失电子离子对,使产生信号的电子离子对数目减少,破坏了入射粒子电离效应与输出信号之间的正比关系。 复合引起的离子对数目的损失率: $ - (partial n^+)/(partial t) = - (partial n^-)/(partial t) = alpha n^+ n^- $ 其中$alpha$为复合系数,$n^+$和$n^-$分别为正负离子的密度。 两种情况: - 电子与正离子:$alpha$小 - 负离子与正离子:$alpha$大 *必须尽量避免。* ==== 扩散(Diffusion) *扩散*:在气体中,电离产生的电子和离子的密度不均匀,原电离处密度大。由于其密度梯度而造成的离子、电子的定向运动叫扩散。 $ arrow(j)^plus.minus = - D^plus.minus grad n $ 其中三项为粒子流密度、扩散系数、密度。如果电离产生的电子和离子的速度遵守麦克斯韦分布,则扩散系数$D$与电子或离子的杂乱运动的平均速度$v$之间的关系为: $ D = 1/3 macron(v) lambda $ 其中$lambda$为电子或离子的平均自由程。 电子的平均自由程和乱运动的平均速度都比离子的大,因此其扩散系数比离子的大得多,因而电子的扩散效应比离子的严重。 ==== 电子的吸附和负离子的形成 *吸附效应*:电子在运动过程中与气体分子碰撞时可能被气体分子俘获,形成*负离子*,这种现象称之为吸附效应。 *吸附系数*:每次碰撞中电子被俘获的概率,用$h$表示。 吸附效应通常*不好*,会增加*复合*,*减小信号,增大涨落*;但不绝对,可以利用吸附来*减小电子扩散的影响*。 ==== 电荷转移效应 *电荷转移*:*正离子与中性的气体分子*碰撞时,正离子与分子中的一个电子结合成中性原子,中性气体分子成为正离子。 - 电荷转移效应在混合气体中比较明显。 - 电荷转移效应通常产生较重的离子,使离子的迁移率减小,漂移速度降低。 *上面四者都不利于电荷的收集。* ==== 离子和电子在外加电场中的漂移 *定向漂移运动*:在外加电场作用下,离子和电子除了与作热运动的气体分子碰撞而杂乱运动和因空间分布不均匀造成的扩散运动外,还有由于*外加电场*的作用而沿着(顺着或逆着)*电场方向的定向运动*,即定向*漂移运动*。 *漂移速度*:指电子或离子定向漂移运动的速度。 1. *离子的定向漂移* 存在电场的情况下,两次碰撞之间离子从电场获得的能量又会在碰撞中损失,离子的能量积累不起来。*离子的平均动能与没有电场的情况相似*,为: $ 1/2 M v^2 = 3/2 k T $ *离子漂移速度* $ arrow(u)^plus.minus = mu^plus.minus arrow(E)/P $ 其中$mu$为离子的迁移率,$P$为气体的压强,$arrow(E)/P$是约化场强。离子的迁移率可表示为: $ mu^plus.minus = (e lambda_0)/(2 M macron(v)) $ 其中$lambda_0$为气体分子单位气压下的平均自由程,$macron(v)$为气体分子乱运动的平均速度。由于离子的平均动能基本上不随电场而变化,则$macron(v)$近似为常数,即离子的迁移率不随电场变化,近似为常数。 2. *自由电子的定向漂移* 电子与气体分子发生弹性碰撞时,每次损失的能量很小,因此,电子在两次碰撞中由外电场加速的*能量可积累起来*。直到使它的弹性碰撞能量损失和碰撞间从电场获得的能量相等,或发生非弹性碰撞为止。达到平衡状态时,即损失能量等于从电场获得的能量时, 电子的平均能量为: $ 1/2 m_e v_e^2 = eta 3/2 k T $ 其中$eta$是*电子温度*,是电场强度的函数。 电子的漂移速度与*约化场强*不成正比,可用函数表示: $ arrow(u)_e = f(arrow(E)/P) $ 函数关系由实验测定,一般给出实验曲线。呈现*饱和特性*。电子漂移速度对气体成分很敏感,少量双原子或多原子分子气体的混入就可显著提高电子漂移速度。 使电子漂移速度显著提高的气体:一般是甲烷、二氧化碳及氮等*多原子*或*双原子*分子气体。 这些气体分子有很多*低能级*,有它们存在,电子能量不用积累到很高,就可能发生非弹性碰撞而大量损失能量了。这样,少量多原子分子的加入使气体中电子的平均动能显著下降,也就可以使电子*乱运动的平均速度下降*,这将会提高电子漂移速度,减小电子的扩散系数。这一效应在气体探测器的研制中经常要用到。 电子与离子在外电场作用下的漂移速度的主要区别为: - 电子漂移速度 一般为:$10^6 "cm/s"$ - 正离子漂移速度 一般为:$10^3 "cm/s"$ *电子漂移速度对气体的组分极为灵敏。* === 气体放电 ==== 电子雪崩(Avalanche) 电子在气体中的碰撞电离过程。 发生雪崩的阈值电场:$E_T ~ 10^6"V/m"$。 电子雪崩$->$电荷量的放大$->$信号放大 能引起雪崩的其他因素: - 光子的作用(*光子反馈*,*快过程*):与前面的过程无法区分,使信号进一步放大 - 雪崩形成大量的电离和大量的激发, $~10^(−6)$sec ; - 伴随雪崩过程, 退激产生大量的光子; - 光子与气体和器壁作用, 打出光电子,$~10^(−7)$sec; - 光电子又可以引起新的雪崩。 - 二次电子发射(*离子反馈*,*慢过程*):与前面的过程可区分,产生假信号 - 雪崩区产生的正离子经过$~10^(−3)$sec 到达阴极(器壁),并可能在器壁上打出二次电子。 - 二次电子又可以引起新的雪崩。*——产生假信号。* 加入多原子分子气体可以阻断离子反馈,减少光子反馈。 ==== 非自持放电和自持放电 - 非自持放电:雪崩从产生到结束,只发生一次。如:正比计数器中的放电。 - 自持放电(自持雪崩) :通过光子的作用(光子反馈)和二次电子发射(离子反馈),雪崩持续发展。如:非自熄GM管中的放电。 == 电离室的工作机制与输出回路 === 电离室的基本结构和工作气体 不同类型的电离室在结构上基本相同。典型结构有平板型和圆柱型。 均包括: - 高压极(K):正高压或负高压; - 收集极(C):与测量仪器相联的电极,一般处于与地接近的电位; - 保护极(G):又称保护环,处于与收集极相同的电位; - 负载电阻(RL):电流流过时形成电压信号。 #figure( image("pic/2024-05-21-14-33-06.png", width: 80%), caption: [ 平板型电离室的结构 ], ) #figure( image("pic/2024-05-21-14-37-10.png", width: 80%), caption: [ 圆柱型电离室的结构 ], ) 灵敏体积:由通过收集极边缘的电力线所包围的两电极间的区域。 保护极 G 的作用: - 使灵敏体积边缘处的电场保持均匀; - 减小漏电流的影响。 若无 G,当高压很高时,会有电流通过绝缘子从负载电阻 RL上通过(即绝缘子的漏电流),从而产生噪声,保护极使漏电流不流过负载电阻。 工作气体:充满电离室内部空间,电离室的工作介质。多原子气体会被消耗。 一般电离室均需要一个密封外壳将电极系统包起来,保证稳定的工作气体成份和压力。还有流气工作方式,以一定气体流速补充新气体,排出旧气体。不用密封。 === 输出信号产生的物理过程 带电粒子在气体中*损失能量*、电离气体,产生大量*电子-离子对*;大量的电子-离子在*电场*作用下*定向漂移*,产生*信号*。 - 电荷信号 - *电流信号* - 电压信号 影响因素: - 电子-离子对:数量、位置、漂移速度 - 电场:强度和形式 - 输出回路$R_0 C_0$ #figure( image("pic/2024-05-21-14-42-42.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-21-14-45-23.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-21-14-47-03.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-21-14-50-23.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-21-14-51-07.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-21-14-51-34.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-21-14-52-10.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-21-14-54-11.png", width: 80%), numbering: none, ) 1. 只有*电荷*在极板间*移动*时,外回路才有*感应电流*流过,此时$i(t) = i^+ (t) + i^- (t)$。*正、负电荷的感应电流方向相同*,在探测器内部从阳极流向阴极, 在外部回路从阴极流向阳极。电荷漂移结束,则感应电流消失。负电荷被收集后,回路中就只有正电荷的感应电流。 2. 当$+e,-e$电荷在同一位置产生时,它们在极板上的感应电荷量分别相同,但符号相反;$+e,−e$电荷漂移结束,流过外回路的*总电荷量*为$e$;该电荷量与这一对电荷的产生*位置无关*。(正负电荷漂移速度不同/各处电场强度不同时,电流和位置有关) 3. 若入射粒子在探测器灵敏体积内产生$N$个离子对,且均在电场作用下漂移,产生的 总电流信号: $ I(t) = sum_(j = 1)^N i^+_j (t) + sum_(j = 1)^N i^-_j (t) = I^+ (t) + I^- (t) $ $I$不仅与离子对数目$N$有关,而且与各离子对产生的位置有关。 4. 当$N$个离子对全部被收集时, 流过回路的总电荷量: $ Q = N e $ 与离子对产生的位置无关,与离子对数目$N$有关。 === 电离室的输出回路 输出回路:输出信号电流(感应电流)所直接流过的回路 #figure( image("pic/2024-05-21-14-59-01.png", width: 80%), numbering: none, ) 电离室的工作方式可分为: 1. 脉冲型工作状态 记录单个入射粒子的电离效应,处于这种工作状态的电离室称为:脉冲电离室。 2. 累计型工作状态 记录大量入射粒子平均电离效应,处于这种工作状态的电离室称为:累计电离室。 == 脉冲电离室 === 脉冲电离室的输出信号 脉冲电离室:电离室处于脉冲工作状态,输出信号仅反映*单个入射粒子*的电离效应。*可测量每个入射粒子的能量、时间,入射粒子流的强度等。* 以下讨论假设:入射粒子在灵敏体积中产生$N$个离子对,并忽略扩散和复合的影响,而且在信号结束前,探测器灵敏体积内不再有其它入射粒子产生电离。 ==== 脉冲电离室的总输出电荷量 电离室*灵敏体积*内产生$N$个电子-离子对并全部被极板收集后的总输出电荷量: $ Q = N e = E/W e $ $Q$与极板形状、电场分布、输出回路参数、电离产生的位置等无关。 *电离室是一个理想的电荷源,输出回路参量对输出电荷量无影响。* ==== 脉冲电离室的输出电流信号 #figure( image("pic/2024-05-21-15-04-37.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-21-15-05-15.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-23-10-50-09.png", width: 80%), numbering: none, ) 若$t$时刻,灵敏体积中有$N_+ (t)$个正离子和$N_- (t)$个负电子在电场作用下定向漂移,则输出电流为: $ I(t) = e/V_0 (sum_(j = 1)^(N_+ (t)) arrow(E)(r_j^+ (t)) dot arrow(u)^+ (r_j^+ (t)) + sum_(j = 1)^(N_- (t)) arrow(E)(r_j^- (t)) dot arrow(u)^- (r_j^- (t)))\ I(t) = I^+ (t) + I^- (t) $ 这是电离室的*本征电流(Intrinsic Current)*。 #figure( image("pic/2024-06-01-12-42-09.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-12-44-42.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-12-45-02.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-12-54-16.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-12-54-46.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-12-55-27.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-12-58-42.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-12-59-26.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-12-59-40.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-13-00-23.png", width: 80%), numbering: none, ) 可以把电离室看成“理想”的*内阻无限大的电流源*,但这是有条件的。而*理想电荷源*则是无条件的。 #figure( image("pic/2024-06-01-13-02-07.png", width: 80%), numbering: none, ) ==== 脉冲电离室的输出电压信号 脉冲电离室的*电压信号-电流信号*关系 $ I_0 (t) = V(t)/R_0 + C_0 dd(V(t))/dd(t) $ 解该微分方程,得: $ V(t) = e^(-t/(R_0 C_0))/C_0 (integral_0^t I_0 (t') e^(t'/(R_0 C_0)) dd(t') + C_0 V(0)) $ $V(0) = 0$有: $ V(t) = e^(-t/(R_0 C_0))/C_0 integral_0^t I_0 (t') e^(t'/(R_0 C_0)) dd(t') $ 显然,$V(t)$与$I_0 (t)$、$R_0$、$C_0$有关,需要按不同输出回路参数$R_0 C_0$进行讨论。 ===== $R_0 C_0 >> T^+$ #figure( image("pic/2024-06-01-13-13-02.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-13-14-14.png", width: 80%), numbering: none, ) 结论: 当$R_0 C_0 >> T^+$,*电子和正离子的定向漂移*对输出*电压信号*都有贡献。 1. 在$t = T^+$时,输出电压脉冲信号幅度 $ h = (N e)/C_0 = E/W e/C_0 prop E $ 2. $C_0$越小,$h$越大。为此须降低$C'$。 *工作在$R_0 C_0 >> T^+$状态的电离室称为离子脉冲电离室。* 离子脉冲电离室可以测*能量*,但存在问题——输出电压脉冲*信号宽度非常大*($T^+$是ms量级),这样*入射粒子的强度不能太大*,且要求放大器电路频带非常宽,噪声大而不实用。 ===== $T^- << R_0 C_0 << T^+$ #figure( image("pic/2024-06-01-15-06-19.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-15-07-02.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-15-22-20.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-15-23-10.png", width: 80%), numbering: none, ) 结论: 当$T^- << R_0 C_0 << T^+$,*只有电子的定向漂移*对输出*电压信号*都有贡献。 1. 输出电压脉冲信号幅度$h^- = Q^- / C_0$,仅取决于电子漂移在外回路中流过的感应电荷量。 2. 由于$R_0 C_0 << T^+$,约为十微秒量级,*电压脉冲信号的宽度较小*,得到*快*的*响应时间*。 *工作在$T^- << R_0 C_0 << T^+$状态的电离室称为电子脉冲电离室。* 电子脉冲电离室脉冲宽度小,但存在问题——输出电压脉冲信号*幅度*$h^-$与初始电离的*位置*有关,也就是 $Q^-$与初始电离*位置*有关。 #figure( image("pic/2024-06-01-15-57-05.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-15-58-37.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-16-01-38.png", width: 80%), numbering: none, ) ==== 影响输出电压脉冲信号形状的因素 *电流信号与电离发生的位置有关* #figure( image("pic/2024-06-01-16-03-53.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-16-05-08.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-01-16-07-05.png", width: 80%), numbering: none, ) 关于电离室输出电压脉冲信号的重要结论: 1. 电子离子对形成即开始漂移,就会产生电流脉冲信号;*电压脉冲信号的上升时间为电流脉冲信号的持续时间*。(与$R_0 C_0$大小有关) 2. 电离室输出电流中包含*快成分*与*慢成分*,比例与*电离产生的位置有关*,导致*离子脉冲电离室*的电压脉冲信号为变前沿的脉冲,其上升时间涨落达ms量级;而*电子脉冲电离室*的电压脉冲信号是变幅度(从零到最大脉冲幅度之间)的脉冲。 3. 电子或正离子漂移对输出*电压脉冲信号*的贡献, 取决于电子或正离子收集前*扫过的电位差比例*。(与$R_0 C_0$大小有关) #figure( image("pic/2024-06-01-16-20-38.png", width: 80%), numbering: none, ) === 圆柱形电子脉冲电离室和屏栅电离室 ==== 圆柱形电子脉冲电离室 #figure( image("pic/2024-06-01-16-37-33.png", width: 40%), numbering: none, ) 利用圆柱形电场的特点减小$Q^-$对入射粒子初始电离位置的*依赖关系*,只利用*电子漂移引起的电压脉冲信号的幅度*测量入射粒子的能量。 圆柱形电场: - 距圆柱中心$r$处的电场强度: $ E(r) = V_0/(r ln(b/a)) $ - 距圆柱中心$r$处的电位为(中间接地,外接负高压) $ psi(r) = - V_0 ln(r/a)/ln(b/a) $ *输出信号* #figure( image("pic/2024-06-01-16-52-43.png", width: 80%), numbering: none, ) 圆柱形电子脉冲电离室输出电压脉冲信号*幅度*: $ h(r_0) = Q^- /C_0 = (N e)/C_0 ln(r_0 / a) / ln(b/a) $ 结论: 选择足够大的$b/a$值,在$r_0$较大时,$h(r_0)$与$r_0$之间的关系就不显著了。同时在圆柱形中,$r_0$小的区域所占体积很小,*大部分入射粒子都在 $r_0$较大处产生离子对*。 对大部分入射粒子,圆柱形电子脉冲电离室的输出电压脉冲信号幅度均接近于$(N e) / C_0$。 *柱形电子脉冲电离室中央丝极必须是阳极。* ==== 屏栅电离室(The Gridded Ion Chamber) —— 电子脉冲电离室 #figure( image("pic/2024-06-01-18-58-07.png", width: 80%), numbering: none, ) 1. 屏栅电离室信号的形成过程 1. 离子对在B-G间产生,要求入射粒子的射程$R$小于B-G间的距离$a$ 2. 栅极由网栅构成,要求栅极屏蔽完善,使电子和正离子在B-G间漂移时,仅在B, G极板上有感应电荷产生, 并在B-G回路中流过电流$i_1$ 3. 电子穿过栅极时,不应被栅极捕获,相当于$N$个电子都在栅极上产生,然后扫过G-A电极间的全部电位差在输出回路上输出电压脉冲信号: $ h^- = (N e)/C_0 = E/W e/C_0 $\ 2. *信号时滞*:离栅极最近的电子漂移到栅极所需要的时间 $ t_a = (a-R cos theta)/u_1 $ #figure( image("pic/2024-06-01-19-09-22.png", width: 30%), numbering: none, ) 3. *输出信号的上升时间*:在栅极和阳极之间有电子漂移的时间 $ T_H = (R cos theta)/u_1 + p/u_2 $ ==== 脉冲电离室输出信号的测量 + 入射带电粒子的数量;*计数* 通过对输出*脉冲数*进行测量。 + 入射带电粒子的能量;*能谱* 通过对输出*电压信号的幅度*进行测量。 + 确定入射粒子间的时间关系;*定时* 通过对输出*电压信号的时间*进行测量。 #figure( image("pic/2024-06-01-19-19-31.png", width: 80%), numbering: none, ) ==== 脉冲电离室的性能 ===== 脉冲幅度谱与*能量分辨率* *脉冲电离室可用来测量带电粒子的能量。* 对单能带电粒子,若其全部能量都损耗在灵敏体积内,则*脉冲电离室输出电压脉冲信号的幅度反映了单个入射带电粒子能量的大小*。测量多个带电粒子,按信号幅度统计可得到脉冲幅度谱。 $ h = (N e)/C_0 = E/W e/C_0 prop E $ #newpara() 用*能量分辨率*描述$h$所代表的$E$(测到的能量)的*涨落*。$h$和$E$成正比,相对标准偏差相等。 #figure( image("pic/2024-06-01-19-44-59.png", width: 80%), numbering: none, ) *能量分辨率*:FWHM,或$eta = "FWHM"/macron(h) times 100%$ 能量分辨率反映了*谱仪对粒子能量的分辨能力*。 #figure( image("pic/2024-06-01-19-48-04.png", width: 80%), numbering: none, ) 影响能量分辨率因素主要有: - 电离过程的统计涨落:最重要,是探测器能量分辨率的极限 - 放大器放大倍数的涨落 - 电子学噪声 - … *1. 电离过程的统计涨落的影响* 由于电离过程的涨落,电离产生的离子对数目 N 服从*法诺分布*。由于N很大,所以 N 所遵循的统计分布可以用*高斯分布*描述。 $ macron(h) = e/C_0 macron(N) $ *电离室输出电压脉冲信号幅度同样服从高斯分布。* $ P[h] = 1/(sqrt(2 pi) sigma_h) e^(-(h - macron(h))^2/(2 sigma_h^2)) $ 对高斯分布,可证明 $ "FWHM" = 2sqrt(2 ln 2) sigma_h = 2.355 sigma_h $ #newpara() 电压脉冲信号幅度的: - *均值*: $ macron(h) = macron(N) e/C_0 $ - *标准偏差*: $ sigma_h = sigma_N e/C_0 = sqrt(F macron(N)) e/C_0 $ - *相对标准偏差*: $ nu_h = sigma_h/macron(h) = sqrt(F /macron(N)) $ - *能量分辨率*: $ eta = "FWHM"/macron(h) = 2.355 sqrt(F /macron(N)) = 2.355 sqrt((F W)/E)\ "FWHM" = 2.355 sigma_h = 2.355 sqrt(F W E) $ 1. *能量分辨率反映了谱仪对不同入射粒子能量的分辨能力。*能量分辨率越小,则可区分更小的能量差别,能量分辨率越小越好。能量分辨率是谱仪的最主要的性能指标。 2. 前面给出的能量分辨率公式是谱仪所能达到的能量分辨率的极限和理论值(只考虑了统计涨落),可用于可检验谱仪的性能。 3. 能量分辨率的数值是*对某一能量而言*的,它与入射粒子能量的关系为 $ eta prop 1/sqrt(E) , "FWHM" prop sqrt(E) $ *2. 放大器放大倍数涨落的影响* 对于电离室谱仪,放大器输出的脉冲幅度为: $ h_A = (N e)/C_0 A $ 其中$A$为放大器的放大倍数,是连续性随机变量。则: $ nu_(h_A)^2 = nu_A^2 + nu_N^2 = nu_A^2 + F/(macron(N)) $ #newpara() *3. 放大器噪声的影响* 放大器噪声对输出脉冲幅度涨落的影响是叠加关系,即: $ h = h_1 + h_2 $ 其中前者为电离室输入脉冲宽,后者是放大器噪声折合到输入宽度的幅度。 - 幅度均值: $ macron(h) = macron(h_1) + macron(h_2) = macron(h_1) $ - 幅度方差: $ sigma_h^2 = sigma_(h_1)^2 + sigma_(h_2)^2 $ - 幅度相对方差: $ nu_h^2 = F/(macron(N)) + sigma_(h_2)^2/(macron(h_1))^2 = F/(macron(N)) + 1/J^2 $ 其中$J = (macron(h_1))^2/sigma_(h_2)^2$为*信噪比*。 综合考虑*统计涨落、放大倍数A的涨落、放大器噪声*的影响,电离室谱仪放大器输出信号的*相对均方涨落*为: $ nu_(h_A)^2 = F/(macron(N)) + nu_A^2 + 1/J^2 $ 谱仪*能量分辨率*: $ eta = 2.355 sqrt(F W E + nu_A^2 + 1/J^2) $ 脉冲幅度分析器的“*道宽∆*”对能量分辨率也有影响: $ eta_I = eta(1 + 0.28 (Delta /"FWHM")^2) $ ===== 电离室的饱和特性曲线 *饱和特性*:*脉冲幅度$h$与工作电压$V_0$的关系。* 影响因素:正离子和电子的复合或扩散效应。 #figure( image("pic/2024-06-01-20-15-32.png", width: 80%), numbering: none, ) 饱和区有斜率:随工作电压升高——① 灵敏体积增加,收集电荷区域变大;② 负离子释放电子,复合效应减小。 ===== 电离室的坪特性曲线 *坪特性:计数率$n$与工作电压$V_0$的关系。* #figure( image("pic/2024-06-01-20-20-13.png", width: 80%), numbering: none, ) ===== 探测效率(本征探测效率) 本征探测效率: $ epsilon = "记录下来的脉冲数"/"射入探测器灵敏体积的粒子数" times 100% $ 带电粒子的探测效率:$epsilon < 100%$。 探测效率取决于信号幅度是否能超过*甄别阈*,幅度小于甄别阈的信号不会被记录。 信号幅度较小的原因: 1. 带电粒子能量小; 2. 只在灵敏体积内损失一部分能量; 3. 电离过程是涨落的。 对 γ 粒子等中性粒子:探测效率首先取决于粒子与介质作用产生次级带电粒子的相互作用截面,以及次级带电粒子能否进入灵敏体积,然后还需要信号的幅度超过甄别阈才行。 ===== 时间特性――常用三种指标 1. *分辨时间*$tau$:能分辨开两个相继入射粒子间的最小时间间隔。(*死时间*) 分辨时间主要取决于*电流的持续时间、输出回路参数的选择和放大器的时间常数的大小*。 2. *时滞*$tau_d$:入射粒子的入射时刻与输出脉冲产生的时间差。 3. *时间分辨本领*:即由探测器输出脉冲确定入射粒子入射时刻的精度。(*定时精度*) == 累计电离室 电离室的输出信号反映*大量*入射粒子的*平均电离效应*时,称作*电流工作状态或累计工作状态*。此时电离室称作“累计电离室”或“电流电离室”。 设:入射粒子在电离室灵敏体积内各处单位时间、单位体积内恒定地产生$n_0 (x,y,z)$个离子对。则在灵敏体积A内单位时间的总离子对数为 $ integral_A n_0 (x,y,z) dd(A) $ 平衡状态下,输出直流电流信号是: $ I_0 = e integral_A n_0 (x,y,z) dd(A) $ === 累计电离室输出信号及其涨落 ==== 输出信号 累计电离室输出信号可以是直流电流(相当于回路中接入内阻极小的电流计,即$R_L = 0$) 或直流电压(在输出回路上的积分电压)信号。 设:单位时间内进入电离室灵敏体积内的带电粒子的平均值为$macron(n)$,每个入射带电粒子平均在灵敏体积内产生$macron(N)$个离子对;则平衡状态下,电流电离室输出的: - 电流信号的平均值为 $ macron(I) = e macron(N) macron(n) $ - 电压信号的平均值为 $ macron(V) = e macron(N) macron(n) R_0 $ ==== 输出信号的涨落 假设:每一个离子对产生后将立即使探测器产生一输出信号: $ S = f(tau) $ 设:单位时间进入电离室灵敏体积内的带电粒子的平均值为$macron(n)$,每个入射带电粒子*平均*在灵敏体积内产生$macron(N)$个离子对,$macron(n)$和$macron(N)$不随时间变化。 则: 任一时刻$t$,探测器的总输出信号是此时刻以前在探测器灵敏体积内产生的各个离子对所产生信号在$t$时刻的所取值$f(tau)$的叠加。 #figure( image("pic/2024-06-01-22-38-21.png", width: 80%), numbering: none, ) 用$Delta M$表示$t$以前的$tau tilde tau + Delta tau$时间间隔入射粒子流在探测器内产生离子对数目。这些离子对的信号经过$tau$时间到达$t$时刻的信号大小为 $ Delta M f(tau) $ $t$时刻的总信号$S_t$是$t$以前产生的所有离子对的信号的叠加: $ S_t = integral_0^oo Delta M f(tau) dd(tau) $ $Delta M$是$t$以前的$tau tilde tau + Delta tau$时间间隔内$Delta n$个入射粒子分别在探测器内产生的离子对数$N_i$的总和,是随机变量。$Delta M$是由$Delta n$和$N$串级而成的随机变量。 - $Delta M$的均值: $ macron(Delta M) = macron(Delta n) macron(N) = macron(n) macron(N) Delta tau $ - $Delta M$的方差: $ sigma_(Delta M)^2 = macron(Delta n) sigma_(N)^2 + sigma_(Delta n)^2 macron(N)^2 = macron(N)^2 macron(n) Delta tau + macron(n) F macron(N) Delta tau = macron(n) Delta tau (macron(N) ^2 + F macron(N) ) $ $Delta n$遵守泊松分布:$sigma_(Delta n)^2 = macron(Delta n) = macron(n) Delta tau$,$N$遵守法诺分布:$sigma_(N)^2 = macron(N) = F macron(N)$。 $ S_t = sum_(tau = 0)^oo Delta M f(tau) $ 由此计算得到: - $S_t$的均值: $ macron(S_t) = macron(n) macron(N)integral_0^oo f(tau) dd(tau) $ - $S_t$的方差: $ sigma_(S_t)^2 = macron(n) (macron(N)^2 + F macron(N)) integral_0^oo f^2(tau) dd(tau) $ - $S_t$的相对方差: $ nu_(S_t)^2 = sigma_(S_t)^2/macron(S_t)^2 = (1 + F/macron(N))/macron(n) (integral_0^oo f^2(tau) dd(tau))/(integral_0^oo f(tau) dd(tau))^2 $ 主要决定于入射粒子数$n$的涨落,$N$的涨落影响很小。 - *电流信号及其相对方差* 近似用宽度为$T$的矩形脉冲代表一个离子对所产生的电流信号$f(τ)$ $ f(τ) = cases( e / T &","& 0 <= τ <= T, 0 &","& τ < 0 or τ > T ) $ 电流信号的均值: $ macron(I) = e macron(N) macron(n) $ 电流信号的方差: $ sigma_(I)^2 =(1 + F/macron(N))/macron(n) (integral_0^oo f^2(tau) dd(tau))/(integral_0^oo f(tau) dd(tau))^2 approx 1/macron(n) (e^2/T)/e^2 = 1/(macron(n) T) $ - *电压信号及其相对方差* $R_0 ≠ 0$时,累计电离室可输出直流电压信号,设一个离子对漂移产生的电压信号近似为一指数信号: $ f(tau) = e/C_0 e^(-tau/(R_0 C_0)) $ 电压信号的均值: $ macron(V) = e macron(N) macron(n) R_0 $ 电压信号的方差: $ sigma_(V)^2 approx 1/(2 R_0 C_0 macron(n)) $ *累计工作状态的条件*:累计电离室工作状态要求其*输出电流或电压信号的相对均方涨落要远小于“1”*。即: $ nu_I^2 = 1/(macron(n) T) << 1, nu_V^2 = 1/(2 R_0 C_0 macron(n)) << 1\ T >> 1/(macron(n)), R_0 C_0 >> 1/(2 macron(n)) $ *电流脉冲宽度远大于入射平均时间间隔,输出回路的时间常数远大于入射平均时间间隔。* 1. “脉冲电离室”与“累计电离室”仅是电离室的两种工作状态,由*入射粒子流的强度*及*输出回路的时间常数*决定,电离室结构并无本质差别。 2. 当$macron(n)T>>1$时,$nu_I^2$, 即输出电流的涨落很小,输出为*直流电流*信号;当$R_0 C_0 >> 1/(2 macron(n))$时,$nu_V^2$,即输出电压的涨落很小,输出为*直流电压*信号。 === 电流电离室的主要性能 累计电离室与脉冲电离室一样具有*饱和特性*曲线,工作于饱和区。 累计电离室不同于脉冲电离室的特性如下: ==== 灵敏度 *灵敏度*:*单位入射粒子流强度*引起的电离室输出电流信号或电压信号 $ eta = "输入电流(电压)值"/"入射离子流的强度" ["A/(cm"^2 "s"^(-1)")"] $ 影响灵敏度的因素有*电离室的结构、气体压力和组分、入射粒子的类型和能量*等。 ==== 线性范围 *线性范围*:一定工作电压下,*输出信号的幅度与入射粒子流强度保持线性关系*的范围(一般用辐射强度的范围表示)。 电离室工作在饱和区。 *入射粒子流强度增大,饱和电压将提高。* 当工作电压$V_0$小于饱和电压时,电离室将工作于复合区,电流信号值小于预期,超出线性范围。增大工作电压,使其大于饱和电压,扩大线性范围。 ==== 响应时间 *响应时间*——入射粒子流强度变化时,输出信号随时间的变化规律 对电流信号,其滞后时间将最大为离子收集时间$T$,即累计电离室*电流信号的响应时间*。 对电压信号,它跟随辐射强度变化的响应时间主要决定于*电离室输出回路的时间常数$R_0 C_0$*。 === 电流电离室的应用 累计电离室的应用比脉冲电离室更为广泛,特别是充入高气压工作气体的累计电离室,*灵敏度高、性能稳定可靠、工作寿命长*。 由于具有十分良好的承受恶劣工作环境影响的能力,所以,在工业上可应用于核辐射密度计、厚度计、料位计、水分计、核子秤等。 累计电离室还可应用于剂量测量、反应堆监测等方面。 #figure( image("pic/2024-06-02-01-19-30.png", width: 80%), numbering: none, ) == 正比计数器(Proportional Counters) === 正比计数器的工作原理 利用*碰撞电离*,将*电离效应正比放大*的气体探测器。 ==== 正比计数器的结构特点 #figure( image("pic/2024-06-02-12-59-24.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-02-13-00-57.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-02-13-01-24.png", width: 80%), numbering: none, ) 当$V_0 >V_T$时,仅在$a~ r_0$区间内能发生*碰撞电离*,在$r_0~ b$区间内只有*漂移运动* $r_0$很小,入射粒子在$r_0$内产生电离的可能性很小,可忽略。因此,在不同位置入射的粒子所产生的电离效应在正比计数器中都经受同样的气体放大过程,都有*同一个气体放大倍数——正比放大*。 #figure( image("pic/2024-06-03-11-51-38.png", width: 80%), numbering: none, ) - 雪崩只在*阳极*附近*很小*的区域发生 - 雪崩产生的*电子*收集前扫过的电位差较小,对输出信号的*贡献较小* - 正比计数器输出信号主要由雪崩产生的*正离子漂移贡献* ==== 碰撞电离与气体放大 *只有电子才能实现碰撞电离*(称为:电子雪崩electron avalanche),因此*中央电极为阳极*(圆柱形气体探测器的中央电极一般均为阳极)。 定义气体放大倍数: $ A = (n(a))/(n(r_0)) = "到达阳极的电子数"/("进入"r_0"区域的电子数") $ 气体放大倍数与工作电压的关系: $ ln A = V_0^(1/2) (sqrt(V_0/V_T) - 1) $ $A$仅与$V_0$和$V_T$有关,*与粒子入射位置无关*。 ==== 气体放大过程中光子的作用——光子反馈 电子雪崩中,既有碰撞电离,也有碰撞激发;*退激产生的紫外光子在阴极打出次电子*,次电子在电场的作用下漂向阳极,并在阳极附近发生碰撞电离。 光子反馈概率$γ$:每个到达阳极的电子通过光子反馈在阴极产生一个次电子的概率。由于光子反馈,使得总放大倍数增加: $ A_"total" = A + gamma A^2 + gamma^2 A^3 + … = A/(1 - gamma A) $ 对于光子反馈的影响,注意: - 光子反馈的过程($10^(-9)$s) 远快于电子的漂移过程($10^(-6)$s),对信号的形成而言,*与原信号在时间上是同时事件*。 - 加入少量*多原子分子气体$M$,可以减小光子反馈*。 $M$可强烈吸收气体分子退激发出的紫外光子而处于激发态$M^*$,$M^*$退激不再发出光子而是分解为几个小分子(*超前离解*)。$M$可以阻止紫外光子打到阴极而减小了光子反馈,使$ln A ∝V_0$曲线的变化平缓。 ==== 气体放大过程中正离子的作用 离子漂移速度慢,在电子漂移、碰撞电离等过程中,可认为*正离子基本没动*,形成*空间电荷*,处于*阳极丝附近*,会影响附近区域的电场,使电场强度变弱,影响电子雪崩过程的进行。(终止雪崩放电) - 正离子漂移到达阴极,与阴极表面感应电荷中和时有一定概率产生次电子,发生新的电子雪崩过程,称为*离子反馈*; - 离子反馈是*慢过程*,可在真信号后形成小的*假信号*; - 可通过加入少量*多原子分子气体阻断离子反馈*。 利用$M^*$的超前离解阻断离子反馈: - 正离子漂移过程中,与$M$发生充分的电荷交换; - 到达阴极表面时几乎均为$M^+$; - $M^+$与阴极上的电子中和时,生成$M^*$; - $M^*$超前离解,阻断了离子反馈过程。 === 正比计数器的输出信号 ==== 正比计数器的输出回路 #figure( image("pic/2024-06-03-12-20-29.png", width: 80%), numbering: none, ) ==== 正比计数器的电流脉冲信号 假定: 1. $A >> 1$。忽略初始电离的离子对,只考虑*碰撞电离产生的离子*对对输出信号的贡献。 2. 由于$r_0$很小,碰撞电离产生的电子收集前扫过的电位差较小,可忽略电子对输出信号的贡献。输出信号为碰撞电离产生的*正离子同时由阳极表面向阴极漂移而引起*。(确定的产生位置→确定的电流形状) 正比计数器的电流信号:(本征电流信号)——*碰撞电离产生的正离子漂移引起的感应电流,有确定的形状* $ I_0 (t) = (A N e)/V_0 arrow(E)(arrow(r)(t)) dot arrow(u)^+(arrow(r)(t))\ I_0 (t) = (A N e)/(2 ln b/a) (1/(t+tau)) $ 其中, $ tau = (a^2 ln(b/a) P)/(2 V_0 mu^+) approx 10^(-8)s $ $τ$仅取决于结构、工作气体及工作电压等,与初始电离发生的位置无关。 *正比计数器的电流信号与初始电离位置无关,为确定形状的电流信号。* #figure( image("pic/2024-06-03-12-26-32.png", width: 80%), numbering: none, ) ==== 正比计数器的电压脉冲信号 #figure( image("pic/2024-06-03-12-28-14.png", width: 80%), numbering: none, ) $ V(t) = (A e)/(2 ln b/a) e^(-t/(R_0 C_0))/C_0 integral_0^t e^(-t'/(R_0 C_0)) 1/(tau + t')dd(t') $ $τ$及$R_0 C_0$确定后,$F(t)$完全确定,其最大值是一个常数$K$。 电压脉冲信号的幅度:与电离位置无关 $ h = V(t) bar_max = N K = E/W K prop B prop E $ $h$的大小与$R_0 C_0$有关,但$h$与$E$的正比关系不受$R_0 C_0$选择的影响。(要求选定不变) - 电流脉冲$I_0 (t) $形状一定,与入射粒子初始电离的位置无关;输出电压脉冲为定前沿脉冲信号。 - 由于$τ tilde 10^(-8)s$,即使$t~ 100τ$,即输出电流降为初始值的$1/100$,也仅要 µs 量级, 可以获得*快的响应时间特性*。 - 对确定的$R_0 C_0$(无论值的大小),电压脉冲信号幅度均正比于$N$,因此可选择小的 $R_0 C_0$, 使电压脉冲信号的宽度较窄,获得好的分辨时间。 - 当$R_0 C_0>> T^+$时,可获得最大的电压脉冲信号幅度$(A N e)/C_0$,一般用该值表示正比计数器输出电压脉冲信号的*幅度*。 === 正比计数器的性能 ==== 输出电压脉冲信号幅度与能量分辨率 输出电压脉冲信号幅度: $ h = (A N e)/C_0 $ $h$是串级型随机变量,相对均方涨落: $ nu_h^2 = nu_N^2 + 1/macron(N) nu_A^2 = (F + nu_A^2)/macron(N) $ 实验表明,$ν_A^2 ≈ 0.68$,所以正比计数器的能量分辨率 $ eta = 2.355 nu_h = 2.355 sqrt((F + 0.68)/macron(N)) times 100% $ #newpara() 影响正比计数器能量分辨率的其他因素: - 阳极丝的均匀性:使不同区域A不同,故同样能量粒子在不同入射位置产生信号的大小不同。 - 负电性气体的存在:使一些初级电子消失,影响输出脉冲幅度。 - 末端效应和室壁效应:入射粒子能量未完全损失在灵敏体积。 - 电子学系统的影响:放大器噪声、高压的不稳定性、放大器放大倍数的不稳定性等的影响。 ==== 探测效率和坪特性 #figure( image("pic/2024-06-03-12-39-07.png", width: 80%), numbering: none, ) ==== 分辨时间(死时间)τ和计数率修正 *分辨时间(死时间)$τ$*主要由输出*脉冲的宽度决定*,脉冲越宽,死时间越大。 在死时间$τ$内产生的脉冲不会被记录,从而造成计数的损失,因此实验中必须考虑*计数率的修正*。 #figure( image("pic/2024-06-03-12-42-02.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-03-12-43-38.png", width: 80%), numbering: none, ) 两个相邻脉冲的时间间隔是一个连续型随机变量。当平均计数率为$m$时,两相邻脉冲时间间隔小于$τ$的概率为: $ P(t < τ) = integral_0^τ m e^(-m t) dd(t) = 1 - e^(-m τ) $ 若测量系统的*分辨时间*为$τ$,则与前一信号的时间间隔小于*τ*的脉冲将不被记录,由此, 单位时间内由于分辨时间影响而丢失的计数(即损失的计数率)为: $ Delta m = m (1 - e^(-m τ)) $ 正比计数器实际测量到的计数率为: $ n = m - Delta m = m e^(-m τ) $ 当$m = 1/tau$时,得到正比计数器的最大计数率: $ n_max = m /e = 1/(tau e) $ 当$m τ << 1$时, $ m approx n / (1 - n τ) $ 其中$n$是测量到的计数率,$m$是实际计数率。 ==== 时滞 正比计数器的*时滞*即初始电子从产生处漂移到阳极附近所需的时间。(*粒子入射到信号产生的时间差*) 时滞具有随机性,限制了时间测量精度。 *测量粒子入射时刻的精确度*,称为探测器的*时间分辨本领*。 注意时间分辨本领与分辨时间的不同。 === 正比计数器的应用 1. 流气式4π正比计数器 2. 低能X射线正比计数器——鼓形正比计数器 3. 单丝位置灵敏正比计数器 4. 多丝正比室 5. GEM(Gas Electron Multiplier) #figure( image("pic/2024-06-03-12-51-54.png", width: 80%), numbering: none, ) == G-M计数管 G-M计数管是(1928年) 由盖革(Geiger)和弥勒(Mueller) 发明的一种利用*自持放电*的气体电离探测器。 G-M管的特点是: - 制造简单 - 价格便宜 - 灵敏度高 - 输出电荷量大 - 使用方便 G-M管的缺点是: - 死时间长 - 信号幅度与能量无关 *G-M管不能直接测粒子能量,仅能用于计数或定时。* === G-M管的工作机制 ==== 正离子鞘的形成及自持放电过程 由于光子反馈过程的存在,气体放大倍数为: $ A_"total" = A/(1 - gamma A) $ - *正比计数器中,光子反馈和离子反馈的作用极微弱*(可忽略),一次雪崩以后增殖过程即终止,雪崩只限于局部区域,对一个初始电子仅展宽 200 µm 左右。 - *G-M管中,光子反馈和离子反馈成为重要的过程*(不可忽略)。以光子反馈为例,通常条件下$gamma approx 10^(-5)$,当时$A approx 10^5$,$A_"total" -> oo$, *阳极周围全部区域发生雪崩*。 #figure( image("pic/2024-06-03-12-59-49.png", width: 80%), numbering: none, ) ==== 有机自熄G-M计数管 在工作气体中加入 少量*有机气体*M(多原子分子气体,又称猝熄气体),例如,工作气体为 90%的氩气(Ar)和10%的酒精(C2H5OH),构成的G-M管。 该G-M管具有自熄能力,称为有机自熄G-M管,简称为有机管。 利用$M^*$的超前离解($M^*$退激发光的概率远小于离解概率) 1. 抑制光子反馈 M 能够强烈吸收$"Ar"^*$发出的紫外光形成$M^*$或$M^+$,使$"Ar"^*$发出的紫外光打不到阴极上而阻断了部分光子反馈过程; 2. 阻断离子反馈 正离子鞘漂移过程中,$"Ar"^+$与$M$发生充分的电荷交换;到达阴极表面时几乎均为$M^+$;$M^+$与阴极上的电子中和时,除克服电子逸出功外, 其多余能量使有机分子处于激发态$M^*$,$M^*$超前离解,阻断了几乎全部离子反馈过程。(实现自熄) #figure( image("pic/2024-06-03-13-08-56.png", width: 80%), numbering: none, ) *有机管存在的问题*: - *工作电压较高*:有机气体具有丰富的激发能级,电子能量难积累,为了在两次碰撞中能积累足够的能量达到氩或有机分子的电离电位,须加足够高的工作电压。 - *计数寿命较短*:有机管工作过程中,有机气体分子不断分解,使有机分子数目变少,分解产物增加,管内气压逐渐增大,最后将使有机管失效。有机管的计数寿命一般为$10^7~ 10^8$计数。 ==== 卤素自熄G-M计数管 工作气体组成:氖气(Ne)为主要工作气体,并加入微量卤素气体(如0.5%~ 1%的$"Br"_2$)。 卤素气体:$"Br"_2^*$极易超前离解,起到有机气体分子相同的作用。 #figure( image("pic/2024-06-03-13-14-27.png", width: 80%), numbering: none, ) *卤素管的特点*: - *工作电压低,阈压低*:碰撞电离中$"Ne"^∆$的中介作用,电子不需加速到电离电位 注意:当$"Br"_2$含量增加,电子在能量达到$E_"Ne"^Delta$前与$"Br"_2$分子的非弹性碰撞(激发)则变得重要,低阈压的特点将不再存在。 - *放电区域较大*:可在较弱场强下发生雪崩,电子漂移对输出信号的贡献较大,不是理想电流源(电流信号受回路参数影响,不满足) 如:$R_0$变大,则电流信号变小,$C_0$变大,则电流信号变大。 - *计数寿命较长*:Br能自动复合成$"Br"_2$。$"Br" + "Br" -> "Br"_2$ - *坪长较短、坪斜较大*:卤素为负电性气体。 === 自熄G-M管的输出信号 - 自熄G-M计数管输出脉冲信号的形状与正比计数管无明显区别。 - 初始雪崩和放电过程一般短于 1 µs,放电产生的电子在零点几微秒内被收集,在阳极丝周围留下正离子鞘。 输出电压脉冲的前沿有两个部分: - 相应于电子漂移的快变化部分 - 相应于正离子漂移的缓慢变化部分 #figure( image("pic/2024-06-03-13-25-52.png", width: 80%), numbering: none, ) - *G-M管输出信号有时滞*:在气体中生成*第一个离子对的时间与第一个雪崩的时间存在着延迟(时滞)*。时滞与第一个离子对生成的位置有关,约为0.1~ 0.4微秒会导致该量级时间测量的不准确性。 - *G-M管的时间分辨本领*:微秒量级,采取一定措施后可达到$10^(-7)$秒左右。 - *G-M管输出信号与粒子能量及种类无关* - GM管不能测能量,也不能区分粒子种类 - GM管仅能用于计数或定时 与正比计数器的基本区别: - 正比计数器是*局部放电*,信号幅度与初始电离成正比; - G-M计数管是*整管放电*,信号幅度与入射粒子的类型和能量无关,入射粒子仅起触发的作用,放电终止仅取决于阳极附近电场的减弱。 === 自熄G-M管的典型结构及性能 G-M管主要有圆柱形和钟罩形两种。 - 圆柱形主要用于γ射线测量 - 钟罩形有入射窗,主要用于α,β射线的测量 GM管的性能由计数管的丝极$a$,阴极与丝极之比$b/a$、工作气体的组成与压力等因素决定。 ==== 坪特性曲线 入射粒子流强度一定的条件下,计数率随工作电压的变化关系。 #figure( image("pic/2024-06-03-13-36-10.png", width: 80%), numbering: none, ) 衡量坪特性曲线的三个指标:坪起始电压、坪长、坪斜 #figure( image("pic/2024-06-03-13-36-49.png", width: 80%), numbering: none, ) 坪斜的成因:随工作电压增高, 1. 正离子鞘电荷量增加,猝熄不完善可能性增加。 2. 负电性气体的电子释放概率增加。 3. 灵敏体积增大。 4. 结构的尖端放电增加。 有机管:$V_A = 1000V, (V_B ̶ V_A)= 200V, "坪斜"= 5%/100V$ 卤素管:$V_A = 400V, (V_B ̶ V_A)= 100V, "坪斜"= 10%/100V$ ==== 探测效率 对用于带电粒子探测的钟罩形GM管,只要入射粒子进入灵敏体积,其探测效率可接近100%。 对用于探测 γ 射线的圆柱形GM管,仅当次电子进入灵敏体积才能引起计数,其探测效率仅~ 1%。 ==== 死时间、 复原时间及测量装置的分辨时间 - *死时间$t_d$*:随正离子鞘向阴极漂移导致电场屏蔽的减弱,电子又可以在阳极附近发生雪崩的时间。 - *复原时间$t_e$*:从死时间终了到正离子被阴极收集,输出脉冲恢复正常的时间。 - *分辨时间$t_f$*: 从“0”到第二个脉冲超过甄别阈的时间,与甄别阈的大小有关。 #figure( image("pic/2024-06-03-14-28-54.png", width: 80%), numbering: none, ) *计数率校正(G-M管不同于正比计数器)* G-M管中, 由于正离子鞘覆盖了整个阳极丝,在*第一个粒子引起的死时间内,不能产生新的雪崩*,即每个入射粒子后跟随的死时间是固定的,属于非扩展型死时间。 设:$m$为真事件的计数率,$n$为记录到的计数率,$τ$为测量系统死时间 对非扩展型情形,单位时间内: - 探测器的总死时间为$n τ$ - 探测器损失的计数为$m n τ$ 即$m - n = m n τ$,得到: $ m = n / (1 - n τ) $ ==== 寿命 计数寿命:(与甄别阈大小有关) - 有机管 ~ $10^8$计数 - 卤素管 ~ $10^9$计数 搁置寿命: 卤素管中的卤素较活泼,寿命较短。 ==== 输出回路对计数管特性的影响 在GM管中,尤其是卤素管,*放电区域较大*,*电子漂移*对输出信号的贡献比正比计数器要大,对放电终止有影响。尽可能*减小分布电容*有利于提高输出电压脉冲信号的幅度,对放电终止也起到积极作用。 #pagebreak() = 闪烁探测器 闪烁探测器:利用辐射在某些物质中产生的闪光来探测电离辐射的探测器。 构成部分: - 闪烁体 - 光电倍增管或其他测光器件 - 分压器 - 前置放大器 - 高压电源 - 低压电源 #figure( image("pic/2024-05-30-10-07-07.png", width: 80%), numbering: none, ) 闪烁探测器的工作过程: 1. 辐射射入闪烁体使闪烁体原子电离或激发,受激原子退激而发出波长在可见光波段的荧光。(发光) 2. 荧光光子被收集到光电倍增管(PMT)的光阴极,通过*光电效应*打出光电子。(测光) 3. 电子运动并倍增,并在*阳极输出回路*输出信号。 $ Q = M n_e e = M T n_"ph" e = M T E Y_"ph" e\ Q prop E $ *闪烁探测器可用来测量入射粒子的能量。* #figure( image("pic/2024-05-30-10-10-00.png", width: 80%), numbering: none, ) == 闪烁体 闪烁体:和辐射相互作用后能产生闪烁光子,而且*闪烁光子(Scintillator)*能够有效传输出来的物质。(对自己发的光透明) 理想闪烁体应具有的性质: - 发光效率高 (能量分辨率好) - 能量线性好 (能量分辨率好,能谱不畸变) - 温度性能好 (能量分辨率好,能谱不畸变) - 发射光谱和吸收光谱不重叠 (能量分辨率好) - 合适的折射率 (能量分辨率好) - 发光衰减时间短 (时间特性好) - 有良好的加工和保存性能 (制造使用方便) === 闪烁体的分类 1. 无机闪烁体 (Inorganic Scintillators): - 无机晶体(掺杂) *NaI(Tl)*,CsI(Tl),ZnS(Ag) - 玻璃体 $"Bi"_4"Ge"_3" O"_12$ BGO CsI BaF2 - 纯晶体 $"LiO"_2 dot 2"SiO"_2$(Ce) (锂玻璃) 2. 有机闪烁体(Organic Scintillators): - 有机晶体——蒽晶体等; - 有机液体闪烁体、 塑料闪烁体 3. 气体闪烁体(Scintillator Gases): Ar、 Xe等 === 闪烁体的物理特性 ==== 发射光谱 (Emission spectra) 特点: 发射光谱为连续谱。各种闪烁体都存在一个*最强波长*(发射谱极大值对应的波长, Wavelength of Max. Emission);要注意*发射光谱与光电倍增管光阴极的光谱响应*是否匹配。 #figure( image("pic/2024-05-30-10-22-23.png", width: 80%), caption: [ 闪烁体的发射光谱 ], ) ==== 发光效率(Scintillation efficiency) 与光子产额(Light Yield) *发光效率(闪烁效率)*: 指闪烁体将所吸收的射线能量转化为光子能量的比例。 $ C_"np" = (E_"ph")/E times 100 % = "闪烁体发射的光子总能量"/"入射粒子沉积在闪烁体中的能量" $ *光子产额(光能产额)*:辐射粒子在闪烁体内沉积单位能量所产生的闪烁光子数。 $ Y_"ph" = n_"ph"/E = "产生的闪烁光子总数"/"入射粒子沉积的能量" $ 单位是闪烁光子数/Mev。 二者关系: $ Y_"ph" = n_"ph"/E = E_"ph"/(h nu) 1/E = C_"np"/(h nu) $ #newpara() - 闪烁体的温度性能——闪烁效率随温度的变化 - 闪烁体的能量线性——闪烁效率随能量的变化 ==== 闪烁体的发光衰减时间 (Delay Time) - 闪烁体被激发的过程很快,约$10^(-11) − 10^(-9)$s,通常可认为瞬时完成。 - 退激过程,即闪烁体发光过程按*指数规律*进行。 对大多数无机晶体,$t$时刻单位时间发射光子数: $ n(t) = n_0 e^(-t/tau) $ 其中$tau$是*发光衰减时间常数*。闪烁体发射总光子数为: $ n_"ph" = integral_0^oo n(t) dd(t) = n_0 tau $ 有 $ n(t) = n_"ph"/tau e^(-t/tau) $ 已知大多数有机闪烁体及若干无机闪烁体的发光有*快、慢*两种成分,可表示为: $ n(t) = n_f (t) + n_s (t) = n_f/tau_f e^(-t/tau_f) + n_s/tau_s e^(-t/tau_s) $ 快、慢两种成分的相对比例随入射粒子种类不同而变化。可以利用该特征进行粒子种类鉴别。 ==== 常用闪烁体 - *NaI(Tl)*:发光效率高,$Z$,$rho$高,适宜于$γ$射线探测。易潮解,须仔细封装。 - *CsI(Tl)*:密度大,加工性较好,不易潮解。可测$γ$能谱或分辨辐射类型。 - *ZnS(Ag)*:将ZnS(Ag)粉末加1%有机玻璃粉末溶于有机溶剂涂于有机玻璃板上。 透明度差。薄层,可测$α,β$粒子。 - 有机液体闪烁体:由溶剂(二甲苯)+发光物质(PPO)+移波剂(POPOP)构成,放于玻璃或石英杯中。主要测带电粒子。 - 塑料闪烁体:苯乙烯(单体)+ PPO + POPOP,聚合成塑料。主要测带电粒子。 ==== 光的收集 #figure( image("pic/2024-05-30-10-52-25.png", width: 80%), numbering: none, ) == 光电倍增管 PhotoMultiplier Tube (PMT) === PMT的结构——光电倍增管为电真空器件 ==== PMT的主要部件和工作原理 #figure( image("pic/2024-05-30-10-53-42.png", width: 80%), numbering: none, ) 三种电极 - 光阴极Cathode:光电转换 - 打拿极Dynode:电子倍增 - 阳极Anode:电子收集 ==== PMT的类型 #figure( image("pic/2024-05-30-11-03-07.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-30-11-03-31.png", width: 80%), numbering: none, ) === PMT的主要性能 ==== 光阴极的光谱响应 ( Spectral Response) *光谱响应*:光阴极发射光电子的概率(量子效率Quantum Efficiency)与入射光波长的函数关系。 #figure( image("pic/2024-05-30-11-04-17.png", width: 80%), caption: [ 光阴极的光谱响应 ], ) ==== 光照灵敏度 - *阴极灵敏度*: $ S_K = i_K /F = "光阴极的光电子电流"/"光通量" [(mu A) /(L m) ] $ - *阳极灵敏度*: $ S_A = i_A /F = "阳极电流"/"光通量" [(A) /(L m) ] $ - *PMT增益* $ M = "演技接收到的电子数"/"第一打拿极收集到的光电子数" \ M = S_A / (g_c S_K) = i_A / (g_c i_K) = (g delta)^n = 10^6-10^8 $ 其中$g_c$是第一打拿极对光电子的收集效率,$g$是打拿极间的电子传输效率。 ==== PMT 暗电流与噪声 工作状态下的光电倍增管完全与光辐射隔绝时,其阳极仍能输出电流(暗电流)及脉冲信号(噪声) 。 成因: 1. 光阴极的热电子发射。 2. 残余气体的电离----离子反馈;残余气体的激发----光子反馈。 3. 制造工艺----尖端放电及漏电 指标: - *噪声能当量*:在没有光子照射到光阴极上时可测得噪声谱——即噪声输出脉冲幅度的分布,当纵坐标取 n=50cps 时相应的脉冲幅度所对应的入射粒子能量,称为噪声能当量,单位是 keV - *阳极暗电流*:噪声脉冲信号电流的平均值,一般为$10^(-6)~10^(-10)A$。 ==== PMT 的时间特性 *飞行时间(渡越时间)*$macron(t)_e$:电子从光阴极到阳极的平均时间。 *渡越时间离散*$Delta t_e$:$t_e$的分布函数的半宽度。 到达阳极的每个电子都经历了不同的倍增过程和飞行距离,反映了飞行时间的涨落,是决定闪烁计数器时间分辨本领的限制因素。 ==== PMT 的稳定性 稳定性指在恒定辐射源照射下,光电倍增管的阳极电流随时间的变化。 - 短期稳定性:指建立稳定工作状态所需的时间。一般开机后需要预热半小时。 - 长期稳定性:在工作达到稳定后,略有下降的慢变化,与管子的材料、工艺有关,同时与周围的环境温度有关。长期工作条件下,须采用*“稳峰”*措施。 === PMT 使用中的几个问题 1. 光屏蔽,严禁加高压时曝光。 2. 高压极性:正高压和负高压供电方式。 #figure( image("pic/2024-05-30-11-11-16.png", width: 80%), numbering: none, ) 3. 分压电阻 由于电子在两个联极间运动时,会在分压电阻上流过脉动电流,必须保*证脉动电流远小于由高压电源流经分压电阻的稳定电流*,以保证各打拿极的电压稳定。这也对高压电源的功率提出了要求。 4. 最后几级的*分压电阻上并联电容*,以旁路掉脉动电流 在分压电阻上的脉动电压,达到稳定滤波的效果。 == 闪烁探测器的输出信号 === 闪烁探测器输出信号的物理过程及输出回路 #figure( image("pic/2024-05-30-11-15-27.png", width: 80%), numbering: none, ) #figure( image("pic/2024-05-30-11-15-54.png", width: 80%), numbering: none, ) === 输出脉冲信号的电荷量 光电倍增管输出信号的总电荷量取决于: - 闪烁体发出的闪烁光子数:$n_"ph" = Y_"ph" E$ - 光子被收集到光阴极上的概率:$F_"ph"$ - 光阴极的转换效率(量子效率):$epsilon_K$ - 光电子被第一打拿极收集的概率:$g_c$,$T=epsilon_K F_"ph" g_c$ - 光电倍增管总的倍增系数:$M$ 第一打拿极收集到的光电子数为: $ n_e = n_"ph" T $ 阳极收集到的电子数为: $ n_A = M n_e = M n_"ph" T = M Y_"ph" E T $ 流过阳极回路的总电荷量为: $ Q = n_A e = M Y_"ph" e T E\ Q prop E $ 闪烁探测器输出脉冲信号的电荷量$Q$与入射粒子在闪烁体内沉积的能量$E$成正比。 === 闪烁探测器的电流脉冲信号 ==== 第一打拿极收集到光电子数的时间规律 - 闪烁体发出的光子数的时间规律为: $ n(t) = n_"ph"/tau e^(-t/tau) $ - 第一打拿极收集到的光电子数的时间规律为: $ n_e (t) = n_"ph" T/tau e^(-t/tau) $ ==== 单光电子引起的电流脉冲信号 #figure( image("pic/2024-06-05-19-37-08.png", width: 80%), numbering: none, ) ==== 一次闪烁所引起的阳极电流脉冲 一次闪烁输出电流脉冲为$n_e (t)$和$p(t)$的卷积: $ I(t) = integral_0^t n_e (t - t') p(t') dd(t') $ 代入 $ n_e (t) = n_"ph" T/tau e^(-t/tau) $ *闪烁探测器阳极输出电流脉冲信号的卷积形式* $ I(t) = (n_"ph" T )/tau integral_0^t e^(-t'/tau) p(t') dd(t') $ 两边微分并整理得到 $ tau dd(I(t))/dd(t) + I(t) = n_"ph" T p(t) $ *闪烁探测器阳极输出电流脉冲信号的微分形式*。上式和卷积形式一样给出了阳极输出电流脉冲信号与发光衰减时间$τ$及单光电子电流响应$p(t)$的关系。 在很多情况下,与$τ$相比,$p(t)$是非常窄的时间函数,这时,可忽略电子飞行时间的涨落,用*δ 函数*近似 $ p(t) = M e delta(t - t_e) $ 代入上式得到 $ I(t) = cases( (n_"ph" T M e)/tau e^(-(t - t_e)/tau) & t > t_e, 0 & t < t_e ) $ 其中 $ Q = n_"ph" T M e $ #figure( image("pic/2024-06-05-19-48-03.png", width: 80%), numbering: none, ) === 闪烁探测器的电压脉冲信号 #figure( image("pic/2024-06-05-19-49-16.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-05-19-57-11.png", width: 80%), numbering: none, ) $ V(t) = Q/C_0 (R_0 C_0)/(R_0 C_0 - tau) (e^(- t/(R_0 C_0)) - e^(- t/tau)) $ $ V_max (t) = h approx(<) Q/C_0 prop Q prop E $ 其中 $ R_0 C_0 >> tau => t approx Q/C_0\ R_0 C_0 << tau => t approx Q/C_0 (R_0 C_0)/tau $ 1. 当$R_0 C_0 >> τ$时:*电压脉冲工作状态* $ V(t) = Q/C_0 (e^(- t/(R_0 C_0)) - e^(- t/τ)) $ - 短时间内,即$t<<R_0 C_0$ $ V(t) = h(1 - e^(- t/τ)) $ - 在$t approx 5 tau$,仍满足$t << R_0 C_0$ $ V(t) approx h $ - 经过较长时间,即$t >> tau$ $ V(t) = h e^(- t/(R_0 C_0)) $ 2. 当$R_0 C_0 << τ$时:*电流脉冲瞬态状态* $ V(t) = Q/C_0 (R_0 C_0)/(R_0 C_0 - τ) (e^(- t/(R_0 C_0)) - e^(- t/τ)) $ - 短时间内,即$t<<τ$ $ V(t) = h (R_0 C_0)/(τ) (1 - e^(- t/(R_0 C_0))) $ - 在$t approx 5 R_0 C_0$,仍满足$t << τ$ $ V(t) approx (R_0 C_0)/tau h = h' << h $ - 经过较长时间,即$t >> R_0 C_0$ $ V(t) = (R_0 C_0)/tau h e^(- t/(tau)) $ #figure( image("pic/2024-06-05-20-26-30.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-05-20-27-46.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-05-20-28-17.png", width: 80%), numbering: none, ) ==== 闪烁探测器输出信号的涨落 $ V(t) = (n_A e)/C_0 (R_0 C_0)/(R_0 C_0 - τ) (e^(- t/(R_0 C_0)) - e^(- t/τ)) $ 输出电压脉冲信号的幅度$h$正比于PMT阳极收集的电子数$n_A$,即$h = k n_A$其中$k$和$R_0 C_0, tau$有关,为常数。 而 $ n_A = n_e M = n_"ph" T M $ 是由$n_"ph", T, M$串级而成的串级型随机变量。 1. 闪烁光子数$n_"ph"$的涨落——泊松分布 $ nu_(n_"ph")^2 = 1 / macron(n_"ph") $ 2. 光电子$n_e$的涨落——泊松分布 $ nu_(n_e)^2 = 1 / macron(n_e) = 1/ (macron(n_"ph") T) $ 3. 阳极电子数$n_A$的涨落——泊松分布 $ nu_(n_A)^2 = 1 / macron(n_e) + 1 / macron(n_e) nu_M^2 = 1/ (macron(n_e)) (1 + nu_M^2) $ $M$是各级$delta_i$串级而成的多级串级型随机变量, $ nu_M^2 = 1 / macron(delta)_1 + 1/ macron(delta)_1 1/ macron(delta) + ... approx 1/ delta_1 delta/(delta - 1) $ 其中$delta$是各打拿极的电子传输效率,$delta_1$是第一打拿极的电子传输效率。 从而 $ nu_(n_A)^2 = 1/(macron(n)_"ph" T)(1 + 1 /delta_1 delta/ (delta - 1)) $ 由此可推算闪烁谱仪的能量分辨率极限值为: $ eta = 2.35 sqrt(nu_(n_A)^2) = 2.35 sqrt(1/(macron(n_"ph") T)(1 + 1 /delta_1 delta/ (delta - 1))) $ 修正之后的结果为 $ nu_(n_A)^2 = 1/(macron(n_"ph") T)(1 + 1 /delta_1 delta/ (delta - 1)) + nu_T^2 + (1 + nu_T^2)((sigma_(n_"ph")/n_"ph")^2 - 1 / macron(n_"ph")) $ == 单晶闪烁 γ 谱仪 === γ 闪烁谱仪的组成与工作原理 #figure( image("pic/2024-06-05-20-47-06.png", width: 80%), numbering: none, ) === 单能 γ 射线的脉冲幅度谱 ==== 单能 γ 射线在闪烁体内产生的次电子谱 X /γ 射线不带电,与闪烁体的相互作用主要是通过三种效应实现,产生的次级电子的能谱相当复杂,因而由次级电子产生的输出脉冲幅度谱也相当复杂。 - 光电效应:光子消失,产生光电子——后续有特征X射线和俄歇电子产生 - 康普顿散射:散射光子,反冲电子 - 电子对效应:光子消失,产生正负电子对——正电子湮没产生两个0.511MeV 的湮没光子。 ===== 小晶体。如尺寸小于1cm。 可认为Compton散射产生的*散射光子或电子对效应后续产生的正电子湮没光子*等这些次级 γ 辐射都将离开闪烁体,不再与闪烁体发生相互作用。 #figure( image("pic/2024-06-05-20-56-15.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-05-20-57-29.png", width: 80%), numbering: none, ) ===== 无限大晶体 每次作用产生的次级光子总要和晶体发生作用,没有次级光子从晶体中逃逸,所有的能量最终都会沉积在闪烁体中,因此单能 γ 光子入射后所产生的次级电子的总能量就等于入射 γ 光子的能量。 #figure( image("pic/2024-06-08-15-43-08.png", width: 80%), numbering: none, ) ===== 中等大小晶体 次级效应中产生的光子部分逃出闪烁体。 #figure( image("pic/2024-06-05-21-00-17.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-08-15-43-35.png", width: 80%), numbering: none, ) 图中各部分的面积与入射单能 γ 光子产生各种效应的截面有关,也与闪烁体的材料、大小、形状等有关。 === 单晶 γ 射线谱仪的性能 单晶谱仪对*单能 γ 射线的脉冲幅度谱*,首先取决于入射γ光子所产生的*次级电子能谱*。(注意:次级电子能谱不是 γ 光子与探测器单次作用产生的次电子能量分布 , 而是每个入射 γ 光子在探测器灵敏体积内所对应的所有作用产生的次电子能量和的分布)(可能不止发生一次作用) 单能 γ 射线的输出脉冲幅度谱基本如上面所示的形状,但是存在一定差别。还要考虑,环境(*反散射峰、 特征X射线峰、 湮没辐射峰*)和测量条件(几何条件、计数率条件:*和峰*)的影响等。 #figure( image("pic/2024-06-08-15-58-54.png", width: 80%), numbering: none, ) 描述 γ 谱形的参数:和探测器材料、尺寸、形状,源探的相对位置等有关 *峰总比* $ "峰总比" = "全能峰面积"/"全谱面积" $ 主要和探测效率相关。 *峰康比* $ "峰康比" = "康普顿坪平均高度"/"全能峰高度" $ 主要和能量分辨率相关。 == 单晶 γ 射线谱仪的性能 === 响应函数 响应函数:闪烁谱仪对某单能 γ 射线的脉冲幅度谱 #figure( image("pic/2024-06-08-16-12-52.png", width: 80%), numbering: none, ) === 能量分辨率 用全能峰(光电峰)来确定闪烁谱仪的能量分辨率 $ eta = (Delta E)/E = (Delta h)/h = 2.355 nu_h = 2.355_(n_A) $ $ eta = 2.355 sqrt(1/(macron(n_"e"))(1 + 1 /delta_1 delta/ (delta - 1))) $ 定义 $ W_s= E/ macron(n_"e") $ 产生一个被第一打拿极收集的光电子所需要的平均能量。有 $ eta = 2.355 sqrt(E/ W_s (1 + 1 /delta_1 delta/ (delta - 1))) $ 闪烁探测器能量分辨率的影响因素: - $n_e = n_"ph" T$,$n_"ph" arrow.t T->1$,则$η$小(好) - $δ_1$大,则$η$小(好) - 高压稳定性的影响 $ M = a V_0^(b n), b n approx 7 $ 若要: $ (Delta M)/M < 1% $ 一般要求: $ (Delta V_0)/V_0 < 0.05% $ === 能量线性 沉积单位能量输出幅度与入射粒子能量的关系。 理想情况:闪烁体的发光效率$C_"np"$与*入射粒子沉积能量*无关,全能峰的峰位与入射γ光子的能量成正比(或线性关系)。 $ E = C times "Ch" + E_0 $ 实际情况:发光效率与入射粒子种类和能量有关。对于 γ 能谱只涉及电子引起的闪光,因此 γ 谱仪的非线性是由发光效率随电子能量不同而产生的。 例如:对 NaI(Tl),在100 keV~ 1 MeV,变化约 15%。 === γ 射线探测效率 对平行入射的 γ 光子束,*探测效率(本征效率)*: $ epsilon = 1 - e^(-N_A rho/A (sigma_"ph" + sigma_c + sigma_p)D) $ 高$Z$,$ρ$,大$D$的闪烁体探测效率高。 $ I(x)/I_0 = e^(-N_A rho/A (sigma_"ph" + sigma_c + sigma_p)D)\ I(x) = I_0 e^(- mu x), mu = N sigma, N = N_A rho/N $ 用谱分析求探测效率,常定义*源峰效率(绝对峰效率)*: $ epsilon_"sp" = "全能峰的总计数(面积)"/"放射源放出的γ光子数" $ #newpara() 相对于源放出的粒子数 - 绝对总效率 $ epsilon_"st" = "探测器记录到的全谱总计数n"/"放射源发出的粒子数N" $ - 绝对峰效率 $ epsilon_"st" = "探测器记录到的全能峰计数n"/"放射源发出的粒子数N" $ 相对于进入探测器灵敏体积的粒子数 - 相对总效率 $ epsilon_"int" = "探测器记录到的全谱总计数n"/("进入探测器灵敏体积的粒子数"N_D) $ - 相对峰效率 $ epsilon_"inp" = "探测器记录到的全能峰计数n"/("进入探测器灵敏体积的粒子数"N_D) $ === 时间特性 对分辨时间,主要取决于输出电压脉冲信号的宽度 - 对电压脉冲工作状态,条件:$R_0 C_0 >> τ$,取决于$R_0 C_0$ - 对电流脉冲工作状态,条件:$R_0 C_0 << τ$,取决于$τ$ 对*时滞*及*时间分辨本领*:主要取决于光电倍增管的电子飞行时间$macron(t_e)$及其离散$Delta t_e$。为获得好的时间分辨本领须选用快速光电倍增管。 === 稳定性——主要由PMT决定 - *短期稳定性*:对短期稳定性,须考虑开机预热达到稳定的时间。 - *长期稳定性*:长期稳定性是由环境温度和PMT的老化和使用寿命决定,为保持长期稳定性经常采用稳峰(或称稳谱)技术。 = 半导体探测器 半导体探测器的基本原理:带电粒子在半导体探测器的灵敏体积内通过电离能量损失产生*电子-空穴对*,电子和空穴在电场的作用下漂移,从而在输出回路中产生输出信号。 相同能量沉积产生的*信息载流子数目*决定了探测器的*能量分辨率*。 #figure( three-line-table[ | 探测器 | 产生一个载流子所需的平均能量 | 相同能量沉积产生的载流子数目 | 能量分辨率 | | --- | --- | --- | --- | | 气体探测器 | $tilde 30$eV | 中 | 中 | | 闪烁体探测器 | $tilde 300$eV | 少 | 差 | | 半导体探测器 | $tilde 3$eV | 多 | 好 | ], caption: [ 不同探测器的性能比较 ], kind: table, ) == 半导体的基本性质 #figure( image("pic/2024-06-10-11-55-00.png", width: 80%), numbering: none, ) 辐射探测中,常用的半导体材料为:硅(Si, Z = 14)和 锗(Ge, Z = 32),均为IV族元素。 === 本征半导体和杂质半导体 ==== 本征半导体 (intrinsic semiconductor) 理想、无杂质的半导体。导带中的电子和价带中的空穴浓度严格相等。 本征载流子浓度(本征半导体的载流子浓度): $ n_i = p_i $ #figure( image("pic/2024-06-10-11-58-04.png", width: 80%), numbering: none, ) ==== 杂质半导体 (extrinsic semiconductor) - 在半导体中有选择地掺入一些杂质(ppm或更小) - 杂质原子在半导体禁带中产生局部能级,影响半导体的性质 #figure( image("pic/2024-06-10-11-58-53.png", width: 40%), numbering: none, ) 杂质类型:替位型,间隙型 1. 替位型: - III族元素, 如B, Al, Ga等, 受主杂质, P型半导体, 多数载流子空穴 - V 族元素, 如P, As, Sb等, 施主杂质, N型半导体, 多数载流子电子 2. 间隙型: Li, 可在晶格间运动, 施主杂质, N型半导体,多数载流子电子 ==== 施主杂质(Donor impurities)与施主能级 #figure( image("pic/2024-06-10-12-01-18.png", width: 80%), numbering: none, ) ==== 受主杂质(Acceptor impurities)与受主能级 #figure( image("pic/2024-06-10-12-01-43.png", width: 80%), numbering: none, ) === 载流子浓度和补偿效应 ==== 载流子浓度 #figure( image("pic/2024-06-10-12-06-11.png", width: 80%), numbering: none, ) 半导体材料的$n · p$仅与禁带宽度$E_G$和温度$T$有关。 在相同温度下,本征半导体的相等的两种载流子浓度之积与杂质半导体的两种载流子浓度之积相等,即: $ n_i^2 = p_i^2 = n_i p_i = n p $ ==== 补偿效应 #figure( image("pic/2024-06-10-12-08-26.png", width: 80%), numbering: none, ) === 半导体作为探测器介质的物理性能 ==== 平均电离能 (W) 带电粒子在半导体中平均产生一个电子空穴对需要的能量。 *半导体的平均电离能与入射粒子能量基本无关。* #figure( image("pic/2024-06-10-14-21-32.png", width: 20%), numbering: none, ) 在半导体中沉积能量$E$时,产生的载流子数目$N$(均值)为: $ macron(N) = E/W $ $N$服从*法诺分布* - 方差为: $ sigma_N^2= (F E)/W $ - 相对方差: $ nu_N^2 = F / macron(N) = (F W)/E $ 一些实验结果给出的法诺因子$F$: Si: 0.085~0.16, Ge: 0.057~0.129 #figure( image("pic/2024-06-10-14-28-17.png", width: 80%), numbering: none, ) ==== 载流子的漂移 电子的漂移速度为$arrow(u)_n = mu_n arrow(E)$,空穴的漂移速度为$arrow(u)_p = mu_p arrow(E)$,其中$mu_n$和$mu_p$分别是电子和空穴的迁移率。 由于*电子迁移率$mu_n$和空穴迁移率$mu_p$相近*,与气体探测器不同,不存在电子型或空穴型半导体探测器。 电场强度较大时,漂移速度随电场强度的增加变慢,当电场强度$~10^(4−5)$V/cm 时,达到载流子的饱和速度$~ 10^7$cm/s。 #figure( image("pic/2024-06-10-14-30-24.png", width: 80%), numbering: none, ) ==== 电阻率与载流子寿命 *半导体电阻率:* $ rho = 1/(e(n mu_n + p mu_p)) (Omega "cm") $ 本征电阻率(300K):Si $2.3 times 10^5$ Ω cm, Ge 47 Ω cm *掺杂将大大降低半导体的电阻率*;冷却到液氮温度,电阻率将大大提高。 *载流子寿命$τ$:*载流子被俘获前,可在晶体中自由运动的平均时间。对高纯度 Si 和 Ge:$τ ~ 10^(-3)$s,寿命足够长。(*掺杂将降低载流子寿命*,杂质浓度越大,载流子寿命越短) 载流子寿命决定了载流子的漂移长度: $ L = mu E τ $ 也决定了是否能被有效收集。(漂移长度 L 大于灵敏体积的长度才能保证载流子的有效收集) #figure( image("pic/2024-06-10-14-37-26.png", width: 80%), numbering: none, ) == P-N结半导体探测器 === P-N结半导体探测器的工作原理 ==== P-N结区(势垒区)的形成 1. *多数载流子扩散,剩下空间电荷形成内电场,构成结区。* 结区内存在着势垒,结区又称为*势垒区*。势垒区为*耗尽区*,载流子浓度很低,实现高电阻率。 结区电阻率可达$10^10$ Ω cm,*远高于本征电阻率*。 #figure( image("pic/2024-06-10-14-38-48.png", width: 40%), numbering: none, ) 2. P-N结内的电流(没有外加电场) #figure( image("pic/2024-06-10-14-40-11.png", width: 80%), numbering: none, ) 3. 外加电场下的P-N结 在 P-N 结上加*反向电压*(N电位高,P电位低) ,由于结区电阻率很高,电位差几乎都降在结区。 - 外电场(反向电压形成的电场)与内电场方向一致。 - 外加电场使结区宽度增大。 - 反向电压越高,结区越宽。 #figure( image("pic/2024-06-10-14-41-11.png", width: 20%), numbering: none, ) 外加反向电压时: - 结区电场变强,结区变宽,多子穿透电流$I_f$减小; - 结区面积不变,少子扩散情况不变,$I_S$不变; - 结区体积加大,热运动产生电子 – 空穴对增多,$I_G$变大; - 反向电压产生漏电流$I_L$,主要是表面漏电流。 #figure( image("pic/2024-06-10-14-45-08.png", width: 20%), numbering: none, ) #figure( image("pic/2024-06-10-14-46-15.png", width: 80%), numbering: none, ) ==== P-N结半导体探测器的特点 ===== 结区的空间电荷分布,电场分布及电位分布 #figure( image("pic/2024-06-10-14-47-16.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-10-14-48-39.png", width: 80%), numbering: none, ) ===== 结区宽度与外加电压的关系 #figure( image("pic/2024-06-10-14-51-04.png", width: 80%), numbering: none, ) $ W = ((2 epsilon V_0)/(e N_i))^(1/2) prop sqrt(V_0/N_i) $ ===== 结区宽度的限制因素 #figure( image("pic/2024-06-10-14-54-16.png", width: 80%), numbering: none, ) ===== 结电容随工作电压的变化 根据结区电荷随外加电压的变化率,可计算得到单位面积结电容: $ C_d = epsilon/W = ((epsilon e N_i)/(2 V_0))^(1/2) $ *结电容*随外加电压变化,电压不稳定会影响探测器输出电压脉冲信号幅值的稳定性。 全耗尽后,结电容最小,且不再随工作电压变化。 === P-N结半导体探测器的类型 #figure( image("pic/2024-06-10-14-56-35.png", width: 80%), numbering: none, ) === 半导体探测器的输出信号 ==== 输出回路 #figure( image("pic/2024-06-10-14-57-43.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-10-14-58-05.png", width: 80%), numbering: none, ) ==== 输出信号 当$R_0 (C_d+C_a) >> t_c$($t_c$为载流子收集时间)时,为*电压脉冲工作状态* $ h = - Q/(C_d + C_a) = - (N e)/(C_d+ C_a) $ 其中$N$是电子-空穴对数目。 #figure( image("pic/2024-06-10-15-00-20.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-10-15-03-12.png", width: 80%), numbering: none, ) *半导体探测器一般采用电荷灵敏前放。* 电荷灵敏前置放大器输入电容 $ C_i = K times C_f $ $K > 10^4$是放大器开环增益。$C_i$很稳定,大大减小了$C_d$变化的影响。 设:电荷灵敏前置放大器的*反馈电容*为$C_f$,反馈电阻为$R_f$则:电荷灵敏前置放大器的输出脉冲幅度为: $ h approx (N e)/C_f $ 接电荷灵敏前放后,探测器输出回路的时间常数: $ R_0 C_0 approx R_f C_f $ ==== 载流子收集时间 非过耗尽工作状态,由于边界处电场强度趋于0,故定义载流子扫过 0.99W 距离的时间为载流子收集时间$t_C$(即电流信号的持续时间) $ t_c = 4.6 times 10^(-2) epsilon rho $ 其中各量单位为F/m,Ω cm,s。 *PN结探测器电压脉冲信号的上升时间很快。* === PN结探测器的主要性能 ==== 能量分辨率 PN结探测器主要用于测量*重带电粒子能谱*,如 α, p 等,要求*耗尽层厚度大于入射粒子的射程*。 影响能量分辨率的因素为: 1. 输出脉冲幅度的统计涨落 $ eta = (Delta E)/E = 2.355 nu_N = 2.355 sqrt((F W)/E) times 100% $ $ Delta E = "FWHM" = 2.355 sqrt(F W E) $ 2. 探测器和电子学噪声 - 探测器的噪声由P-N结反向电流及表面漏电流的涨落造成 - 电子学噪声主要由第一级FET噪声构成 可用:零电容噪声和噪声斜率表示。 $ ∆ E_2= ("FWHM")_2 = "零电容噪声" +"噪声斜率" × "结电容" $ 噪声也可以用*等效噪声电荷 ENC 表示*,即放大器输出噪声电压的均方根值等效到放大器输入端的噪声电荷,以电子电荷为单位;由于噪声叠加在射线产生的信号上,使谱线进一步加宽,参照产生信号的射线的能量,用FWHM表示,其单位是keV。 $ ∆ E_2= ("FWHM")_2 = 2.355 ("ENC") W $ 3. 窗厚度的影响 #figure( image("pic/2024-06-10-15-15-45.png", width: 20%), numbering: none, ) $ Delta E_3 = ("FWHM")_3 = ς (Delta d_theta - Delta d_0) $ 其中$ς$表示单位窗厚度引起的能量损失。 得到总线宽为: $ Delta E = sqrt((Delta E_1)^2 + (Delta E_2)^2 + (Delta E_3)^2) $ ==== 分辨时间 与 时间分辨本领 分辨时间:ms 前放输出,10 µ s 主放输出 时间分辨本领:$10^(-9) ~ 10^(-8)$ s ==== 能量线性 能量线性很好,与入射粒子类型和能量基本无关 ==== 辐照寿命 *辐照寿命短是半导体探测器的致命弱点*。随着使用时间的增加,载流子寿命变短,载流子收集率变小,*能量分辨率变差*。 === 应用 #figure( image("pic/2024-06-10-15-29-51.png", width: 80%), numbering: none, ) *P-N结半导体探测器存在的矛盾:* 受半导体材料的杂质浓度和外加高压的限制,一般PN结半导体探测器的*耗尽层厚度*为1~ 2mm。对强穿透能力的辐射而言,*探测效率*很小;而且辐射能量较高时,将不能把全部能量损耗在探测器中。 #figure( image("pic/2024-06-10-15-31-28.png", width: 80%), numbering: none, ) == 锂漂移半导体探测器 === 锂的漂移特性及P-I-N结 ==== 间隙型杂质——Li #figure( image("pic/2024-06-10-15-32-41.png", width: 80%), numbering: none, ) ==== P-I-N结的形成 基体用 P型半导体(因为 Li 是施主杂质),例如掺Ga的Si或Ge单晶。 #figure( image("pic/2024-06-10-15-34-58.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-10-15-35-45.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-10-15-37-24.png", width: 80%), numbering: none, ) === 锂漂移探测器的工作原理 ==== I 区的特点 - *无空间电荷*:完全补偿,无空间电荷,呈电中性,平面型结构,*I区内为均匀电场* - *高电阻率*:为耗尽区,电阻率可高达$10^(10)$Ωcm - *厚度大*:可厚达数 cm, 是锂漂移探测器灵敏体积的主要部分 ==== 空间电荷分布、 电场分布及电位分布 #figure( image("pic/2024-06-10-15-43-31.png", width: 80%), numbering: none, ) ==== 工作条件 *工作温度*——为了降低探测器本身的噪声和场效应管(FET)的噪声,同时为降低探测器的表面漏电流,锂漂移探测器和FET都要置于真空低温容器内,工作于*液氮温度(77K)*。 保存温度 - 对Ge(Li)探测器:由于锂在锗中的迁移率较高,须保存在*液氮温度*,以防止Li+Ga-离子对离解,而破坏原来的补偿; - 对Si(Li)探测器:由于锂在硅中的迁移率较低,在*常温*下保存而无永久性的损伤。 ==== 能量分辨率 由于PIN探测器能量分辨率的大大提高,开创了 γ 谱学的新阶段。 *Li漂移探测器的问题: Ge(Li)探测器须低温保存,代价很高;漂移的生产周期很长,约30~ 60天。* == 高纯锗(HPGe)半导体探测器 === 高纯锗探测器的工作原理 #figure( image("pic/2024-06-10-15-57-48.png", width: 80%), numbering: none, ) ==== P-N结的构成 #figure( image("pic/2024-06-10-15-58-18.png", width: 80%), numbering: none, ) ==== 空间电荷分布、电场分布及电位分布 #figure( image("pic/2024-06-10-15-58-42.png", width: 80%), numbering: none, ) === 高纯锗探测器的特点 #figure( image("pic/2024-06-10-15-58-59.png", width: 80%), numbering: none, ) HPGe探测器可常温保存,但需要低温(77K)工作。 == 锂漂移和HPGe半导体探测器的性能与应用 === 结构 #figure( image("pic/2024-06-10-16-01-14.png", width: 80%), numbering: none, ) === 输出信号 与电离室相似,若半导体探测器灵敏体积内的电场形式已知,则可得到其本征电流信号的表达形式,同时本征电流在输出回路上积分得到的输出电压脉冲信号也可得到定量描述。 - 与电离室相似,载流子漂移速度快,载流子收集时间就短,电流持续时间就短,电压脉冲信号的上升就快。 - 半导体内,两种载流子的漂移速度不同,即 电子电流 与 空穴电流大小不同,使得半导体探测器的电流信号形状与电离位置相关。 - 因此,电压脉冲信号的上升时间与入射带电粒子产生电子空穴对的位置有关,电压脉冲信号是变前沿的。 #figure( image("pic/2024-06-10-16-07-16.png", width: 80%), numbering: none, ) === 性能 ==== 能量分辨率 $ Delta E = sqrt((Delta E_1)^2 + (Delta E_2)^2 + (Delta E_3)^2) $ #figure( image("pic/2024-06-10-16-09-10.png", width: 80%), numbering: none, ) ==== 探测效率 一般以Φ3×3英寸的NaI(Tl)晶体为100%@1.33MeV,用*相对效率*表示。 如:85$"cm"^3$的HPGe的相对探测效率约为 19%。 ==== 峰康比 $ P = "全能峰高度"/"康普顿坪平均高度" $ ==== 能量线性 能量线性非常好 ==== 时间特性 *脉冲上升时间*100ns量级(电流脉冲宽度),定时特性远不如有机闪烁探测器。 === 应用 #figure( image("pic/2024-06-10-16-17-08.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-10-16-17-23.png", width: 80%), numbering: none, ) == 其他半导体探测器 === 化合物半导体探测器 可在常温(室温) 下使用,降低温度(如-30℃)会获得更好的性能。 === 均匀型半导体探测器 #figure( image("pic/2024-06-10-16-35-14.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-10-16-35-50.png", width: 80%), numbering: none, ) === 雪崩型半导体探测器 $E ~2×10^4$V/cm, 有内放大,改善信噪比。 用于生物、医学领域,测量体内软X射线。 === 位置灵敏半导体探测器 硅微条位置灵敏探测器(SMD),条距为20µm,工作于全耗尽状态。位置分辨率可达2~ 3 µm。 其他的像素型的位置灵敏半导体探测器。 = 辐射测量方法 辐射测量对象: - 放射性样品 活度 测量(活度、发射率); - 辐射能量或 能谱 的测量(粒子能量、能谱) ; - 辐射场量的测量(空间分布、注量率) ; - 辐射剂量的测量(辐射能量吸收) ; - 位置的测量(入射位置、其它物理量) ; - 时间的测量(入射时间、半衰期、飞行时间) ; - 粒子鉴别(鉴别未知粒子、区分不同粒子)。 辐射测量方法: - 符合方法, 符合和反符合; - 全吸收反康普顿谱仪,原理及能谱; - 康普顿谱仪-双晶谱仪,原理及能谱; - 电子对谱仪-三晶谱仪,原理及能谱。 == 放射性样品的活度测量 === 相对测量法和绝对测量法 相对测量法:已知活度为$A_0$的标准源,在相同条件下测量标准源和被测样品的计数率 $n_0$、$n$,*由计数率与活度成正比*,则样品活度: $ A = A_0 n/n_0 $ 相对测量法简便,但条件苛刻:必须有一个与被测样品相同的已知活度的标准源,且测量条件必须相同。 绝对测量法复杂,需要考虑很多影响测量的因素。但绝对测量法是活度测量的基本方法: $ n = epsilon A times "绝对强度" $ === 绝对测量中影响活度测量的因素 ==== 几何因子$f_g$ #figure( image("pic/2024-06-11-14-01-02.png", width: 80%), numbering: none, ) ==== 吸收因子$f_a$ 入射到探测器灵敏体积前射线经历的吸收影响: - 自吸收:样品材料本身的吸收 - 空气吸收:样品和探测器间介质的吸收 - 窗吸收:探测器入射窗的吸收 减小吸收影响的措施: - 样品薄 - 抽真空 - 薄窗/放入内部 #figure( image("pic/2024-06-11-14-02-22.png", width: 80%), numbering: none, ) ==== 散射因子$f_b$ 射线被周围介质散射的影响。 散射对测量的影响: - 正向散射:使射向探测器灵敏区的射线偏离而不能进入灵敏区,使计数率减少。 - 反向散射:使原本不射向探测器的射线经散射后进入灵敏区,使计数率增加。 ==== 探测器的本征探测效率或灵敏度 1. 对脉冲工作状态:*本征探测效率*$epsilon_"in"$ $ epsilon_"in" = "测到的脉冲计数率"/"单位时间内进入灵敏体积的粒子束" times 100% $ 2. 对累计工作状态:*灵敏度*$eta$ $ eta = "信号电流(电压)值"/"入射粒子流强度" [A"/单位照射量率"] $ 有关影响因素: - 入射粒子的种类与能量; - 探测器的种类、运行状况、几何尺寸; - 电子仪器的状态(如甄别阈的大小)等。 ==== 死时间修正因子$f_tau$ $ f_tau = n/m = 1 - n tau $ 其中$n$是实际测量到的计数率,$m$是真实计数率,$tau$是探测器的死时间。 ==== 本底计数率$n_b$ $ n_0 = n_s -n_b $ === α/β放射性样品活度的测量方法 ==== 小立体角法 $ A times "绝对强度" = (n_s - n_b) / epsilon , epsilon = epsilon_"in" f_g f_a f_b f_tau $ - 对薄 α 放射性样品: $ epsilon_"in" approx 100%,f_a approx 1 ,f_b approx 1 $ - 对厚 α 放射性样品和 β 放射性样品: 需考虑各种修正因子。 该方法修正因子多,测量误差大,达5~ 10%。 #figure( image("pic/2024-06-11-14-12-11.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-11-14-13-52.png", width: 80%), numbering: none, ) $ epsilon = f_g f_tau f_m f_b f_a f_gamma epsilon_"in" $ - $f_m$ 坪斜修正因子 $ f_m = n/n_0 $ - $f_b$ 反散射修正因子 - 尽量薄的有机衬托膜: < 30μg/cm2 - 或很厚,使反散射饱和: - 高能β: 0.2 $R_(β max)$ - 低能β: 0.4 $R_(β max)$ - $f_a$ 吸收校正因子 - 单能电子逐渐损失能量,不会“突然”消失。 - β射线是连续能谱,在其路径上,不断衰减。 - β射线在介质中的吸收近似服从指数规律 $n = n_0 e^(- mu_m x_m)$ 1. 源的自吸收 $ f_(a s) = n/n_0 = 1/(mu_m x_m) (1 - e^(- mu_m x_m)) $ 自吸收$<=>$穿透$x_m/2$的吸收体 $ f_(a s) approx e^(mu_m x_m/2) $ 2. 其它吸收的修正 $ x_"mequ" = x_"mair" + x_"mw" + x_"mm" $ 空气+探测器窗+源覆盖膜 3. 总的吸收厚度: $ mu_"mt" = x_"mequ" + x_m/2 $ 总的吸收校正因子: $ f_a = n/n_0 = e^(- mu_m x_"mt") approx 1 - mu_m x_"mt" $ - $f_gamma$ γ 计数校正 γ 计数校正 - β 衰变是原子核衰变的主要形式 - β 衰变形成的子核一般都处于激发态,会发出 γ 射线 - 137Cs、 60C o等 γ 源都是 β 衰变的产物 - β 探测器对 γ 射线也会有响应 - GM,塑料闪烁体等 $ f_gamma = n_1/(n_1 - n_2) $ ==== 4π计数法 - 将源移到探测器内部,使探测器对源所张立体角为4π,减小了散射、吸收和几何位置的影响。 - 测量误差小,可好于1%。 对固态样品,可用流气式 4π 正比计数器; 对低能样品,可用内充气正比计数器和液体闪烁 计数器(如测量14C、 3H等低能 β 放射性样品,可将14C、3H混于工作介质中) === γ 射线强度的测量 γ 射线强度的测量包括 γ 辐射场测量和 γ 射线放射源活度的测量。可以用相对测量法和绝对测量法测量。 测量 γ 能谱,利用 γ 谱的全能峰面积来确定源活度,常用源峰效率: $ epsilon_"sp" = "全能峰计数"/"源发出的γ光子数" $ 由计数率得到源活度: $ A times "绝对强度" = (n_s - n_b) / epsilon_"sp" $ == 符合测量方法 *符合事件*:两个或两个以上的时间相关事件。 #figure( image("pic/2024-06-11-14-38-18.png", width: 80%), numbering: none, ) *符合方法*:用不同的探测器来判断两个或两个以上事件的时间上的同时性或相关性的方法。 === 符合(正符合) ——用符合电路来选择同时事件 #figure( image("pic/2024-06-11-14-39-59.png", width: 80%), numbering: none, ) === 反符合—— 用反符合电路来消除同时事件 反符合电路的典型应用:*反康普顿谱仪*——有效提高峰总比或峰康比 “只”记录 γ 射线在探测器中的*能量全吸收*事件;“去除” 康普顿散射光子逃逸的事件; “去除” 电子对效应湮没辐射逃逸的事件。由于几何覆盖不完整, γ 射线探测效率 $<100%$,所以不能完全去除。 #figure( image("pic/2024-06-11-14-46-37.png", width: 80%), numbering: none, ) #figure( image("pic/2024-06-11-14-47-00.png", width: 80%), numbering: none, ) 只有主探测器有信号才给出门信号,主探测器没信号或主辅探测器同时有信号时不给出门信号。 === 符合装置的分辨时间及偶然符合 *符合装置的分辨时间*:符合装置所能区分的最小时间间隔,用$τ_s$表示。两路输入信号的时间间隔小于$τ_s$,就认为是同时事件。 *偶然符合*:同时到达(时差小于2τs )符合电路的非时间相关事件引起的符合。 *偶然符合计数率*: $ n_"rc" = 2 tau_s n_1 n_2 $ 减小偶然符合计数率的方法: ① 减小符合分辨时间 τs ,但是会影响符合效率 ② 减小各符合道计数率 n 。 通过偶然符合可测量符合装置的分辨时间 τ。 符合计数率的实验测量值 nc中包含: 真符合计数率 nc0 和 偶然符合计数率 nrc 真偶符合比: 真符合计数率nc0与偶然符合计数率nrc之比 === 延迟符合 时间关联事件可以是同时事件,也可以是不同时事件,不同时事件需要进行延迟符合。 #figure( image("pic/2024-06-11-14-54-48.png", width: 80%), numbering: none, ) === 符合曲线 符合脉冲计数值受到多方面因素的影响: - 输入脉冲的形状 - 符合电路的工作特性(如$τ_s$) - 计数器的触发阈值 综合影响通过符合曲线表现,符合测量需要先测符合曲线。 *符合曲线*:符合计数率$n$随两路信号相对延迟时间$t_d$变化的曲线,即:$n(t_d) ~ t_d ,t_d = "延迟"_2("可调") "延迟"_1("固定")$ #figure( image("pic/2024-06-11-14-57-51.png", width: 40%), numbering: none, ) 电子学瞬时符合曲线,假设: - 同步信号频率$n_(c 0)$ - 不存在时间离散 - 成形脉冲是理想的矩形波 #figure( image("pic/2024-06-11-15-04-31.png", width: 60%), numbering: none, ) 符合曲线的高度(符合计数率)为$n_(c 0)$,符合曲线的半宽度为: $"FWHM"= 2 τ_S$ 通过测量电子学瞬时符合曲线,可得符合装置的电子学分辨时间为:$tau_S = "FWHM"/2$ 符合装置的电子学分辨时间与成形脉冲宽度、形状、符合单元的工作特性等因素有关。 物理瞬时符合曲线:——时间离散 - 探测器输出脉冲时间统计涨落引起的时间晃动 - 系统噪声引起的时间晃动 - 定时电路中的时间游动
https://github.com/zomvie-break/cv-typst
https://raw.githubusercontent.com/zomvie-break/cv-typst/main/modules/professional.typ
typst
Apache License 2.0
#import "../brilliant-CV/template.typ": * #cvSection("Professional Experience") #cvEntry( title: [Web developer], society: [Kwong Chow School], logo: "../src/logos/kcs.png", date: [2023 - Present], location: [Bangkok, Thailand], description: list( [Currently developing a modern website for the school using the latest tachnologies.], ), tags: ("Django", "NextJS", "Docker", "AWS", "SEO") ) #cvEntry( title: [Teacher, Astronomy], society: [Kwong Chow School], logo: "../src/logos/kcs.png", date: [2022 - Present], location: [Bangkok, Thailand], description: list( [Planned and delivered lessons for students at elementary and secondary levels], ), tags: ("Science", "Astronomy") ) #cvEntry( title: [Project Engineer], society: [Start up], logo: "../src/logos/startup.png", date: [2019 - 2020], location: [Puebla, Mexico], description: list( [Designed and built an automated prototype for aeroponic vertical system for growing leafy greens], [Implemented sensors and data acquisition system (temperature, humidity, pressure) ], [Optimized resources for optimal growth (water, fertilizers, electricity)], ), tags: ("Python", "MicroPython", "ESP32", "Engineering") ) #cvEntry( title: [Analyst, Real Estate], society: [Agencia Inmobiliaria de Puebla], logo: "../src/logos/real_estate.png", date: [2020 - 2022], location: [Puebla, Mexico], description: list( [Supervised the construction, design, and maintenance of residential houses and warehouses], [Interacted with stakeholders and tenants as legal representative of the properties ], [Consultant for acquisition and sale of properties] ) )
https://github.com/Quaternijkon/Typst_Lab_Report
https://raw.githubusercontent.com/Quaternijkon/Typst_Lab_Report/main/content.typ
typst
= 实验内容 #lorem(300) = 实验目的 #lorem(1300) = 实验过程 == 步骤一 #lorem(1300) == 步骤二 #lorem(1300) == 步骤三 #lorem(300) === 函数一 #lorem(800) === 函数二 #lorem(800) = 实验结果 #lorem(1300)