What is the word for a rapt state induced by a yearning for the unattainable?

Solution 1:

Ecstasy. Medieval saints, including Teresa of Avila and Gregory Palamas, achieved this altered state of consciousness after intense fasting and praying.

From Random House Dictionary, © Random House, Inc. 2014.:

ecstasy (noun), plural ecstasies.

  1. rapturous delight.

  2. an overpowering emotion or exaltation; a state of sudden, intense feeling.

  3. the frenzy of poetic inspiration.

  4. mental transport or rapture from the contemplation of divine things.

Solution 2:

It sounds to me like part of the English explanation of the German word Sehnsucht.

Solution 3:

The term Saudade may fit your description:

  • (European Portuguese: [sɐwˈðaðɨ], Brazilian Portuguese: is a Portuguese or Galician word that has no direct translation in English. It describes a deep emotional state of nostalgic or profound melancholic longing for an absent something or someone that one loves. Moreover, it often carries a repressed knowledge that the object of longing may never return. A stronger form of saudade may be felt towards people and things whose whereabouts are unknown, such as a lost lover, or a family member who has gone missing, moved away, separated, or died.

Also : pining may fit the description: ( from TFD)

  • a feeling of deep longing

To pine:

  • To feel a lingering, often nostalgic desire.