Hochschild cohomology of the second kind: Koszul duality and Morita invariance
We define Hochschild cohomology of the second kind for differential graded (dg) or curved algebras as a derived functor in the twisted derived category. The Hochschild cohomology of the second kind of a curved or curved algebra $A$ is then equivalent to the classical Hochschild cohomology of the twisted derived dg category of $A$, which is often geometrically meaningful. Examples include the category of $\infty$-local systems on a topological space, the bounded derived category of a complex manifold and the category of matrix factorizations. We also show that Hochschild cohomology of the second kind is preserved under (nonconilpotent) Koszul duality and weak equivalences of curved algebras. The main technical ingredient is a new bimodule version of Koszul duality.