added pointer to:

- Bartosz Milewski §21.2.3 in:
*Category Theory for Programmers*, Blurb (2019) [pdf, github, webpage, ISBN:9780464243878]

I have tried to combine into one single place (now here) what ended up being a multitude of scattered allusions on relation of the reader monad to the state monad – and then I tried to stream-line the result.

Still much room left, though, to polish this all up..

]]>The fact that $\bigcirc_B \coloneqq (p_B)_\ast (p_B)^\ast$ is a monad is immediate, since $(p_B)^\ast \dashv (p_B)_\ast$ is an adjoint pair (“right base change”). This means that the reader monad exists in much more generality than LCCCs even: I just needs a “right hyperdoctrine”.

E.g. the case of the “quantum reader monad” comes from the case of linear types dependent on classical types.

]]>Thanks, that’s excellent. I’m excited to see that you can define the reader monad in the generality of locally cartesian closed categories and so in a purely logical context if I understand. Is it difficult to prove that it is a monad in this generality?

]]>Okay, I have typed up a Definition-section (here).

The formulas are fairly detailed and complete, while the text around them leaves rooom to be polished up further. But I am out of steam for this now and will leave it as is for the moment.

]]>Thanks, that’s already clearer with this.

]]>Am on my phone, in a meeting. Will edit later, but just briefly:

The unit $D\to Maps(W,D)$ sends $d$ to the function on $W$ which has constant value $d$.

The multiplication $Maps(W, Maps(W,D)) \to Maps(W,D)$ sends $f(-)(-)$ to $w \mapsto f(w)(w)$.

]]>I don’t understand well what are the unit and the multiplication of the reader monad in the introduction. Would it be possible to define them more explicitly?

Probably I’m a good example of a reader that doesn’t already know the subject before reading the entry and it lacks of details for such a reader in my opinion in the sense that I don’t understand the definition of the title.

]]>I have added a diagram (here) summarizing the system of equivalences of the “quantum reader monad” over a finite base

and I have added explicit pointers to page and verse where Bob Coecke et al. mention (briefly) the monadic perspective on their “classical structures”:

Bob Coecke, Duško Pavlović, §1.5.1 of:

*Quantum measurements without sums*, in Louis Kauffman, Samuel Lomonaco (eds.),*Mathematics of Quantum Computation and Quantum Technology*, Taylor & Francis (2008) 559-596 [arXiv:quant-ph/0608035, doi:10.1201/9781584889007]Bob Coecke, Eric Oliver Paquette, §2.3 in:

*POVMs and Naimark’s theorem without sums*, Electronic Notes in Theoretical Computer Science**210**(2008) 15-31 [arXiv:quant-ph/0608072, doi:10.1016/j.entcs.2008.04.015]Bob Coecke, Eric Paquette, Dusko Pavlovic, Def. 2.8 in:

*Classical and quantum structures*(2008) [pdf]

Next I am going to split this material off to a dedicated entry *quantum reader monad*.

I have polished up the diagram a little more (still here) and added a comment on the relation to “dynamic lifting”

]]>I have added (here) a diagram which shows how “effect handling” for the quantum reader monad expresses quantum measurement.

]]>I have added a brief paragraph (here) on the Kleisli category of the reader monad on set

]]>I have added remarks on how the quantum reader monad (for finite indexed set) is (1.) Frobenius (here) and (2.) isomorphic to the writer monad induced by a special symmetric Frobenius algebra (here).

]]>On this point, I guess the following is as trivial as it is noteworthy:

The “quantum reader monad”, i.e. the reader monad on $Vect$ which I had spelled out above (here), is evidently isomorphic to the writer monad (action monad) $(-) \otimes k^{\oplus_B}$, the one which tensors with the direct sum algebra consisting of $B$-indexed copies of the ground field. This naturally identifies the reader algebras with $\mathbb{C}^{\otimes_B}$-modules in the ordinary sense of modules over algebras.

Moreover, the underlying functor of the quantum reader coincides with that of the quantum co-reader, which translates to $k^{\oplus_B}$ also being a co-algebra – in fact a special symmetric Frobenius algebra. This way we may naturally identify linear (co)modules over the (co)reader (co)monads with ordinary (co)modules over this Frobenius algebra.

But this connects the discussion of *quantum circuits via dependent linear types* to the notion of “classical contexts” due to Coecke & Pavlović (2008).

Or rather, it will once one makes explicit the relevance of (co)modules in the latter approach, which pretty much happens in Heunen & Vicary (2019), say around Lem. 5.61 there.

( This is mostly a note to myself, I guess. Will flesh this out. )

]]>Added an example/remark (here) with comments on the case of *free* quantum reader algebras.

In the section “Algebras for the reader monad” (here), where it said that these are hard to describe in general, I have added the remark that the reader monad makes sense in more general hyperdoctrines and that for dependent *linear* types the situation is different (due to/if one has existence of biproducts).

Then I added a section *Examples – Quantum reader monad* (here) which spells this out in some detail.

Have hyperlinked the term *rectangular band*, as per the discussion here.

Link to “Monads as a solution for Generalised Opacity” paper was no longer live. Found another place it is published

henry.story@bblfish.net

]]>Thanks. It was also discussed at the cafe back in 2015 (here). Out of that came the observation that $\prod: NonEmptySet^2\to NonEmptySet$ *is* monadic. So perhaps, more generally, #3 can be rescued with some non-emptyness assumptions.

I’ve added something on algebras.

]]>Stupid me.

]]>Thanks, Sam. I see you’re talking about such things in Instances of computational effects:an algebraic perspective. I’d never heard of bands before. There’s then a ’rectangular bands monad’, as discussed here, which is $id \times id$ for the identity monad.

A whole new world!

]]>If I recall correctly, when $E=2$ then the algebras are precisely the rectangular bands.

Regarding #3, I don’t think $\prod_E$ reflects isos even for finite $E$. If I’m not mistaken, when $E=\{0,1\}$, then $\prod_E(X,k_0)=\prod_E(Y,k_0)=\emptyset$ for all $X$ and $Y$. Here $k_0$ is the constant $0$ function. Maybe I misunderstood #3.

]]>It’s possible that $\prod_E: Set/E \to Set$ is monadic in general (the associated monad is this reader monad). I can check this at least in the case where $E$ is finite, using crude monadicity: $\prod_E$ preserves reflexive coequalizers since the latter are sifted colimits and these commute with finite products. It seems to be isomorphism-reflecting as well although a slick proof eludes me at the moment.

I’m not going to have any time during the remainder of today to look into the situation for more general $E$.

]]>