IT’S possible that the one thing you recognise Talulah Riley for is the one thing she has least interest in. Or rather, it’s the thing she sees as merely a nice pastime, one that happily fills in between all the things that really matter to her.

You’ll know her as an actor, most notably dressed in gymslip and stockings in the noughties reboot of the St Trinian’s films and appearing alongside Keira Knightley in Joe Wright’s 2005 adaptation of Pride and Prejudice. There have also been parts in films like Inception, The Boat That Rocked and Thor: the Dark World, and this autumn she will turn up in the HBO TV version of the Michael Crichton SF movie Westworld. (“I play a robot. A badass robot.”)

But that’s just the most visible part of her life. She’s also a tech entrepreneur, a film director, a quantum physics nut who has studied at the California Institute of Technology and thinks we might all be living in a simulation (no, really), and, as of this month, a novelist, all of which she seems rather more stoked about than appearing on screen.

“I really enjoy acting. But it’s not my thing,” she tells me the first time we meet in Edinburgh. “The acting thing was always fun for me. It was just fun. That was never what I intended to do. It was this miraculous hobby that provided me with a source of income which was great. I never had the burning acting desire: ‘I must do this or I will die.’

“I don’t think I am a great actor. I think I can play middle-class English schoolgirls quite well. St Trinian’s was right up my alley. But I don’t think I’m a great actor and I think if you know that about yourself that itch isn’t there. Which is fine.”

This is June 2015, the morning of the night her directorial debut, a romantic comedy with an environmental theme titled Scottish Mussel, gets its premiere at the Edinburgh International Film Festival. She is nervous as hell about the prospect, she says. Itshould be noted she appears in the film too. “I saved money though. I didn’t give myself a fee.”

I will meet her again almost a year later to talk about her debut novel Acts of Love, a meta spin on Fifty Shades of Grey (without the bondage scenes). On both occasions, though, we end up talking as much about free will, love as biology and Silicon Valley.

The woman I meet comes across as polite, well brought up, clever, self-possessed, in control for the most part. She tells me she recently did an online personality test. “The shout line,” she tells me, “was ‘confident individualism’.” That made sense to her, she admits, although, she points out, it also reduces her to “a personality type”.

The Herald:

And yet confident individualism isn’t the whole story. Offstage there has been a history of tabloid stories of her eventful love life. She married billionaire father-of-five Elon Musk, PayPal founder and SpaceX CEO, in 2010 at Dornoch Castle. They divorced in 2012 then married again in 2013. In 2015 rumours emerged that they’d split again but the only thing she’ll tell me is that they’re still together and he’s flying in later for the premiere.

When I meet her in 2016 it comes in the wake of newspaper reports that she has filed for divorce again. She’s reported as saying that they are “best friends” and she wouldn’t rule out marrying him again.

 Today, the subject of how to remarry a billionaire is not up for discussion, but she does tell me she’s staying in San Francisco with the co-founder of her tech start-up Forge and her two dogs. By the end of our conversation she will be showing me their pictures and telling me her border collie Timmy is the love of her life.

When we meet this second time she looks pale and drawn, though that might simply be jetlag. I have one question to ask, though, Talulah. Are you all right?

She smiles. “I’m very well, thank you, and super happy and really OK and really excited about my book. But thank you for asking.”

Yes, the book. It came about because she read Fifty Shades of Grey. Acts of Love is kind of a response. It’s about a journalist called Bernadette St John, aka “the man whisperer”, who writes vicious profile pieces and whose new subject is genius entrepreneur Radley Blake. So she follows him around for a couple of days. I tell Riley she may have an over-inflated idea of journalistic access. “It’s a fairy tale,” she laughs.

Well yes. That said, the fact it’s set in a world of billionaire entrepreneurs means it’s almost inevitably going to be mapped on to Riley’s own recent past. “I’m realising that more and more. I’ve spent a lot of time in Silicon Valley. I’ve hung out with a lot of people who are ruling the world. But it’s not like an autobiography.”

Just as well because that might make her Bernadette, who is, to be kind, not the nicest of souls. That was the point, she says. “I started thinking about how a lot of male characters are (a) written by women – the Mr Darcys of the world, the Mr Rochesters, the Christian Greys – and (b) have really misogynistic tendencies which are heightened in Fifty Shades, right down to inflicting pain.

“But if you look at literary history these male characters all have sadistic tendencies, so then I began to wonder if a female character who had all the negative qualities levelled at women – sexually conniving, manipulative – could still be an attractive character.”

Women love a rogue. When Fifty Shades became huge people went out and bought the type of rope Christian Grey used on Anastasia, she recalls. But she has trouble with the idea that Grey is an attractive character. Do you find Mr Darcy attractive though? “Yeah. I do like Mr Darcy. I do like Mr Rochester. But I liked Mr Rochester more as a young teen and as an adult I’m like, ‘Whoa, what was I buying into here?’”

Riley says writing is far more revealing of the writer than acting is. So what part of her character Bernadette comes from herself, you wonder? Talulah, are you a man-hater? A misandrist?

“Ha, I’m definitely not owning up to that. I think I can relate to certain things that do get levelled at you as a woman. Being judged on the way you look or the way you dress. Those very pedestrian things I can relate to, but hopefully not too much.”

The Herald: It’s not her first novel. She wrote one when she was 19. “It was very first novelly, very introspective, navel-gazing pretentious weirdness.” It was about a 15-year-old who falls in love with an older man. Again the temptation to see the life in the art is there.

“I was never attracted to people my own age,” she admits. “I was at an all-girls’ school and there was a boys’ school next door, but I was not interested in them at all. I felt like their mother. They didn’t do anything for me.” (Musk, by the way, is 14 years older.)

The teenage Riley was bookish, studious, self-absorbed, introverted. “I think girls definitely go a bit crazy. Hormones kick in. Hormones are crazy. But I was pretty good. I’ve never touched alcohol in my life. I’ve never had a cigarette.”

She was the only child of a Scottish policeman father and a mother who grew up in a council estate in Blackpool, left school at 14 and became a self-made millionaire.

“She was a really strong female role model in real life. She will get shit done. And then she had me and I’m really middle class. I went to a good private school. Our ways of looking at the world are quite different. She said, ‘You can do anything you want. Don’t let anyone hold you down.’”

Was there a pressure to live up to her parents’ example? “You kind of think it’s your birth right if you have great, loving parents. You kind of think that’s the way the world is. So I really didn’t process it much until I was older and then realised the rest of the world isn’t actually like that. It was a bit of a shock. ‘Oh, not everybody in the world’s like my really nice parents.’”

Her mother would have liked her to have gone to university but instead she left school to go straight on to the Pride and Prejudice film set. She did later do a year at Cal Tech and Open University courses in maths and physics. “But I’m not some crazy quantum scientist,” she insists. (There has been the odd headline to that effect.)

Then again it’s only a moment later when she is telling me she thinks that we are actually living in a simulation. Reality, she reckons, is just a mathematical projection.

So we’re living in The Matrix? “Basically.”

Who’s running it then? “If you look at anything we simulate, the conclusion I’ve reached is that there are only two types of simulation. Educational and entertainment. Can you think of anything else? So I think we’re either an educational simulation or an entertaining simulation.”

Well that buggers up the idea of free will then, doesn’t it? “If you look at miracles in terms of how we can currently model things, we can either set parameters and let the simulation run or we can stop-start and interfere and reconfigure things.”

So there you go. That uncanny happening you can’t explain in your life – the ghostly figure; the sense of deja vu; maybe even Donald Trump’s presidential candidacy – is really just the simulation rebooting. Surely you and I don’t get rebooted, Talulah?

She looks me in the eye. “How are you certain?”

Talulah Riley grew up in a house full of love and Oor Wullie annuals. Scotland has always been part of her story. As a child she’d visit her grandparents in Moffat. She slips into a reverie about the sweet shop there.

Family holidays were spent north of the border. “In my child’s eye it was the most beautiful place in the world. Just more rugged and wild.

“I remember we were driving through a valley somewhere and we got out of the car and it was the first time I had experienced real silence. We must have been somewhere really remote. There were no birds singing. You couldn’t hear anything. I’ve got all these muddled memories of sweets and silence and beauty.”

It was her father who gave her the idea for the film Scottish Mussel after he read a newspaper report about the threat to freshwater pearl fishing in Scotland and wondered what would happen if a Glasgow gangster saw an opportunity. Riley turned that into a romantic comedy in which she stars opposite Martin Compston.

She plays a conservationist who wears a bikini. Talulah, you’re colluding in your own objectification, I say. “It works for Lena Dunham.”

Is she ready for the screengrabs? “I doubt that will happen but if it does and it helps the film … It’s the most naked I’ve ever been in a film and it’s my own film.”

Of course, like any other actress who’s attractive and young, she’s done her share of glamour shoots for men’s’ lifestyle magazines. “You hope that you aren’t going to be objectified though maybe that’s naive.”

I think if you’re posing in your underwear it’s kind of inevitable. “It’s just another photoshoot. I don’t think I’ve done anything too extreme.” Well, would you do it now that you are 30? “What? Do a shoot in lingerie? Yeah, I like lingerie.”

When her film screened at the film festival last year there were a few sniffy reviews. And in the end it doesn’t look like it’s going to get a wide theatrical release. Does criticism faze her? “I think artistic criticism is a very necessary and valid thing. That doesn’t bother me. And then personal criticism doesn’t really bother me because the only people whose opinions I bother about are the people I know and love.”

That’s easier said than done, surely, to let the odd cutting remark slide by. “It seems the most passive response but it’s probably the most aggressive response if you think it through. I’ve genuinely reached a point where I passionately care about the people I know and everything else doesn’t bother me.”

Let’s talk about love then. Does the title Acts of Love imply that the latter is an action? “Love is a verb,” she agrees. “There’s the biochemical limbic responses which feel like they overtake you but I think love in the true sense of the word is an action.”

The idea of love changes as you get older, she says. “There’s the romantic way which you think is the pinnacle of love. I’m not actually sure it is the pinnacle of love.” Love now, she says, is about friends and family, “as opposed necessarily to the idea of one being who will complete you”.

Well indeed. That might be someone speaking from experience. At the same time, she says, “I definitely have a strong limbic drive. I think we are driven a lot by feeling and emotion, even as rational beings. We still have that basic part of us. Which is great. I say embrace the mess of biology.”

The Herald:

Not that she has much chance these days. She’s working all the hours God – or whoever is running this simulation – sends and more on her tech start-up. She’s working on a web platform to allow retail employees on zero-hour contracts to maximise their hours and dovetail employments. There’s been a pilot scheme in San Diego already and the big launch is next January.

“Ninety-nine per cent of start-ups die. The likelihood is we will die within the next two years but I think what we’re trying to do would benefit a lot of people.”

Basically, she says, she’s a problem solver. That’s her thing. Just as well as she’s scheduled to deliver a second novel come the New Year. How much have you written? “I have yet to set my fingers to keys.” I do the maths. Eight months until your deadline. “Robert Louis Stevenson wrote Jekyll and Hyde in a weekend. So there’s the bar.”

Riley had never been to America before she got married. When we meet for the second time she’s only weeks away from her citizenship interview. “I feel very divided in terms of where I belong because I’ve lived in America all my adult life.”

Acting now is something that fits in to all the other things she does in her life. If someone decides to make Acts of Love into a movie, I say as our time together draws to a close, will you play Bernadette? “Noooo,” she says with feeling.

One last question. Talulah, what’s your definition of love anyway? “Love is the feelings that are aroused when you hook into something that perpetuates a version of reality that you want to be true or makes you feel good and then the more you feel it the more you want. Love is an amplifier of positive aspects of reality, the experience of being human.”

Is it something she wants in her life? “I have it in my life.” As reality simulations go the one she’s in will do for now.

Acts of Love is published by Hodder & Stoughton on Thursday, priced £12.99. Scottish Mussel will get a limited theatrical release and come out on DVD next month.