Join two sets of frequencies that belong to the same input.
Since \(\exp(i a x)\exp(i b x) = \exp(i (a+b) x)\), the spectra of two gates encoding the same \(x\) are joined by computing the set of sums and absolute values of differences of their elements. We only compute non-negative frequencies in this subroutine and assume the inputs to be non-negative frequencies as well.
spec1 (set[float]) – first spectrum
spec2 (set[float]) – second spectrum
- Return type
- What is PennyLane?
- Quantum circuits
- Gradients and training
- Quantum operators
- Inspecting circuits
- Compiling circuits
- Quantum Chemistry