TITLE: Number of unramified quadratic extensions of a number field
QUESTION [8 upvotes]: Is there a general formula for the number of unramified quadratic extensions of a number field $K$?
When $K$ is quadratic, this is known (by genus theory) to be $2^{\omega(\Delta_K)-1}$, where $\omega(n)$ denotes the number of distinct prime factors of $n$ and $\Delta_K$ is the discriminant of $K$. I'm interested in results for when $K$ is of higher degree.
It seems like this problem might be much harder and is maybe adjacent to understanding the two-torsion of the class group $\text{Cl}_K$ (which seems hard when $K$ is not quadratic), but I'm pretty new to the area and could be totally off-base. Is there any hope of a more direct approach?

REPLY [7 votes]: The answer seems to be no.

The number of unramified quadratic extensions of $K$ is equal to the number of index-two subgroups of the ideal class group $\text{Cl}_K$ by class field theory.
The index-two subgroups of $\text{Cl}_K$ correspond to the non-zero elements of $\text{Hom}(\text{Cl}_K, \mathbb{Z}/2\mathbb{Z})$.
$\#\text{Hom}(\text{Cl}_K, \mathbb{Z}/2\mathbb{Z}) = \#\text{Cl}_K[2]$ by Pontryagin duality, as pointed out to me by @RP_ and @abx in the comments.
The problem of computing (or even bounding) the size of $\#\text{Cl}_K[2]$ when $K$ is not a quadratic extension appears to be under active study and seems to be a challenging problem in general.