Skip to content

Commit

Permalink
fixed external link icons
Browse files Browse the repository at this point in the history
  • Loading branch information
thosgood committed Dec 11, 2023
1 parent 3edf11d commit 8d7d59a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions source/13-correcting-quantum-channels.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,7 @@ Then we can nest the bit-flip correction circuit into the phase-flip correction
We have already seen the idea of sequential composition compared to parallel composition, when we talk about the difference between matrix multiplication $BA$ ("do $A$ then $B$") and the tensor product $A\otimes B$ ("do $A$ to one part and $B$ to the other").
Neither type of composition can deal with choices: if $A$ and $B$ are of the right size, then $BA$ (or $A\otimes B$) is either defined or it isn't.
However, there are some subtleties to be aware of.

For example, associativity of a composition operation tells us that we can forget about brackets if we just have the same type of composition over and over, since $(CB)A=C(BA)$.
It seems like every operation we ever meet is associative (indeed, it's even baked into the definition of what it means to be a group), but it turns out that non-associative operations are just as interesting as non-commutative ones.
But the story doesn't stop there!
Expand Down
29 changes: 16 additions & 13 deletions web/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
<script type="text/javascript" src="./web/lite-yt-embed.js"></script>

<script type="text/javascript">
// Custom class for external links
function setExternalLinks() {
$("a[href^='http']").each(function() {
this.setAttribute("class", "external-link");
// this.setAttribute("target", "_blank");
});
}

$document.ready(function() {
// 1. Header bar customisations

Expand Down Expand Up @@ -97,7 +105,8 @@
// or clicking the icon
$(".technical-toggle, .technical > .fa").click(function() {
$(this).siblings(".technical-contents").slideToggle("fast", function() {
// Animation complete.
// Animation complete
setExternalLinks();
});
});

Expand All @@ -116,19 +125,13 @@

// Select any <a> tag whose href value does *not* start with "http"
$("a").not("a[href^='http']").each(function() {
// TO-DO
var pretty_url = this.getAttribute("href").replace(".html","");
this.setAttribute("href", pretty_url)
if (this.getAttribute("href") !== null) {
var pretty_url = this.getAttribute("href").replace(".html","");
this.setAttribute("href", pretty_url)
};
});


// 6. Small other stuff

// Custom class for external links
// TO-DO: why doesn't this work inside .technical and .idea divs?
$("a[href^='http']").each(function() {
this.setAttribute("class", "external-link");
// this.setAttribute("target", "_blank");
});
// 6. External links custom class
setExternalLinks();
});
</script>

0 comments on commit 8d7d59a

Please sign in to comment.